(function (con) {
    // the dummy function
    function dummy() {};
    // console methods that may exist
    for(var methods = "assert,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,log,markTimeline,profile,profileEnd,time,timeEnd,trace,warn".split(','), func; func = methods.pop();) {
        con[func] = con[func] || dummy;
    }
}(window.console = window.console || {})); 
// we do this crazy little dance so that the `console` object
// inside the function is a name that can be shortened to a single
// letter by the compressor to make the compressed script as tiny
// as possible.
/*!
 * jQuery JavaScript Library v1.6.2
 * http://jquery.com/
 *
 * Copyright 2011, John Resig
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * Includes Sizzle.js
 * http://sizzlejs.com/
 * Copyright 2011, The Dojo Foundation
 * Released under the MIT, BSD, and GPL Licenses.
 *
 * Date: Thu Jun 30 14:16:56 2011 -0400
 */
(function(a,b){function cv(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cs(a){if(!cg[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){ch||(ch=c.createElement("iframe"),ch.frameBorder=ch.width=ch.height=0),b.appendChild(ch);if(!ci||!ch.createElement)ci=(ch.contentWindow||ch.contentDocument).document,ci.write((c.compatMode==="CSS1Compat"?"<!doctype html>":"")+"<html><body>"),ci.close();d=ci.createElement(a),ci.body.appendChild(d),e=f.css(d,"display"),b.removeChild(ch)}cg[a]=e}return cg[a]}function cr(a,b){var c={};f.each(cm.concat.apply([],cm.slice(0,b)),function(){c[this]=a});return c}function cq(){cn=b}function cp(){setTimeout(cq,0);return cn=f.now()}function cf(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ce(){try{return new a.XMLHttpRequest}catch(b){}}function b$(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g<i;g++){if(g===1)for(h in a.converters)typeof h=="string"&&(e[h.toLowerCase()]=a.converters[h]);l=k,k=d[g];if(k==="*")k=l;else if(l!=="*"&&l!==k){m=l+" "+k,n=e[m]||e["* "+k];if(!n){p=b;for(o in e){j=o.split(" ");if(j[0]===l||j[0]==="*"){p=e[j[1]+" "+k];if(p){o=e[o],o===!0?n=p:p===!0&&(n=o);break}}}}!n&&!p&&f.error("No conversion from "+m.replace(" "," to ")),n!==!0&&(c=n?n(c):p(o(c)))}}return c}function bZ(a,c,d){var e=a.contents,f=a.dataTypes,g=a.responseFields,h,i,j,k;for(i in g)i in d&&(c[g[i]]=d[i]);while(f[0]==="*")f.shift(),h===b&&(h=a.mimeType||c.getResponseHeader("content-type"));if(h)for(i in e)if(e[i]&&e[i].test(h)){f.unshift(i);break}if(f[0]in d)j=f[0];else{for(i in d){if(!f[0]||a.converters[i+" "+f[0]]){j=i;break}k||(k=i)}j=j||k}if(j){j!==f[0]&&f.unshift(j);return d[j]}}function bY(a,b,c,d){if(f.isArray(b))f.each(b,function(b,e){c||bC.test(a)?d(a,e):bY(a+"["+(typeof e=="object"||f.isArray(e)?b:"")+"]",e,c,d)});else if(!c&&b!=null&&typeof b=="object")for(var e in b)bY(a+"["+e+"]",b[e],c,d);else d(a,b)}function bX(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;var h=a[f],i=0,j=h?h.length:0,k=a===bR,l;for(;i<j&&(k||!l);i++)l=h[i](c,d,e),typeof l=="string"&&(!k||g[l]?l=b:(c.dataTypes.unshift(l),l=bX(a,c,d,e,l,g)));(k||!l)&&!g["*"]&&(l=bX(a,c,d,e,"*",g));return l}function bW(a){return function(b,c){typeof b!="string"&&(c=b,b="*");if(f.isFunction(c)){var d=b.toLowerCase().split(bN),e=0,g=d.length,h,i,j;for(;e<g;e++)h=d[e],j=/^\+/.test(h),j&&(h=h.substr(1)||"*"),i=a[h]=a[h]||[],i[j?"unshift":"push"](c)}}}function bA(a,b,c){var d=b==="width"?a.offsetWidth:a.offsetHeight,e=b==="width"?bv:bw;if(d>0){c!=="border"&&f.each(e,function(){c||(d-=parseFloat(f.css(a,"padding"+this))||0),c==="margin"?d+=parseFloat(f.css(a,c+this))||0:d-=parseFloat(f.css(a,"border"+this+"Width"))||0});return d+"px"}d=bx(a,b,b);if(d<0||d==null)d=a.style[b]||0;d=parseFloat(d)||0,c&&f.each(e,function(){d+=parseFloat(f.css(a,"padding"+this))||0,c!=="padding"&&(d+=parseFloat(f.css(a,"border"+this+"Width"))||0),c==="margin"&&(d+=parseFloat(f.css(a,c+this))||0)});return d+"px"}function bm(a,b){b.src?f.ajax({url:b.src,async:!1,dataType:"script"}):f.globalEval((b.text||b.textContent||b.innerHTML||"").replace(be,"/*$0*/")),b.parentNode&&b.parentNode.removeChild(b)}function bl(a){f.nodeName(a,"input")?bk(a):"getElementsByTagName"in a&&f.grep(a.getElementsByTagName("input"),bk)}function bk(a){if(a.type==="checkbox"||a.type==="radio")a.defaultChecked=a.checked}function bj(a){return"getElementsByTagName"in a?a.getElementsByTagName("*"):"querySelectorAll"in a?a.querySelectorAll("*"):[]}function bi(a,b){var c;if(b.nodeType===1){b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase();if(c==="object")b.outerHTML=a.outerHTML;else if(c!=="input"||a.type!=="checkbox"&&a.type!=="radio"){if(c==="option")b.selected=a.defaultSelected;else if(c==="input"||c==="textarea")b.defaultValue=a.defaultValue}else a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value);b.removeAttribute(f.expando)}}function bh(a,b){if(b.nodeType===1&&!!f.hasData(a)){var c=f.expando,d=f.data(a),e=f.data(b,d);if(d=d[c]){var g=d.events;e=e[c]=f.extend({},d);if(g){delete e.handle,e.events={};for(var h in g)for(var i=0,j=g[h].length;i<j;i++)f.event.add(b,h+(g[h][i].namespace?".":"")+g[h][i].namespace,g[h][i],g[h][i].data)}}}}function bg(a,b){return f.nodeName(a,"table")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function W(a,b,c){b=b||0;if(f.isFunction(b))return f.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return f.grep(a,function(a,d){return a===b===c});if(typeof b=="string"){var d=f.grep(a,function(a){return a.nodeType===1});if(R.test(b))return f.filter(b,d,!c);b=f.filter(b,d)}return f.grep(a,function(a,d){return f.inArray(a,b)>=0===c})}function V(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function N(a,b){return(a&&a!=="*"?a+".":"")+b.replace(z,"`").replace(A,"&")}function M(a){var b,c,d,e,g,h,i,j,k,l,m,n,o,p=[],q=[],r=f._data(this,"events");if(!(a.liveFired===this||!r||!r.live||a.target.disabled||a.button&&a.type==="click")){a.namespace&&(n=new RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)")),a.liveFired=this;var s=r.live.slice(0);for(i=0;i<s.length;i++)g=s[i],g.origType.replace(x,"")===a.type?q.push(g.selector):s.splice(i--,1);e=f(a.target).closest(q,a.currentTarget);for(j=0,k=e.length;j<k;j++){m=e[j];for(i=0;i<s.length;i++){g=s[i];if(m.selector===g.selector&&(!n||n.test(g.namespace))&&!m.elem.disabled){h=m.elem,d=null;if(g.preType==="mouseenter"||g.preType==="mouseleave")a.type=g.preType,d=f(a.relatedTarget).closest(g.selector)[0],d&&f.contains(h,d)&&(d=h);(!d||d!==h)&&p.push({elem:h,handleObj:g,level:m.level})}}}for(j=0,k=p.length;j<k;j++){e=p[j];if(c&&e.level>c)break;a.currentTarget=e.elem,a.data=e.handleObj.data,a.handleObj=e.handleObj,o=e.handleObj.origHandler.apply(e.elem,arguments);if(o===!1||a.isPropagationStopped()){c=e.level,o===!1&&(b=!1);if(a.isImmediatePropagationStopped())break}}return b}}function K(a,c,d){var e=f.extend({},d[0]);e.type=a,e.originalEvent={},e.liveFired=b,f.event.handle.call(c,e),e.isDefaultPrevented()&&d[0].preventDefault()}function E(){return!0}function D(){return!1}function m(a,c,d){var e=c+"defer",g=c+"queue",h=c+"mark",i=f.data(a,e,b,!0);i&&(d==="queue"||!f.data(a,g,b,!0))&&(d==="mark"||!f.data(a,h,b,!0))&&setTimeout(function(){!f.data(a,g,b,!0)&&!f.data(a,h,b,!0)&&(f.removeData(a,e,!0),i.resolve())},0)}function l(a){for(var b in a)if(b!=="toJSON")return!1;return!0}function k(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(j,"$1-$2").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNaN(d)?i.test(d)?f.parseJSON(d):d:parseFloat(d)}catch(g){}f.data(a,c,d)}else d=b}return d}var c=a.document,d=a.navigator,e=a.location,f=function(){function J(){if(!e.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(J,1);return}e.ready()}}var e=function(a,b){return new e.fn.init(a,b,h)},f=a.jQuery,g=a.$,h,i=/^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/\d/,n=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,o=/^[\],:{}\s]*$/,p=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,q=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,r=/(?:^|:|,)(?:\s*\[)+/g,s=/(webkit)[ \/]([\w.]+)/,t=/(opera)(?:.*version)?[ \/]([\w.]+)/,u=/(msie) ([\w.]+)/,v=/(mozilla)(?:.*? rv:([\w.]+))?/,w=/-([a-z])/ig,x=function(a,b){return b.toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=n.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.6.2",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.done(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j<k;j++)if((a=arguments[j])!=null)for(c in a){d=i[c],f=a[c];if(i===f)continue;l&&f&&(e.isPlainObject(f)||(g=e.isArray(f)))?(g?(g=!1,h=d&&e.isArray(d)?d:[]):h=d&&e.isPlainObject(d)?d:{},i[c]=e.extend(l,h,f)):f!==b&&(i[c]=f)}return i},e.extend({noConflict:function(b){a.$===e&&(a.$=g),b&&a.jQuery===e&&(a.jQuery=f);return e},isReady:!1,readyWait:1,holdReady:function(a){a?e.readyWait++:e.ready(!0)},ready:function(a){if(a===!0&&!--e.readyWait||a!==!0&&!e.isReady){if(!c.body)return setTimeout(e.ready,1);e.isReady=!0;if(a!==!0&&--e.readyWait>0)return;A.resolveWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").unbind("ready")}},bindReady:function(){if(!A){A=e._Deferred();if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNaN:function(a){return a==null||!m.test(a)||isNaN(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1;var c;for(c in a);return c===b||D.call(a,c)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw a},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(o.test(b.replace(p,"@").replace(q,"]").replace(r,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(b,c,d){a.DOMParser?(d=new DOMParser,c=d.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b)),d=c.documentElement,(!d||!d.nodeName||d.nodeName==="parsererror")&&e.error("Invalid XML: "+b);return c},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g<h;)if(c.apply(a[g++],d)===!1)break}else if(i){for(f in a)if(c.call(a[f],f,a[f])===!1)break}else for(;g<h;)if(c.call(a[g],g,a[g++])===!1)break;return a},trim:G?function(a){return a==null?"":G.call(a)}:function(a){return a==null?"":(a+"").replace(k,"").replace(l,"")},makeArray:function(a,b){var c=b||[];if(a!=null){var d=e.type(a);a.length==null||d==="string"||d==="function"||d==="regexp"||e.isWindow(a)?E.call(c,a):e.merge(c,a)}return c},inArray:function(a,b){if(H)return H.call(b,a);for(var c=0,d=b.length;c<d;c++)if(b[c]===a)return c;return-1},merge:function(a,c){var d=a.length,e=0;if(typeof c.length=="number")for(var f=c.length;e<f;e++)a[d++]=c[e];else while(c[e]!==b)a[d++]=c[e++];a.length=d;return a},grep:function(a,b,c){var d=[],e;c=!!c;for(var f=0,g=a.length;f<g;f++)e=!!b(a[f],f),c!==e&&d.push(a[f]);return d},map:function(a,c,d){var f,g,h=[],i=0,j=a.length,k=a instanceof e||j!==b&&typeof j=="number"&&(j>0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i<j;i++)f=c(a[i],i,d),f!=null&&(h[h.length]=f);else for(g in a)f=c(a[g],g,d),f!=null&&(h[h.length]=f);return h.concat.apply([],h)},guid:1,proxy:function(a,c){if(typeof c=="string"){var d=a[c];c=a,a=d}if(!e.isFunction(a))return b;var f=F.call(arguments,2),g=function(){return a.apply(c,f.concat(F.call(arguments)))};g.guid=a.guid=a.guid||g.guid||e.guid++;return g},access:function(a,c,d,f,g,h){var i=a.length;if(typeof c=="object"){for(var j in c)e.access(a,j,c[j],f,g,d);return a}if(d!==b){f=!h&&f&&e.isFunction(d);for(var k=0;k<i;k++)g(a[k],c,f?d.call(a[k],k,g(a[k],c)):d,h);return a}return i?g(a[0],c):b},now:function(){return(new Date).getTime()},uaMatch:function(a){a=a.toLowerCase();var b=s.exec(a)||t.exec(a)||u.exec(a)||a.indexOf("compatible")<0&&v.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},sub:function(){function a(b,c){return new a.fn.init(b,c)}e.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function(d,f){f&&f instanceof e&&!(f instanceof a)&&(f=a(f));return e.fn.init.call(this,d,f,b)},a.fn.init.prototype=a.fn;var b=a(c);return a},browser:{}}),e.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){I["[object "+b+"]"]=b.toLowerCase()}),z=e.uaMatch(y),z.browser&&(e.browser[z.browser]=!0,e.browser.version=z.version),e.browser.webkit&&(e.browser.safari=!0),j.test(" ")&&(k=/^[\s\xA0]+/,l=/[\s\xA0]+$/),h=e(c),c.addEventListener?B=function(){c.removeEventListener("DOMContentLoaded",B,!1),e.ready()}:c.attachEvent&&(B=function(){c.readyState==="complete"&&(c.detachEvent("onreadystatechange",B),e.ready())});return e}(),g="done fail isResolved isRejected promise then always pipe".split(" "),h=[].slice;f.extend({_Deferred:function(){var a=[],b,c,d,e={done:function(){if(!d){var c=arguments,g,h,i,j,k;b&&(k=b,b=0);for(g=0,h=c.length;g<h;g++)i=c[g],j=f.type(i),j==="array"?e.done.apply(e,i):j==="function"&&a.push(i);k&&e.resolveWith(k[0],k[1])}return this},resolveWith:function(e,f){if(!d&&!b&&!c){f=f||[],c=1;try{while(a[0])a.shift().apply(e,f)}finally{b=[e,f],c=0}}return this},resolve:function(){e.resolveWith(this,arguments);return this},isResolved:function(){return!!c||!!b},cancel:function(){d=1,a=[];return this}};return e},Deferred:function(a){var b=f._Deferred(),c=f._Deferred(),d;f.extend(b,{then:function(a,c){b.done(a).fail(c);return this},always:function(){return b.done.apply(b,arguments).fail.apply(this,arguments)},fail:c.done,rejectWith:c.resolveWith,reject:c.resolve,isRejected:c.isResolved,pipe:function(a,c){return f.Deferred(function(d){f.each({done:[a,"resolve"],fail:[c,"reject"]},function(a,c){var e=c[0],g=c[1],h;f.isFunction(e)?b[a](function(){h=e.apply(this,arguments),h&&f.isFunction(h.promise)?h.promise().then(d.resolve,d.reject):d[g](h)}):b[a](d[g])})}).promise()},promise:function(a){if(a==null){if(d)return d;d=a={}}var c=g.length;while(c--)a[g[c]]=b[g[c]];return a}}),b.done(c.cancel).fail(b.cancel),delete b.cancel,a&&a.call(b,b);return b},when:function(a){function i(a){return function(c){b[a]=arguments.length>1?h.call(arguments,0):c,--e||g.resolveWith(g,h.call(b,0))}}var b=arguments,c=0,d=b.length,e=d,g=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred();if(d>1){for(;c<d;c++)b[c]&&f.isFunction(b[c].promise)?b[c].promise().then(i(c),g.reject):--e;e||g.resolveWith(g,b)}else g!==a&&g.resolveWith(g,d?[a]:[]);return g.promise()}}),f.support=function(){var a=c.createElement("div"),b=c.documentElement,d,e,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u;a.setAttribute("className","t"),a.innerHTML="   <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>",d=a.getElementsByTagName("*"),e=a.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=a.getElementsByTagName("input")[0],k={leadingWhitespace:a.firstChild.nodeType===3,tbody:!a.getElementsByTagName("tbody").length,htmlSerialize:!!a.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55$/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:a.className!=="t",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,k.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,k.optDisabled=!h.disabled;try{delete a.test}catch(v){k.deleteExpando=!1}!a.addEventListener&&a.attachEvent&&a.fireEvent&&(a.attachEvent("onclick",function(){k.noCloneEvent=!1}),a.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),k.radioValue=i.value==="t",i.setAttribute("checked","checked"),a.appendChild(i),l=c.createDocumentFragment(),l.appendChild(a.firstChild),k.checkClone=l.cloneNode(!0).cloneNode(!0).lastChild.checked,a.innerHTML="",a.style.width=a.style.paddingLeft="1px",m=c.getElementsByTagName("body")[0],o=c.createElement(m?"div":"body"),p={visibility:"hidden",width:0,height:0,border:0,margin:0},m&&f.extend(p,{position:"absolute",left:-1e3,top:-1e3});for(t in p)o.style[t]=p[t];o.appendChild(a),n=m||b,n.insertBefore(o,n.firstChild),k.appendChecked=i.checked,k.boxModel=a.offsetWidth===2,"zoom"in a.style&&(a.style.display="inline",a.style.zoom=1,k.inlineBlockNeedsLayout=a.offsetWidth===2,a.style.display="",a.innerHTML="<div style='width:4px;'></div>",k.shrinkWrapBlocks=a.offsetWidth!==2),a.innerHTML="<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>",q=a.getElementsByTagName("td"),u=q[0].offsetHeight===0,q[0].style.display="",q[1].style.display="none",k.reliableHiddenOffsets=u&&q[0].offsetHeight===0,a.innerHTML="",c.defaultView&&c.defaultView.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",a.appendChild(j),k.reliableMarginRight=(parseInt((c.defaultView.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0),o.innerHTML="",n.removeChild(o);if(a.attachEvent)for(t in{submit:1,change:1,focusin:1})s="on"+t,u=s in a,u||(a.setAttribute(s,"return;"),u=typeof a[s]=="function"),k[t+"Bubbles"]=u;o=l=g=h=m=j=a=i=null;return k}(),f.boxModel=f.support.boxModel;var i=/^(?:\{.*\}|\[.*\])$/,j=/([a-z])([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!l(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g=f.expando,h=typeof c=="string",i,j=a.nodeType,k=j?f.cache:a,l=j?a[f.expando]:a[f.expando]&&f.expando;if((!l||e&&l&&!k[l][g])&&h&&d===b)return;l||(j?a[f.expando]=l=++f.uuid:l=f.expando),k[l]||(k[l]={},j||(k[l].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?k[l][g]=f.extend(k[l][g],c):k[l]=f.extend(k[l],c);i=k[l],e&&(i[g]||(i[g]={}),i=i[g]),d!==b&&(i[f.camelCase(c)]=d);if(c==="events"&&!i[c])return i[g]&&i[g].events;return h?i[f.camelCase(c)]||i[c]:i}},removeData:function(b,c,d){if(!!f.acceptData(b)){var e=f.expando,g=b.nodeType,h=g?f.cache:b,i=g?b[f.expando]:f.expando;if(!h[i])return;if(c){var j=d?h[i][e]:h[i];if(j){delete j[c];if(!l(j))return}}if(d){delete h[i][e];if(!l(h[i]))return}var k=h[i][e];f.support.deleteExpando||h!=a?delete h[i]:h[i]=null,k?(h[i]={},g||(h[i].toJSON=f.noop),h[i][e]=k):g&&(f.support.deleteExpando?delete b[f.expando]:b.removeAttribute?b.removeAttribute(f.expando):b[f.expando]=null)}},_data:function(a,b,c){return f.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=f.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),f.fn.extend({data:function(a,c){var d=null;if(typeof a=="undefined"){if(this.length){d=f.data(this[0]);if(this[0].nodeType===1){var e=this[0].attributes,g;for(var h=0,i=e.length;h<i;h++)g=e[h].name,g.indexOf("data-")===0&&(g=f.camelCase(g.substring(5)),k(this[0],g,d[g]))}}return d}if(typeof a=="object")return this.each(function(){f.data(this,a)});var j=a.split(".");j[1]=j[1]?"."+j[1]:"";if(c===b){d=this.triggerHandler("getData"+j[1]+"!",[j[0]]),d===b&&this.length&&(d=f.data(this[0],a),d=k(this[0],a,d));return d===b&&j[1]?this.data(j[0]):d}return this.each(function(){var b=f(this),d=[j[0],c];b.triggerHandler("setData"+j[1]+"!",d),f.data(this,a,c),b.triggerHandler("changeData"+j[1]+"!",d)})},removeData:function(a){return this.each(function(){f.removeData(this,a)})}}),f.extend({_mark:function(a,c){a&&(c=(c||"fx")+"mark",f.data(a,c,(f.data(a,c,b,!0)||0)+1,!0))},_unmark:function(a,c,d){a!==!0&&(d=c,c=a,a=!1);if(c){d=d||"fx";var e=d+"mark",g=a?0:(f.data(c,e,b,!0)||1)-1;g?f.data(c,e,g,!0):(f.removeData(c,e,!0),m(c,d,"mark"))}},queue:function(a,c,d){if(a){c=(c||"fx")+"queue";var e=f.data(a,c,b,!0);d&&(!e||f.isArray(d)?e=f.data(a,c,f.makeArray(d),!0):e.push(d));return e||[]}},dequeue:function(a,b){b=b||"fx";var c=f.queue(a,b),d=c.shift(),e;d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),d.call(a,function(){f.dequeue(a,b)})),c.length||(f.removeData(a,b+"queue",!0),m(a,b,"queue"))}}),f.fn.extend({queue:function(a,c){typeof a!="string"&&(c=a,a="fx");if(c===b)return f.queue(this[0],a);return this.each(function(){var b=f.queue(this,a,c);a==="fx"&&b[0]!=="inprogress"&&f.dequeue(this,a)})},dequeue:function(a){return this.each(function(){f.dequeue(this,a)})},delay:function(a,b){a=f.fx?f.fx.speeds[a]||a:a,b=b||"fx";return this.queue(b,function(){var c=this;setTimeout(function(){f.dequeue(c,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,c){function m(){--h||d.resolveWith(e,[e])}typeof a!="string"&&(c=a,a=b),a=a||"fx";var d=f.Deferred(),e=this,g=e.length,h=1,i=a+"defer",j=a+"queue",k=a+"mark",l;while(g--)if(l=f.data(e[g],i,b,!0)||(f.data(e[g],j,b,!0)||f.data(e[g],k,b,!0))&&f.data(e[g],i,f._Deferred(),!0))h++,l.done(m);m();return d.promise()}});var n=/[\n\t\r]/g,o=/\s+/,p=/\r/g,q=/^(?:button|input)$/i,r=/^(?:button|input|object|select|textarea)$/i,s=/^a(?:rea)?$/i,t=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,u=/\:|^on/,v,w;f.fn.extend({attr:function(a,b){return f.access(this,a,b,!0,f.attr)},removeAttr:function(a){return this.each(function(){f.removeAttr(this,a)})},prop:function(a,b){return f.access(this,a,b,!0,f.prop)},removeProp:function(a){a=f.propFix[a]||a;return this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,g,h,i;if(f.isFunction(a))return this.each(function(b){f(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(o);for(c=0,d=this.length;c<d;c++){e=this[c];if(e.nodeType===1)if(!e.className&&b.length===1)e.className=a;else{g=" "+e.className+" ";for(h=0,i=b.length;h<i;h++)~g.indexOf(" "+b[h]+" ")||(g+=b[h]+" ");e.className=f.trim(g)}}}return this},removeClass:function(a){var c,d,e,g,h,i,j;if(f.isFunction(a))return this.each(function(b){f(this).removeClass(a.call(this,b,this.className))});if(a&&typeof a=="string"||a===b){c=(a||"").split(o);for(d=0,e=this.length;d<e;d++){g=this[d];if(g.nodeType===1&&g.className)if(a){h=(" "+g.className+" ").replace(n," ");for(i=0,j=c.length;i<j;i++)h=h.replace(" "+c[i]+" "," ");g.className=f.trim(h)}else g.className=""}}return this},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";if(f.isFunction(a))return this.each(function(c){f(this).toggleClass(a.call(this,c,this.className,b),b)});return this.each(function(){if(c==="string"){var e,g=0,h=f(this),i=b,j=a.split(o);while(e=j[g++])i=d?i:!h.hasClass(e),h[i?"addClass":"removeClass"](e)}else if(c==="undefined"||c==="boolean")this.className&&f._data(this,"__className__",this.className),this.className=this.className||a===!1?"":f._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ";for(var c=0,d=this.length;c<d;c++)if((" "+this[c].className+" ").replace(n," ").indexOf(b)>-1)return!0;return!1},val:function(a){var c,d,e=this[0];if(!arguments.length){if(e){c=f.valHooks[e.nodeName.toLowerCase()]||f.valHooks[e.type];if(c&&"get"in c&&(d=c.get(e,"value"))!==b)return d;d=e.value;return typeof d=="string"?d.replace(p,""):d==null?"":d}return b}var g=f.isFunction(a);return this.each(function(d){var e=f(this),h;if(this.nodeType===1){g?h=a.call(this,d,e.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c=a.selectedIndex,d=[],e=a.options,g=a.type==="select-one";if(c<0)return null;for(var h=g?c:0,i=g?c+1:e.length;h<i;h++){var j=e[h];if(j.selected&&(f.support.optDisabled?!j.disabled:j.getAttribute("disabled")===null)&&(!j.parentNode.disabled||!f.nodeName(j.parentNode,"optgroup"))){b=f(j).val();if(g)return b;d.push(b)}}if(g&&!d.length&&e.length)return f(e[c]).val();return d},set:function(a,b){var c=f.makeArray(b);f(a).find("option").each(function(){this.selected=f.inArray(f(this).val(),c)>=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attrFix:{tabindex:"tabIndex"},attr:function(a,c,d,e){var g=a.nodeType;if(!a||g===3||g===8||g===2)return b;if(e&&c in f.attrFn)return f(a)[c](d);if(!("getAttribute"in a))return f.prop(a,c,d);var h,i,j=g!==1||!f.isXMLDoc(a);j&&(c=f.attrFix[c]||c,i=f.attrHooks[c],i||(t.test(c)?i=w:v&&c!=="className"&&(f.nodeName(a,"form")||u.test(c))&&(i=v)));if(d!==b){if(d===null){f.removeAttr(a,c);return b}if(i&&"set"in i&&j&&(h=i.set(a,d,c))!==b)return h;a.setAttribute(c,""+d);return d}if(i&&"get"in i&&j&&(h=i.get(a,c))!==null)return h;h=a.getAttribute(c);return h===null?b:h},removeAttr:function(a,b){var c;a.nodeType===1&&(b=f.attrFix[b]||b,f.support.getSetAttribute?a.removeAttribute(b):(f.attr(a,b,""),a.removeAttributeNode(a.getAttributeNode(b))),t.test(b)&&(c=f.propFix[b]||b)in a&&(a[c]=!1))},attrHooks:{type:{set:function(a,b){if(q.test(a.nodeName)&&a.parentNode)f.error("type property can't be changed");else if(!f.support.radioValue&&b==="radio"&&f.nodeName(a,"input")){var c=a.value;a.setAttribute("type",b),c&&(a.value=c);return b}}},tabIndex:{get:function(a){var c=a.getAttributeNode("tabIndex");return c&&c.specified?parseInt(c.value,10):r.test(a.nodeName)||s.test(a.nodeName)&&a.href?0:b}},value:{get:function(a,b){if(v&&f.nodeName(a,"button"))return v.get(a,b);return b in a?a.value:null},set:function(a,b,c){if(v&&f.nodeName(a,"button"))return v.set(a,b,c);a.value=b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e=a.nodeType;if(!a||e===3||e===8||e===2)return b;var g,h,i=e!==1||!f.isXMLDoc(a);i&&(c=f.propFix[c]||c,h=f.propHooks[c]);return d!==b?h&&"set"in h&&(g=h.set(a,d,c))!==b?g:a[c]=d:h&&"get"in h&&(g=h.get(a,c))!==b?g:a[c]},propHooks:{}}),w={get:function(a,c){return f.prop(a,c)?c.toLowerCase():b},set:function(a,b,c){var d;b===!1?f.removeAttr(a,c):(d=f.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase()));return c}},f.support.getSetAttribute||(f.attrFix=f.propFix,v=f.attrHooks.name=f.attrHooks.title=f.valHooks.button={get:function(a,c){var d;d=a.getAttributeNode(c);return d&&d.nodeValue!==""?d.nodeValue:b},set:function(a,b,c){var d=a.getAttributeNode(c);if(d){d.nodeValue=b;return b}}},f.each(["width","height"],function(a,b){f.attrHooks[b]=f.extend(f.attrHooks[b],{set:function(a,c){if(c===""){a.setAttribute(b,"auto");return c}}})})),f.support.hrefNormalized||f.each(["href","src","width","height"],function(a,c){f.attrHooks[c]=f.extend(f.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),f.support.style||(f.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=""+b}}),f.support.optSelected||(f.propHooks.selected=f.extend(f.propHooks.selected,{get:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex)}})),f.support.checkOn||f.each(["radio","checkbox"],function(){f.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),f.each(["radio","checkbox"],function(){f.valHooks[this]=f.extend(f.valHooks[this],{set:function(a,b){if(f.isArray(b))return a.checked=f.inArray(f(a).val(),b)>=0}})});var x=/\.(.*)$/,y=/^(?:textarea|input|select)$/i,z=/\./g,A=/ /g,B=/[^\w\s.|`]/g,C=function(a){return a.replace(B,"\\$&")};f.event={add:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){if(d===!1)d=D;else if(!d)return;var g,h;d.handler&&(g=d,d=g.handler),d.guid||(d.guid=f.guid++);var i=f._data(a);if(!i)return;var j=i.events,k=i.handle;j||(i.events=j={}),k||(i.handle=k=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.handle.apply(k.elem,arguments):b}),k.elem=a,c=c.split(" ");var l,m=0,n;while(l=c[m++]){h=g?f.extend({},g):{handler:d,data:e},l.indexOf(".")>-1?(n=l.split("."),l=n.shift(),h.namespace=n.slice(0).sort().join(".")):(n=[],h.namespace=""),h.type=l,h.guid||(h.guid=d.guid);var o=j[l],p=f.event.special[l]||{};if(!o){o=j[l]=[];if(!p.setup||p.setup.call(a,e,n,k)===!1)a.addEventListener?a.addEventListener(l,k,!1):a.attachEvent&&a.attachEvent("on"+l,k)}p.add&&(p.add.call(a,h),h.handler.guid||(h.handler.guid=d.guid)),o.push(h),f.event.global[l]=!0}a=null}},global:{},remove:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){d===!1&&(d=D);var g,h,i,j,k=0,l,m,n,o,p,q,r,s=f.hasData(a)&&f._data(a),t=s&&s.events;if(!s||!t)return;c&&c.type&&(d=c.handler,c=c.type);if(!c||typeof c=="string"&&c.charAt(0)==="."){c=c||"";for(h in t)f.event.remove(a,h+c);return}c=c.split(" ");while(h=c[k++]){r=h,q=null,l=h.indexOf(".")<0,m=[],l||(m=h.split("."),h=m.shift(),n=new RegExp("(^|\\.)"+f.map(m.slice(0).sort(),C).join("\\.(?:.*\\.)?")+"(\\.|$)")),p=t[h];if(!p)continue;if(!d){for(j=0;j<p.length;j++){q=p[j];if(l||n.test(q.namespace))f.event.remove(a,r,q.handler,j),p.splice(j--,1)}continue}o=f.event.special[h]||{};for(j=e||0;j<p.length;j++){q=p[j];if(d.guid===q.guid){if(l||n.test(q.namespace))e==null&&p.splice(j--,1),o.remove&&o.remove.call(a,q);if(e!=null)break}}if(p.length===0||e!=null&&p.length===1)(!o.teardown||o.teardown.call(a,m)===!1)&&f.removeEvent(a,h,s.handle),g=null,delete t[h]}if(f.isEmptyObject(t)){var u=s.handle;u&&(u.elem=null),delete s.events,delete s.handle,f.isEmptyObject(s)&&f.removeData(a,b,!0)}}},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(c,d,e,g){var h=c.type||c,i=[],j;h.indexOf("!")>=0&&(h=h.slice(0,-1),j=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.
shift(),i.sort());if(!!e&&!f.event.customEvent[h]||!!f.event.global[h]){c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.exclusive=j,c.namespace=i.join("."),c.namespace_re=new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)");if(g||!e)c.preventDefault(),c.stopPropagation();if(!e){f.each(f.cache,function(){var a=f.expando,b=this[a];b&&b.events&&b.events[h]&&f.event.trigger(c,d,b.handle.elem)});return}if(e.nodeType===3||e.nodeType===8)return;c.result=b,c.target=e,d=d!=null?f.makeArray(d):[],d.unshift(c);var k=e,l=h.indexOf(":")<0?"on"+h:"";do{var m=f._data(k,"handle");c.currentTarget=k,m&&m.apply(k,d),l&&f.acceptData(k)&&k[l]&&k[l].apply(k,d)===!1&&(c.result=!1,c.preventDefault()),k=k.parentNode||k.ownerDocument||k===c.target.ownerDocument&&a}while(k&&!c.isPropagationStopped());if(!c.isDefaultPrevented()){var n,o=f.event.special[h]||{};if((!o._default||o._default.call(e.ownerDocument,c)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)){try{l&&e[h]&&(n=e[l],n&&(e[l]=null),f.event.triggered=h,e[h]())}catch(p){}n&&(e[l]=n),f.event.triggered=b}}return c.result}},handle:function(c){c=f.event.fix(c||a.event);var d=((f._data(this,"events")||{})[c.type]||[]).slice(0),e=!c.exclusive&&!c.namespace,g=Array.prototype.slice.call(arguments,0);g[0]=c,c.currentTarget=this;for(var h=0,i=d.length;h<i;h++){var j=d[h];if(e||c.namespace_re.test(j.namespace)){c.handler=j.handler,c.data=j.data,c.handleObj=j;var k=j.handler.apply(this,g);k!==b&&(c.result=k,k===!1&&(c.preventDefault(),c.stopPropagation()));if(c.isImmediatePropagationStopped())break}}return c.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(a){if(a[f.expando])return a;var d=a;a=f.Event(d);for(var e=this.props.length,g;e;)g=this.props[--e],a[g]=d[g];a.target||(a.target=a.srcElement||c),a.target.nodeType===3&&(a.target=a.target.parentNode),!a.relatedTarget&&a.fromElement&&(a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement);if(a.pageX==null&&a.clientX!=null){var h=a.target.ownerDocument||c,i=h.documentElement,j=h.body;a.pageX=a.clientX+(i&&i.scrollLeft||j&&j.scrollLeft||0)-(i&&i.clientLeft||j&&j.clientLeft||0),a.pageY=a.clientY+(i&&i.scrollTop||j&&j.scrollTop||0)-(i&&i.clientTop||j&&j.clientTop||0)}a.which==null&&(a.charCode!=null||a.keyCode!=null)&&(a.which=a.charCode!=null?a.charCode:a.keyCode),!a.metaKey&&a.ctrlKey&&(a.metaKey=a.ctrlKey),!a.which&&a.button!==b&&(a.which=a.button&1?1:a.button&2?3:a.button&4?2:0);return a},guid:1e8,proxy:f.proxy,special:{ready:{setup:f.bindReady,teardown:f.noop},live:{add:function(a){f.event.add(this,N(a.origType,a.selector),f.extend({},a,{handler:M,guid:a.handler.guid}))},remove:function(a){f.event.remove(this,N(a.origType,a.selector),a)}},beforeunload:{setup:function(a,b,c){f.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}}},f.removeEvent=c.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){a.detachEvent&&a.detachEvent("on"+b,c)},f.Event=function(a,b){if(!this.preventDefault)return new f.Event(a,b);a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?E:D):this.type=a,b&&f.extend(this,b),this.timeStamp=f.now(),this[f.expando]=!0},f.Event.prototype={preventDefault:function(){this.isDefaultPrevented=E;var a=this.originalEvent;!a||(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=E;var a=this.originalEvent;!a||(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=E,this.stopPropagation()},isDefaultPrevented:D,isPropagationStopped:D,isImmediatePropagationStopped:D};var F=function(a){var b=a.relatedTarget,c=!1,d=a.type;a.type=a.data,b!==this&&(b&&(c=f.contains(this,b)),c||(f.event.handle.apply(this,arguments),a.type=d))},G=function(a){a.type=a.data,f.event.handle.apply(this,arguments)};f.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){f.event.special[a]={setup:function(c){f.event.add(this,b,c&&c.selector?G:F,a)},teardown:function(a){f.event.remove(this,b,a&&a.selector?G:F)}}}),f.support.submitBubbles||(f.event.special.submit={setup:function(a,b){if(!f.nodeName(this,"form"))f.event.add(this,"click.specialSubmit",function(a){var b=a.target,c=b.type;(c==="submit"||c==="image")&&f(b).closest("form").length&&K("submit",this,arguments)}),f.event.add(this,"keypress.specialSubmit",function(a){var b=a.target,c=b.type;(c==="text"||c==="password")&&f(b).closest("form").length&&a.keyCode===13&&K("submit",this,arguments)});else return!1},teardown:function(a){f.event.remove(this,".specialSubmit")}});if(!f.support.changeBubbles){var H,I=function(a){var b=a.type,c=a.value;b==="radio"||b==="checkbox"?c=a.checked:b==="select-multiple"?c=a.selectedIndex>-1?f.map(a.options,function(a){return a.selected}).join("-"):"":f.nodeName(a,"select")&&(c=a.selectedIndex);return c},J=function(c){var d=c.target,e,g;if(!!y.test(d.nodeName)&&!d.readOnly){e=f._data(d,"_change_data"),g=I(d),(c.type!=="focusout"||d.type!=="radio")&&f._data(d,"_change_data",g);if(e===b||g===e)return;if(e!=null||g)c.type="change",c.liveFired=b,f.event.trigger(c,arguments[1],d)}};f.event.special.change={filters:{focusout:J,beforedeactivate:J,click:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(c==="radio"||c==="checkbox"||f.nodeName(b,"select"))&&J.call(this,a)},keydown:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(a.keyCode===13&&!f.nodeName(b,"textarea")||a.keyCode===32&&(c==="checkbox"||c==="radio")||c==="select-multiple")&&J.call(this,a)},beforeactivate:function(a){var b=a.target;f._data(b,"_change_data",I(b))}},setup:function(a,b){if(this.type==="file")return!1;for(var c in H)f.event.add(this,c+".specialChange",H[c]);return y.test(this.nodeName)},teardown:function(a){f.event.remove(this,".specialChange");return y.test(this.nodeName)}},H=f.event.special.change.filters,H.focus=H.beforeactivate}f.support.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(a,b){function e(a){var c=f.event.fix(a);c.type=b,c.originalEvent={},f.event.trigger(c,null,c.target),c.isDefaultPrevented()&&a.preventDefault()}var d=0;f.event.special[b]={setup:function(){d++===0&&c.addEventListener(a,e,!0)},teardown:function(){--d===0&&c.removeEventListener(a,e,!0)}}}),f.each(["bind","one"],function(a,c){f.fn[c]=function(a,d,e){var g;if(typeof a=="object"){for(var h in a)this[c](h,d,a[h],e);return this}if(arguments.length===2||d===!1)e=d,d=b;c==="one"?(g=function(a){f(this).unbind(a,g);return e.apply(this,arguments)},g.guid=e.guid||f.guid++):g=e;if(a==="unload"&&c!=="one")this.one(a,d,e);else for(var i=0,j=this.length;i<j;i++)f.event.add(this[i],a,g,d);return this}}),f.fn.extend({unbind:function(a,b){if(typeof a=="object"&&!a.preventDefault)for(var c in a)this.unbind(c,a[c]);else for(var d=0,e=this.length;d<e;d++)f.event.remove(this[d],a,b);return this},delegate:function(a,b,c,d){return this.live(b,c,d,a)},undelegate:function(a,b,c){return arguments.length===0?this.unbind("live"):this.die(b,null,c,a)},trigger:function(a,b){return this.each(function(){f.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0])return f.event.trigger(a,b,this[0],!0)},toggle:function(a){var b=arguments,c=a.guid||f.guid++,d=0,e=function(c){var e=(f.data(this,"lastToggle"+a.guid)||0)%d;f.data(this,"lastToggle"+a.guid,e+1),c.preventDefault();return b[e].apply(this,arguments)||!1};e.guid=c;while(d<b.length)b[d++].guid=c;return this.click(e)},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var L={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};f.each(["live","die"],function(a,c){f.fn[c]=function(a,d,e,g){var h,i=0,j,k,l,m=g||this.selector,n=g?this:f(this.context);if(typeof a=="object"&&!a.preventDefault){for(var o in a)n[c](o,d,a[o],m);return this}if(c==="die"&&!a&&g&&g.charAt(0)==="."){n.unbind(g);return this}if(d===!1||f.isFunction(d))e=d||D,d=b;a=(a||"").split(" ");while((h=a[i++])!=null){j=x.exec(h),k="",j&&(k=j[0],h=h.replace(x,""));if(h==="hover"){a.push("mouseenter"+k,"mouseleave"+k);continue}l=h,L[h]?(a.push(L[h]+k),h=h+k):h=(L[h]||h)+k;if(c==="live")for(var p=0,q=n.length;p<q;p++)f.event.add(n[p],"live."+N(h,m),{data:d,selector:m,handler:e,origType:h,origHandler:e,preType:l});else n.unbind("live."+N(h,m),e)}return this}}),f.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "),function(a,b){f.fn[b]=function(a,c){c==null&&(c=a,a=null);return arguments.length>0?this.bind(b,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0)}),function(){function u(a,b,c,d,e,f){for(var g=0,h=d.length;g<h;g++){var i=d[g];if(i){var j=!1;i=i[a];while(i){if(i.sizcache===c){j=d[i.sizset];break}if(i.nodeType===1){f||(i.sizcache=c,i.sizset=g);if(typeof b!="string"){if(i===b){j=!0;break}}else if(k.filter(b,[i]).length>0){j=i;break}}i=i[a]}d[g]=j}}}function t(a,b,c,d,e,f){for(var g=0,h=d.length;g<h;g++){var i=d[g];if(i){var j=!1;i=i[a];while(i){if(i.sizcache===c){j=d[i.sizset];break}i.nodeType===1&&!f&&(i.sizcache=c,i.sizset=g);if(i.nodeName.toLowerCase()===b){j=i;break}i=i[a]}d[g]=j}}}var a=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d=0,e=Object.prototype.toString,g=!1,h=!0,i=/\\/g,j=/\W/;[0,0].sort(function(){h=!1;return 0});var k=function(b,d,f,g){f=f||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return f;var i,j,n,o,q,r,s,t,u=!0,w=k.isXML(d),x=[],y=b;do{a.exec(""),i=a.exec(y);if(i){y=i[3],x.push(i[1]);if(i[2]){o=i[3];break}}}while(i);if(x.length>1&&m.exec(b))if(x.length===2&&l.relative[x[0]])j=v(x[0]+x[1],d);else{j=l.relative[x[0]]?[d]:k(x.shift(),d);while(x.length)b=x.shift(),l.relative[b]&&(b+=x.shift()),j=v(b,j)}else{!g&&x.length>1&&d.nodeType===9&&!w&&l.match.ID.test(x[0])&&!l.match.ID.test(x[x.length-1])&&(q=k.find(x.shift(),d,w),d=q.expr?k.filter(q.expr,q.set)[0]:q.set[0]);if(d){q=g?{expr:x.pop(),set:p(g)}:k.find(x.pop(),x.length===1&&(x[0]==="~"||x[0]==="+")&&d.parentNode?d.parentNode:d,w),j=q.expr?k.filter(q.expr,q.set):q.set,x.length>0?n=p(j):u=!1;while(x.length)r=x.pop(),s=r,l.relative[r]?s=x.pop():r="",s==null&&(s=d),l.relative[r](n,s,w)}else n=x=[]}n||(n=j),n||k.error(r||b);if(e.call(n)==="[object Array]")if(!u)f.push.apply(f,n);else if(d&&d.nodeType===1)for(t=0;n[t]!=null;t++)n[t]&&(n[t]===!0||n[t].nodeType===1&&k.contains(d,n[t]))&&f.push(j[t]);else for(t=0;n[t]!=null;t++)n[t]&&n[t].nodeType===1&&f.push(j[t]);else p(n,f);o&&(k(o,h,f,g),k.uniqueSort(f));return f};k.uniqueSort=function(a){if(r){g=h,a.sort(r);if(g)for(var b=1;b<a.length;b++)a[b]===a[b-1]&&a.splice(b--,1)}return a},k.matches=function(a,b){return k(a,null,null,b)},k.matchesSelector=function(a,b){return k(b,null,null,[a]).length>0},k.find=function(a,b,c){var d;if(!a)return[];for(var e=0,f=l.order.length;e<f;e++){var g,h=l.order[e];if(g=l.leftMatch[h].exec(a)){var j=g[1];g.splice(1,1);if(j.substr(j.length-1)!=="\\"){g[1]=(g[1]||"").replace(i,""),d=l.find[h](g,b,c);if(d!=null){a=a.replace(l.match[h],"");break}}}}d||(d=typeof b.getElementsByTagName!="undefined"?b.getElementsByTagName("*"):[]);return{set:d,expr:a}},k.filter=function(a,c,d,e){var f,g,h=a,i=[],j=c,m=c&&c[0]&&k.isXML(c[0]);while(a&&c.length){for(var n in l.filter)if((f=l.leftMatch[n].exec(a))!=null&&f[2]){var o,p,q=l.filter[n],r=f[1];g=!1,f.splice(1,1);if(r.substr(r.length-1)==="\\")continue;j===i&&(i=[]);if(l.preFilter[n]){f=l.preFilter[n](f,j,d,i,e,m);if(!f)g=o=!0;else if(f===!0)continue}if(f)for(var s=0;(p=j[s])!=null;s++)if(p){o=q(p,f,s,j);var t=e^!!o;d&&o!=null?t?g=!0:j[s]=!1:t&&(i.push(p),g=!0)}if(o!==b){d||(j=i),a=a.replace(l.match[n],"");if(!g)return[];break}}if(a===h)if(g==null)k.error(a);else break;h=a}return j},k.error=function(a){throw"Syntax error, unrecognized expression: "+a};var l=k.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(a){return a.getAttribute("href")},type:function(a){return a.getAttribute("type")}},relative:{"+":function(a,b){var c=typeof b=="string",d=c&&!j.test(b),e=c&&!d;d&&(b=b.toLowerCase());for(var f=0,g=a.length,h;f<g;f++)if(h=a[f]){while((h=h.previousSibling)&&h.nodeType!==1);a[f]=e||h&&h.nodeName.toLowerCase()===b?h||!1:h===b}e&&k.filter(b,a,!0)},">":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!j.test(b)){b=b.toLowerCase();for(;e<f;e++){c=a[e];if(c){var g=c.parentNode;a[e]=g.nodeName.toLowerCase()===b?g:!1}}}else{for(;e<f;e++)c=a[e],c&&(a[e]=d?c.parentNode:c.parentNode===b);d&&k.filter(b,a,!0)}},"":function(a,b,c){var e,f=d++,g=u;typeof b=="string"&&!j.test(b)&&(b=b.toLowerCase(),e=b,g=t),g("parentNode",b,f,a,e,c)},"~":function(a,b,c){var e,f=d++,g=u;typeof b=="string"&&!j.test(b)&&(b=b.toLowerCase(),e=b,g=t),g("previousSibling",b,f,a,e,c)}},find:{ID:function(a,b,c){if(typeof b.getElementById!="undefined"&&!c){var d=b.getElementById(a[1]);return d&&d.parentNode?[d]:[]}},NAME:function(a,b){if(typeof b.getElementsByName!="undefined"){var c=[],d=b.getElementsByName(a[1]);for(var e=0,f=d.length;e<f;e++)d[e].getAttribute("name")===a[1]&&c.push(d[e]);return c.length===0?null:c}},TAG:function(a,b){if(typeof b.getElementsByTagName!="undefined")return b.getElementsByTagName(a[1])}},preFilter:{CLASS:function(a,b,c,d,e,f){a=" "+a[1].replace(i,"")+" ";if(f)return a;for(var g=0,h;(h=b[g])!=null;g++)h&&(e^(h.className&&(" "+h.className+" ").replace(/[\t\n\r]/g," ").indexOf(a)>=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(i,"")},TAG:function(a,b){return a[1].replace(i,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||k.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&k.error(a[0]);a[0]=d++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(i,"");!f&&l.attrMap[g]&&(a[1]=l.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(i,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=k(b[3],null,null,c);else{var g=k.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(l.match.POS.test(b[0])||l.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!k(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return b<c[3]-0},gt:function(a,b,c){return b>c[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=l.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||k.getText([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h<i;h++)if(g[h]===a)return!1;return!0}k.error(e)},CHILD:function(a,b){var c=b[1],d=a;switch(c){case"only":case"first":while(d=d.previousSibling)if(d.nodeType===1)return!1;if(c==="first")return!0;d=a;case"last":while(d=d.nextSibling)if(d.nodeType===1)return!1;return!0;case"nth":var e=b[2],f=b[3];if(e===1&&f===0)return!0;var g=b[0],h=a.parentNode;if(h&&(h.sizcache!==g||!a.nodeIndex)){var i=0;for(d=h.firstChild;d;d=d.nextSibling)d.nodeType===1&&(d.nodeIndex=++i);h.sizcache=g}var j=a.nodeIndex-f;return e===0?j===0:j%e===0&&j/e>=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=l.attrHandle[c]?l.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=l.setFilters[e];if(f)return f(a,c,b,d)}}},m=l.match.POS,n=function(a,b){return"\\"+(b-0+1)};for(var o in l.match)l.match[o]=new RegExp(l.match[o].source+/(?![^\[]*\])(?![^\(]*\))/.source),l.leftMatch[o]=new RegExp(/(^(?:.|\r|\n)*?)/.source+l.match[o].source.replace(/\\(\d+)/g,n));var p=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(q){p=function(a,b){var c=0,d=b||[];if(e.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var f=a.length;c<f;c++)d.push(a[c]);else for(;a[c];c++)d.push(a[c]);return d}}var r,s;c.documentElement.compareDocumentPosition?r=function(a,b){if(a===b){g=!0;return 0}if(!a.compareDocumentPosition||!b.compareDocumentPosition)return a.compareDocumentPosition?-1:1;return a.compareDocumentPosition(b)&4?-1:1}:(r=function(a,b){if(a===b){g=!0;return 0}if(a.sourceIndex&&b.sourceIndex)return a.sourceIndex-b.sourceIndex;var c,d,e=[],f=[],h=a.parentNode,i=b.parentNode,j=h;if(h===i)return s(a,b);if(!h)return-1;if(!i)return 1;while(j)e.unshift(j),j=j.parentNode;j=i;while(j)f.unshift(j),j=j.parentNode;c=e.length,d=f.length;for(var k=0;k<c&&k<d;k++)if(e[k]!==f[k])return s(e[k],f[k]);return k===c?s(a,f[k],-1):s(e[k],b,1)},s=function(a,b,c){if(a===b)return c;var d=a.nextSibling;while(d){if(d===b)return-1;d=d.nextSibling}return 1}),k.getText=function(a){var b="",c;for(var d=0;a[d];d++)c=a[d],c.nodeType===3||c.nodeType===4?b+=c.nodeValue:c.nodeType!==8&&(b+=k.getText(c.childNodes));return b},function(){var a=c.createElement("div"),d="script"+(new Date).getTime(),e=c.documentElement;a.innerHTML="<a name='"+d+"'/>",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(l.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},l.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(l.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="<a href='#'></a>",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(l.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=k,b=c.createElement("div"),d="__sizzle__";b.innerHTML="<p class='TEST'></p>";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){k=function(b,e,f,g){e=e||c;if(!g&&!k.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return p(e.getElementsByTagName(b),f);if(h[2]&&l.find.CLASS&&e.getElementsByClassName)return p(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return p([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return p([],f);if(i.id===h[3])return p([i],f)}try{return p(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var m=e,n=e.getAttribute("id"),o=n||d,q=e.parentNode,r=/^\s*[+~]/.test(b);n?o=o.replace(/'/g,"\\$&"):e.setAttribute("id",o),r&&q&&(e=e.parentNode);try{if(!r||q)return p(e.querySelectorAll("[id='"+o+"'] "+b),f)}catch(s){}finally{n||m.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)k[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}k.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(a))try{if(e||!l.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return k(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="<div class='test e'></div><div class='test'></div>";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;l.order.splice(1,0,"CLASS"),l.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?k.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?k.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:k.contains=function(){return!1},k.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var v=function(a,b){var c,d=[],e="",f=b.nodeType?[b]:b;while(c=l.match.PSEUDO.exec(a))e+=c[0],a=a.replace(l.match.PSEUDO,"");a=l.relative[a]?a+"*":a;for(var g=0,h=f.length;g<h;g++)k(a,f[g],d);return k.filter(e,d)};f.find=k,f.expr=k.selectors,f.expr[":"]=f.expr.filters,f.unique=k.uniqueSort,f.text=k.getText,f.isXMLDoc=k.isXML,f.contains=k.contains}();var O=/Until$/,P=/^(?:parents|prevUntil|prevAll)/,Q=/,/,R=/^.[^:#\[\.,]*$/,S=Array.prototype.slice,T=f.expr.match.POS,U={children:!0,contents:!0,next:!0,prev:!0};f.fn.extend({find:function(a){var b=this,c,d;if(typeof a!="string")return f(a).filter(function(){for(c=0,d=b.length;c<d;c++)if(f.contains(b[c],this))return!0});var e=this.pushStack("","find",a),g,h,i;for(c=0,d=this.length;c<d;c++){g=e.length,f.find(a,this[c],e);if(c>0)for(h=g;h<e.length;h++)for(i=0;i<g;i++)if(e[i]===e[h]){e.splice(h--,1);break}}return e},has:function(a){var b=f(a);return this.filter(function(){for(var a=0,c=b.length;a<c;a++)if(f.contains(this,b[a]))return!0})},not:function(a){return this.pushStack(W(this,a,!1),"not",a)},filter:function(a){return this.pushStack(W(this,a,!0),"filter",a)},is:function(a){return!!a&&(typeof a=="string"?f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h,i,j={},k=1;if(g&&a.length){for(d=0,e=a.length;d<e;d++)i=a[d],j[i]||(j[i]=T.test(i)?f(i,b||this.context):i);while(g&&g.ownerDocument&&g!==b){for(i in j)h=j[i],(h.jquery?h.index(g)>-1:f(g).is(h))&&c.push({selector:i,elem:g,level:k});g=g.parentNode,k++}}return c}var l=T.test(a)||typeof a!="string"?f(a,b||this.context):0;for(d=0,e=this.length;d<e;d++){g=this[d];while(g){if(l?l.index(g)>-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a||typeof a=="string")return f.inArray(this[0],a?f(a):this.parent().children());return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(V(c[0])||V(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c),g=S.call(arguments);O.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!U[a]?f.unique(e):e,(this.length>1||Q.test(d))&&P.test(a)&&(e=e.reverse());return this.pushStack(e,a,g.join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var X=/ jQuery\d+="(?:\d+|null)"/g,Y=/^\s+/,Z=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,$=/<([\w:]+)/,_=/<tbody/i,ba=/<|&#?\w+;/,bb=/<(?:script|object|embed|option|style)/i,bc=/checked\s*(?:[^=]|=\s*.checked.)/i,bd=/\/(java|ecma)script/i,be=/^\s*<!(?:\[CDATA\[|\-\-)/,bf={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};bf.optgroup=bf.option,bf.tbody=bf.tfoot=bf.colgroup=bf.caption=bf.thead,bf.th=bf.td,f.support.htmlSerialize||(bf._default=[1,"div<div>","</div>"]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){f(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f(arguments[0]).toArray());return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(X,""):null;if(typeof a=="string"&&!bb.test(a)&&(f.support.leadingWhitespace||!Y.test(a))&&!bf[($.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Z,"<$1></$2>");try{for(var c=0,d=this.length;c<d;c++)this[c].nodeType===1&&(f.cleanData(this[c].getElementsByTagName("*")),this[c].innerHTML=a)}catch(e){this.empty().append(a)}}else f.isFunction(a)?this.each(function(b){var c=f(this);c.html(a.call(this,b,c.html()))}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(f.isFunction(a))return this.each(function(b){var c=f(this),d=c.html();c.replaceWith(a.call(this,b,d))});typeof a!="string"&&(a=f(a).detach());return this.each(function(){var b=this.nextSibling,c=this.parentNode;f(this).remove(),b?f(b).before(a):f(c).append(a)})}return this.length?this.pushStack(f(f.isFunction(a)?a():a),"replaceWith",a):this},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,d){var e,g,h,i,j=a[0],k=[];if(!f.support.checkClone&&arguments.length===3&&typeof j=="string"&&bc.test(j))return this.each(function(){f(this).domManip(a,c,d,!0)});if(f.isFunction(j))return this.each(function(e){var g=f(this);a[0]=j.call(this,e,c?g.html():b),g.domManip(a,c,d)});if(this[0]){i=j&&j.parentNode,f.support.parentNode&&i&&i.nodeType===11&&i.childNodes.length===this.length?e={fragment:i}:e=f.buildFragment(a,this,k),h=e.fragment,h.childNodes.length===1?g=h=h.firstChild:g=h.firstChild;if(g){c=c&&f.nodeName(g,"tr");for(var l=0,m=this.length,n=m-1;l<m;l++)d.call(c?bg(this[l],g):this[l],e.cacheable||m>1&&l<n?f.clone(h,!0,!0):h)}k.length&&f.each(k,bm)}return this}}),f.buildFragment=function(a,b,d){var e,g,h,i;b&&b[0]&&(i=b[0].ownerDocument||b[0]),i.createDocumentFragment||(i=c),a.length===1&&typeof a[0]=="string"&&a[0].length<512&&i===c&&a[0].charAt(0)==="<"&&!bb.test(a[0])&&(f.support.checkClone||!bc.test(a[0]))&&(g=!0,h=f.fragments[a[0]],h&&h!==1&&(e=h)),e||(e=i.createDocumentFragment(),f.clean(a,i,e,d)),g&&(f.fragments[a[0]]=h?e:1);return{fragment:e,cacheable:g}},f.fragments={},f.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){f.fn[a]=function(c){var d=[],e=f(c),g=this.length===1&&this[0].parentNode;if(g&&g.nodeType===11&&g.childNodes.length===1&&e.length===1){e[b](this[0]);return this}for(var h=0,i=e.length;h<i;h++){var j=(h>0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j
)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d=a.cloneNode(!0),e,g,h;if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bi(a,d),e=bj(a),g=bj(d);for(h=0;e[h];++h)bi(e[h],g[h])}if(b){bh(a,d);if(c){e=bj(a),g=bj(d);for(h=0;e[h];++h)bh(e[h],g[h])}}e=g=null;return d},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!ba.test(k))k=b.createTextNode(k);else{k=k.replace(Z,"<$1></$2>");var l=($.exec(k)||["",""])[1].toLowerCase(),m=bf[l]||bf._default,n=m[0],o=b.createElement("div");o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=_.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]==="<table>"&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&Y.test(k)&&o.insertBefore(b.createTextNode(Y.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i<r;i++)bl(k[i]);else bl(k);k.nodeType?h.push(k):h=f.merge(h,k)}if(d){g=function(a){return!a.type||bd.test(a.type)};for(j=0;h[j];j++)if(e&&f.nodeName(h[j],"script")&&(!h[j].type||h[j].type.toLowerCase()==="text/javascript"))e.push(h[j].parentNode?h[j].parentNode.removeChild(h[j]):h[j]);else{if(h[j].nodeType===1){var s=f.grep(h[j].getElementsByTagName("script"),g);h.splice.apply(h,[j+1,0].concat(s))}d.appendChild(h[j])}}return h},cleanData:function(a){var b,c,d=f.cache,e=f.expando,g=f.event.special,h=f.support.deleteExpando;for(var i=0,j;(j=a[i])!=null;i++){if(j.nodeName&&f.noData[j.nodeName.toLowerCase()])continue;c=j[f.expando];if(c){b=d[c]&&d[c][e];if(b&&b.events){for(var k in b.events)g[k]?f.event.remove(j,k):f.removeEvent(j,k,b.handle);b.handle&&(b.handle.elem=null)}h?delete j[f.expando]:j.removeAttribute&&j.removeAttribute(f.expando),delete d[c]}}}});var bn=/alpha\([^)]*\)/i,bo=/opacity=([^)]*)/,bp=/([A-Z]|^ms)/g,bq=/^-?\d+(?:px)?$/i,br=/^-?\d/,bs=/^[+\-]=/,bt=/[^+\-\.\de]+/g,bu={position:"absolute",visibility:"hidden",display:"block"},bv=["Left","Right"],bw=["Top","Bottom"],bx,by,bz;f.fn.css=function(a,c){if(arguments.length===2&&c===b)return this;return f.access(this,a,c,!0,function(a,c,d){return d!==b?f.style(a,c,d):f.css(a,c)})},f.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=bx(a,"opacity","opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":f.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!!a&&a.nodeType!==3&&a.nodeType!==8&&!!a.style){var g,h,i=f.camelCase(c),j=a.style,k=f.cssHooks[i];c=f.cssProps[i]||i;if(d===b){if(k&&"get"in k&&(g=k.get(a,!1,e))!==b)return g;return j[c]}h=typeof d;if(h==="number"&&isNaN(d)||d==null)return;h==="string"&&bs.test(d)&&(d=+d.replace(bt,"")+parseFloat(f.css(a,c)),h="number"),h==="number"&&!f.cssNumber[i]&&(d+="px");if(!k||!("set"in k)||(d=k.set(a,d))!==b)try{j[c]=d}catch(l){}}},css:function(a,c,d){var e,g;c=f.camelCase(c),g=f.cssHooks[c],c=f.cssProps[c]||c,c==="cssFloat"&&(c="float");if(g&&"get"in g&&(e=g.get(a,!0,d))!==b)return e;if(bx)return bx(a,c)},swap:function(a,b,c){var d={};for(var e in b)d[e]=a.style[e],a.style[e]=b[e];c.call(a);for(e in b)a.style[e]=d[e]}}),f.curCSS=f.css,f.each(["height","width"],function(a,b){f.cssHooks[b]={get:function(a,c,d){var e;if(c){if(a.offsetWidth!==0)return bA(a,b,d);f.swap(a,bu,function(){e=bA(a,b,d)});return e}},set:function(a,b){if(!bq.test(b))return b;b=parseFloat(b);if(b>=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bo.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle;c.zoom=1;var e=f.isNaN(b)?"":"alpha(opacity="+b*100+")",g=d&&d.filter||c.filter||"";c.filter=bn.test(g)?g.replace(bn,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bx(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(by=function(a,c){var d,e,g;c=c.replace(bp,"-$1").toLowerCase();if(!(e=a.ownerDocument.defaultView))return b;if(g=e.getComputedStyle(a,null))d=g.getPropertyValue(c),d===""&&!f.contains(a.ownerDocument.documentElement,a)&&(d=f.style(a,c));return d}),c.documentElement.currentStyle&&(bz=function(a,b){var c,d=a.currentStyle&&a.currentStyle[b],e=a.runtimeStyle&&a.runtimeStyle[b],f=a.style;!bq.test(d)&&br.test(d)&&(c=f.left,e&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":d||0,d=f.pixelLeft+"px",f.left=c,e&&(a.runtimeStyle.left=e));return d===""?"auto":d}),bx=by||bz,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bB=/%20/g,bC=/\[\]$/,bD=/\r?\n/g,bE=/#.*$/,bF=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bG=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bH=/^(?:about|app|app\-storage|.+\-extension|file|widget):$/,bI=/^(?:GET|HEAD)$/,bJ=/^\/\//,bK=/\?/,bL=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,bM=/^(?:select|textarea)/i,bN=/\s+/,bO=/([?&])_=[^&]*/,bP=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bQ=f.fn.load,bR={},bS={},bT,bU;try{bT=e.href}catch(bV){bT=c.createElement("a"),bT.href="",bT=bT.href}bU=bP.exec(bT.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bQ)return bQ.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("<div>").append(c.replace(bL,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bM.test(this.nodeName)||bG.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bD,"\r\n")}}):{name:b.name,value:c.replace(bD,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.bind(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?f.extend(!0,a,f.ajaxSettings,b):(b=a,a=f.extend(!0,f.ajaxSettings,b));for(var c in{context:1,url:1})c in b?a[c]=b[c]:c in f.ajaxSettings&&(a[c]=f.ajaxSettings[c]);return a},ajaxSettings:{url:bT,isLocal:bH.test(bU[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":"*/*"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML}},ajaxPrefilter:bW(bR),ajaxTransport:bW(bS),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a?4:0;var o,r,u,w=l?bZ(d,v,l):b,x,y;if(a>=200&&a<300||a===304){if(d.ifModified){if(x=v.getResponseHeader("Last-Modified"))f.lastModified[k]=x;if(y=v.getResponseHeader("Etag"))f.etag[k]=y}if(a===304)c="notmodified",o=!0;else try{r=b$(d,w),c="success",o=!0}catch(z){c="parsererror",u=z}}else{u=c;if(!c||a)c="error",a<0&&(a=0)}v.status=a,v.statusText=c,o?h.resolveWith(e,[r,c,v]):h.rejectWith(e,[v,c,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.resolveWith(e,[v,c]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f._Deferred(),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bF.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.done,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bE,"").replace(bJ,bU[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bN),d.crossDomain==null&&(r=bP.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bU[1]&&r[2]==bU[2]&&(r[3]||(r[1]==="http:"?80:443))==(bU[3]||(bU[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),bX(bR,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bI.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bK.test(d.url)?"&":"?")+d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bO,"$1_="+x);d.url=y+(y===d.url?(bK.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", */*; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=bX(bS,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){status<2?w(-1,z):f.error(z)}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)bY(g,a[g],c,e);return d.join("&").replace(bB,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var b_=f.now(),ca=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+b_++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(ca.test(b.url)||e&&ca.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(ca,l),b.url===j&&(e&&(k=k.replace(ca,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var cb=a.ActiveXObject?function(){for(var a in cd)cd[a](0,1)}:!1,cc=0,cd;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ce()||cf()}:ce,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,cb&&delete cd[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cc,cb&&(cd||(cd={},f(a).unload(cb)),cd[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var cg={},ch,ci,cj=/^(?:toggle|show|hide)$/,ck=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cl,cm=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cn,co=a.webkitRequestAnimationFrame||a.mozRequestAnimationFrame||a.oRequestAnimationFrame;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cr("show",3),a,b,c);for(var g=0,h=this.length;g<h;g++)d=this[g],d.style&&(e=d.style.display,!f._data(d,"olddisplay")&&e==="none"&&(e=d.style.display=""),e===""&&f.css(d,"display")==="none"&&f._data(d,"olddisplay",cs(d.nodeName)));for(g=0;g<h;g++){d=this[g];if(d.style){e=d.style.display;if(e===""||e==="none")d.style.display=f._data(d,"olddisplay")||""}}return this},hide:function(a,b,c){if(a||a===0)return this.animate(cr("hide",3),a,b,c);for(var d=0,e=this.length;d<e;d++)if(this[d].style){var g=f.css(this[d],"display");g!=="none"&&!f._data(this[d],"olddisplay")&&f._data(this[d],"olddisplay",g)}for(d=0;d<e;d++)this[d].style&&(this[d].style.display="none");return this},_toggle:f.fn.toggle,toggle:function(a,b,c){var d=typeof a=="boolean";f.isFunction(a)&&f.isFunction(b)?this._toggle.apply(this,arguments):a==null||d?this.each(function(){var b=d?a:f(this).is(":hidden");f(this)[b?"show":"hide"]()}):this.animate(cr("toggle",3),a,b,c);return this},fadeTo:function(a,b,c,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=f.speed(b,c,d);if(f.isEmptyObject(a))return this.each(e.complete,[!1]);a=f.extend({},a);return this[e.queue===!1?"each":"queue"](function(){e.queue===!1&&f._mark(this);var b=f.extend({},e),c=this.nodeType===1,d=c&&f(this).is(":hidden"),g,h,i,j,k,l,m,n,o;b.animatedProperties={};for(i in a){g=f.camelCase(i),i!==g&&(a[g]=a[i],delete a[i]),h=a[g],f.isArray(h)?(b.animatedProperties[g]=h[1],h=a[g]=h[0]):b.animatedProperties[g]=b.specialEasing&&b.specialEasing[g]||b.easing||"swing";if(h==="hide"&&d||h==="show"&&!d)return b.complete.call(this);c&&(g==="height"||g==="width")&&(b.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY],f.css(this,"display")==="inline"&&f.css(this,"float")==="none"&&(f.support.inlineBlockNeedsLayout?(j=cs(this.nodeName),j==="inline"?this.style.display="inline-block":(this.style.display="inline",this.style.zoom=1)):this.style.display="inline-block"))}b.overflow!=null&&(this.style.overflow="hidden");for(i in a)k=new f.fx(this,b,i),h=a[i],cj.test(h)?k[h==="toggle"?d?"show":"hide":h]():(l=ck.exec(h),m=k.cur(),l?(n=parseFloat(l[2]),o=l[3]||(f.cssNumber[i]?"":"px"),o!=="px"&&(f.style(this,i,(n||1)+o),m=(n||1)/k.cur()*m,f.style(this,i,m+o)),l[1]&&(n=(l[1]==="-="?-1:1)*n+m),k.custom(m,n,o)):k.custom(m,h,""));return!0})},stop:function(a,b){a&&this.queue([]),this.each(function(){var a=f.timers,c=a.length;b||f._unmark(!0,this);while(c--)a[c].elem===this&&(b&&a[c](!0),a.splice(c,1))}),b||this.dequeue();return this}}),f.each({slideDown:cr("show",1),slideUp:cr("hide",1),slideToggle:cr("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){f.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),f.extend({speed:function(a,b,c){var d=a&&typeof a=="object"?f.extend({},a):{complete:c||!c&&b||f.isFunction(a)&&a,duration:a,easing:c&&b||b&&!f.isFunction(b)&&b};d.duration=f.fx.off?0:typeof d.duration=="number"?d.duration:d.duration in f.fx.speeds?f.fx.speeds[d.duration]:f.fx.speeds._default,d.old=d.complete,d.complete=function(a){f.isFunction(d.old)&&d.old.call(this),d.queue!==!1?f.dequeue(this):a!==!1&&f._unmark(this)};return d},easing:{linear:function(a,b,c,d){return c+d*a},swing:function(a,b,c,d){return(-Math.cos(a*Math.PI)/2+.5)*d+c}},timers:[],fx:function(a,b,c){this.options=b,this.elem=a,this.prop=c,b.orig=b.orig||{}}}),f.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this),(f.fx.step[this.prop]||f.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a,b=f.css(this.elem,this.prop);return isNaN(a=parseFloat(b))?!b||b==="auto"?0:b:a},custom:function(a,b,c){function h(a){return d.step(a)}var d=this,e=f.fx,g;this.startTime=cn||cp(),this.start=a,this.end=b,this.unit=c||this.unit||(f.cssNumber[this.prop]?"":"px"),this.now=this.start,this.pos=this.state=0,h.elem=this.elem,h()&&f.timers.push(h)&&!cl&&(co?(cl=!0,g=function(){cl&&(co(g),e.tick())},co(g)):cl=setInterval(e.tick,e.interval))},show:function(){this.options.orig[this.prop]=f.style(this.elem,this.prop),this.options.show=!0,this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur()),f(this.elem).show()},hide:function(){this.options.orig[this.prop]=f.style(this.elem,this.prop),this.options.hide=!0,this.custom(this.cur(),0)},step:function(a){var b=cn||cp(),c=!0,d=this.elem,e=this.options,g,h;if(a||b>=e.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),e.animatedProperties[this.prop]=!0;for(g in e.animatedProperties)e.animatedProperties[g]!==!0&&(c=!1);if(c){e.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){d.style["overflow"+b]=e.overflow[a]}),e.hide&&f(d).hide();if(e.hide||e.show)for(var i in e.animatedProperties)f.style(d,i,e.orig[i]);e.complete.call(d)}return!1}e.duration==Infinity?this.now=b:(h=b-this.startTime,this.state=h/e.duration,this.pos=f.easing[e.animatedProperties[this.prop]](this.state,h,0,1,e.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){for(var a=f.timers,b=0;b<a.length;++b)a[b]()||a.splice(b--,1);a.length||f.fx.stop()},interval:13,stop:function(){clearInterval(cl),cl=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){f.style(a.elem,"opacity",a.now)},_default:function(a){a.elem.style&&a.elem.style[a.prop]!=null?a.elem.style[a.prop]=(a.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit:a.elem[a.prop]=a.now}}}),f.expr&&f.expr.filters&&(f.expr.filters.animated=function(a){return f.grep(f.timers,function(b){return a===b.elem}).length});var ct=/^t(?:able|d|h)$/i,cu=/^(?:body|html)$/i;"getBoundingClientRect"in c.documentElement?f.fn.offset=function(a){var b=this[0],c;if(a)return this.each(function(b){f.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return f.offset.bodyOffset(b);try{c=b.getBoundingClientRect()}catch(d){}var e=b.ownerDocument,g=e.documentElement;if(!c||!f.contains(g,b))return c?{top:c.top,left:c.left}:{top:0,left:0};var h=e.body,i=cv(e),j=g.clientTop||h.clientTop||0,k=g.clientLeft||h.clientLeft||0,l=i.pageYOffset||f.support.boxModel&&g.scrollTop||h.scrollTop,m=i.pageXOffset||f.support.boxModel&&g.scrollLeft||h.scrollLeft,n=c.top+l-j,o=c.left+m-k;return{top:n,left:o}}:f.fn.offset=function(a){var b=this[0];if(a)return this.each(function(b){f.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return f.offset.bodyOffset(b);f.offset.initialize();var c,d=b.offsetParent,e=b,g=b.ownerDocument,h=g.documentElement,i=g.body,j=g.defaultView,k=j?j.getComputedStyle(b,null):b.currentStyle,l=b.offsetTop,m=b.offsetLeft;while((b=b.parentNode)&&b!==i&&b!==h){if(f.offset.supportsFixedPosition&&k.position==="fixed")break;c=j?j.getComputedStyle(b,null):b.currentStyle,l-=b.scrollTop,m-=b.scrollLeft,b===d&&(l+=b.offsetTop,m+=b.offsetLeft,f.offset.doesNotAddBorder&&(!f.offset.doesAddBorderForTableAndCells||!ct.test(b.nodeName))&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),e=d,d=b.offsetParent),f.offset.subtractsBorderForOverflowNotVisible&&c.overflow!=="visible"&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),k=c}if(k.position==="relative"||k.position==="static")l+=i.offsetTop,m+=i.offsetLeft;f.offset.supportsFixedPosition&&k.position==="fixed"&&(l+=Math.max(h.scrollTop,i.scrollTop),m+=Math.max(h.scrollLeft,i.scrollLeft));return{top:l,left:m}},f.offset={initialize:function(){var a=c.body,b=c.createElement("div"),d,e,g,h,i=parseFloat(f.css(a,"marginTop"))||0,j="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";f.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"}),b.innerHTML=j,a.insertBefore(b,a.firstChild),d=b.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,this.doesNotAddBorder=e.offsetTop!==5,this.doesAddBorderForTableAndCells=h.offsetTop===5,e.style.position="fixed",e.style.top="20px",this.supportsFixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",this.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==i,a.removeChild(b),f.offset.initialize=f.noop},bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;f.offset.initialize(),f.offset.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(f.css(a,"marginTop"))||0,c+=parseFloat(f.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var d=f.css(a,"position");d==="static"&&(a.style.position="relative");var e=f(a),g=e.offset(),h=f.css(a,"top"),i=f.css(a,"left"),j=(d==="absolute"||d==="fixed")&&f.inArray("auto",[h,i])>-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cu.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cu.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cv(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cv(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a&&a.style?parseFloat(f.css(a,d,"padding")):null},f.fn["outer"+c]=function(a){var b=this[0];return b&&b.style?parseFloat(f.css(b,d,a?"margin":"border")):null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c];return e.document.compatMode==="CSS1Compat"&&g||e.document.body["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var h=f.css(e,d),i=parseFloat(h);return f.isNaN(i)?h:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f})(window);


//     Underscore.js 1.1.7
//     (c) 2011 Jeremy Ashkenas, DocumentCloud Inc.
//     Underscore is freely distributable under the MIT license.
//     Portions of Underscore are inspired or borrowed from Prototype,
//     Oliver Steele's Functional, and John Resig's Micro-Templating.
//     For all details and documentation:
//     http://documentcloud.github.com/underscore

(function() {

  // Baseline setup
  // --------------

  // Establish the root object, `window` in the browser, or `global` on the server.
  var root = this;

  // Save the previous value of the `_` variable.
  var previousUnderscore = root._;

  // Establish the object that gets returned to break out of a loop iteration.
  var breaker = {};

  // Save bytes in the minified (but not gzipped) version:
  var ArrayProto = Array.prototype, ObjProto = Object.prototype, FuncProto = Function.prototype;

  // Create quick reference variables for speed access to core prototypes.
  var slice            = ArrayProto.slice,
      unshift          = ArrayProto.unshift,
      toString         = ObjProto.toString,
      hasOwnProperty   = ObjProto.hasOwnProperty;

  // All **ECMAScript 5** native function implementations that we hope to use
  // are declared here.
  var
    nativeForEach      = ArrayProto.forEach,
    nativeMap          = ArrayProto.map,
    nativeReduce       = ArrayProto.reduce,
    nativeReduceRight  = ArrayProto.reduceRight,
    nativeFilter       = ArrayProto.filter,
    nativeEvery        = ArrayProto.every,
    nativeSome         = ArrayProto.some,
    nativeIndexOf      = ArrayProto.indexOf,
    nativeLastIndexOf  = ArrayProto.lastIndexOf,
    nativeIsArray      = Array.isArray,
    nativeKeys         = Object.keys,
    nativeBind         = FuncProto.bind;

  // Create a safe reference to the Underscore object for use below.
  var _ = function(obj) { return new wrapper(obj); };

  // Export the Underscore object for **CommonJS**, with backwards-compatibility
  // for the old `require()` API. If we're not in CommonJS, add `_` to the
  // global object.
  if (typeof module !== 'undefined' && module.exports) {
    module.exports = _;
    _._ = _;
  } else {
    // Exported as a string, for Closure Compiler "advanced" mode.
    root['_'] = _;
  }

  // Current version.
  _.VERSION = '1.1.7';

  // Collection Functions
  // --------------------

  // The cornerstone, an `each` implementation, aka `forEach`.
  // Handles objects with the built-in `forEach`, arrays, and raw objects.
  // Delegates to **ECMAScript 5**'s native `forEach` if available.
  var each = _.each = _.forEach = function(obj, iterator, context) {
    if (obj == null) return;
    if (nativeForEach && obj.forEach === nativeForEach) {
      obj.forEach(iterator, context);
    } else if (obj.length === +obj.length) {
      for (var i = 0, l = obj.length; i < l; i++) {
        if (i in obj && iterator.call(context, obj[i], i, obj) === breaker) return;
      }
    } else {
      for (var key in obj) {
        if (hasOwnProperty.call(obj, key)) {
          if (iterator.call(context, obj[key], key, obj) === breaker) return;
        }
      }
    }
  };

  // Return the results of applying the iterator to each element.
  // Delegates to **ECMAScript 5**'s native `map` if available.
  _.map = function(obj, iterator, context) {
    var results = [];
    if (obj == null) return results;
    if (nativeMap && obj.map === nativeMap) return obj.map(iterator, context);
    each(obj, function(value, index, list) {
      results[results.length] = iterator.call(context, value, index, list);
    });
    return results;
  };

  // **Reduce** builds up a single result from a list of values, aka `inject`,
  // or `foldl`. Delegates to **ECMAScript 5**'s native `reduce` if available.
  _.reduce = _.foldl = _.inject = function(obj, iterator, memo, context) {
    var initial = memo !== void 0;
    if (obj == null) obj = [];
    if (nativeReduce && obj.reduce === nativeReduce) {
      if (context) iterator = _.bind(iterator, context);
      return initial ? obj.reduce(iterator, memo) : obj.reduce(iterator);
    }
    each(obj, function(value, index, list) {
      if (!initial) {
        memo = value;
        initial = true;
      } else {
        memo = iterator.call(context, memo, value, index, list);
      }
    });
    if (!initial) throw new TypeError("Reduce of empty array with no initial value");
    return memo;
  };

  // The right-associative version of reduce, also known as `foldr`.
  // Delegates to **ECMAScript 5**'s native `reduceRight` if available.
  _.reduceRight = _.foldr = function(obj, iterator, memo, context) {
    if (obj == null) obj = [];
    if (nativeReduceRight && obj.reduceRight === nativeReduceRight) {
      if (context) iterator = _.bind(iterator, context);
      return memo !== void 0 ? obj.reduceRight(iterator, memo) : obj.reduceRight(iterator);
    }
    var reversed = (_.isArray(obj) ? obj.slice() : _.toArray(obj)).reverse();
    return _.reduce(reversed, iterator, memo, context);
  };

  // Return the first value which passes a truth test. Aliased as `detect`.
  _.find = _.detect = function(obj, iterator, context) {
    var result;
    any(obj, function(value, index, list) {
      if (iterator.call(context, value, index, list)) {
        result = value;
        return true;
      }
    });
    return result;
  };

  // Return all the elements that pass a truth test.
  // Delegates to **ECMAScript 5**'s native `filter` if available.
  // Aliased as `select`.
  _.filter = _.select = function(obj, iterator, context) {
    var results = [];
    if (obj == null) return results;
    if (nativeFilter && obj.filter === nativeFilter) return obj.filter(iterator, context);
    each(obj, function(value, index, list) {
      if (iterator.call(context, value, index, list)) results[results.length] = value;
    });
    return results;
  };

  // Return all the elements for which a truth test fails.
  _.reject = function(obj, iterator, context) {
    var results = [];
    if (obj == null) return results;
    each(obj, function(value, index, list) {
      if (!iterator.call(context, value, index, list)) results[results.length] = value;
    });
    return results;
  };

  // Determine whether all of the elements match a truth test.
  // Delegates to **ECMAScript 5**'s native `every` if available.
  // Aliased as `all`.
  _.every = _.all = function(obj, iterator, context) {
    var result = true;
    if (obj == null) return result;
    if (nativeEvery && obj.every === nativeEvery) return obj.every(iterator, context);
    each(obj, function(value, index, list) {
      if (!(result = result && iterator.call(context, value, index, list))) return breaker;
    });
    return result;
  };

  // Determine if at least one element in the object matches a truth test.
  // Delegates to **ECMAScript 5**'s native `some` if available.
  // Aliased as `any`.
  var any = _.some = _.any = function(obj, iterator, context) {
    iterator = iterator || _.identity;
    var result = false;
    if (obj == null) return result;
    if (nativeSome && obj.some === nativeSome) return obj.some(iterator, context);
    each(obj, function(value, index, list) {
      if (result |= iterator.call(context, value, index, list)) return breaker;
    });
    return !!result;
  };

  // Determine if a given value is included in the array or object using `===`.
  // Aliased as `contains`.
  _.include = _.contains = function(obj, target) {
    var found = false;
    if (obj == null) return found;
    if (nativeIndexOf && obj.indexOf === nativeIndexOf) return obj.indexOf(target) != -1;
    any(obj, function(value) {
      if (found = value === target) return true;
    });
    return found;
  };

  // Invoke a method (with arguments) on every item in a collection.
  _.invoke = function(obj, method) {
    var args = slice.call(arguments, 2);
    return _.map(obj, function(value) {
      return (method.call ? method || value : value[method]).apply(value, args);
    });
  };

  // Convenience version of a common use case of `map`: fetching a property.
  _.pluck = function(obj, key) {
    return _.map(obj, function(value){ return value[key]; });
  };

  // Return the maximum element or (element-based computation).
  _.max = function(obj, iterator, context) {
    if (!iterator && _.isArray(obj)) return Math.max.apply(Math, obj);
    var result = {computed : -Infinity};
    each(obj, function(value, index, list) {
      var computed = iterator ? iterator.call(context, value, index, list) : value;
      computed >= result.computed && (result = {value : value, computed : computed});
    });
    return result.value;
  };

  // Return the minimum element (or element-based computation).
  _.min = function(obj, iterator, context) {
    if (!iterator && _.isArray(obj)) return Math.min.apply(Math, obj);
    var result = {computed : Infinity};
    each(obj, function(value, index, list) {
      var computed = iterator ? iterator.call(context, value, index, list) : value;
      computed < result.computed && (result = {value : value, computed : computed});
    });
    return result.value;
  };

  // Sort the object's values by a criterion produced by an iterator.
  _.sortBy = function(obj, iterator, context) {
    return _.pluck(_.map(obj, function(value, index, list) {
      return {
        value : value,
        criteria : iterator.call(context, value, index, list)
      };
    }).sort(function(left, right) {
      var a = left.criteria, b = right.criteria;
      return a < b ? -1 : a > b ? 1 : 0;
    }), 'value');
  };

  // Groups the object's values by a criterion produced by an iterator
  _.groupBy = function(obj, iterator) {
    var result = {};
    each(obj, function(value, index) {
      var key = iterator(value, index);
      (result[key] || (result[key] = [])).push(value);
    });
    return result;
  };

  // Use a comparator function to figure out at what index an object should
  // be inserted so as to maintain order. Uses binary search.
  _.sortedIndex = function(array, obj, iterator) {
    iterator || (iterator = _.identity);
    var low = 0, high = array.length;
    while (low < high) {
      var mid = (low + high) >> 1;
      iterator(array[mid]) < iterator(obj) ? low = mid + 1 : high = mid;
    }
    return low;
  };

  // Safely convert anything iterable into a real, live array.
  _.toArray = function(iterable) {
    if (!iterable)                return [];
    if (iterable.toArray)         return iterable.toArray();
    if (_.isArray(iterable))      return slice.call(iterable);
    if (_.isArguments(iterable))  return slice.call(iterable);
    return _.values(iterable);
  };

  // Return the number of elements in an object.
  _.size = function(obj) {
    return _.toArray(obj).length;
  };

  // Array Functions
  // ---------------

  // Get the first element of an array. Passing **n** will return the first N
  // values in the array. Aliased as `head`. The **guard** check allows it to work
  // with `_.map`.
  _.first = _.head = function(array, n, guard) {
    return (n != null) && !guard ? slice.call(array, 0, n) : array[0];
  };

  // Returns everything but the first entry of the array. Aliased as `tail`.
  // Especially useful on the arguments object. Passing an **index** will return
  // the rest of the values in the array from that index onward. The **guard**
  // check allows it to work with `_.map`.
  _.rest = _.tail = function(array, index, guard) {
    return slice.call(array, (index == null) || guard ? 1 : index);
  };

  // Get the last element of an array.
  _.last = function(array) {
    return array[array.length - 1];
  };

  // Trim out all falsy values from an array.
  _.compact = function(array) {
    return _.filter(array, function(value){ return !!value; });
  };

  // Return a completely flattened version of an array.
  _.flatten = function(array) {
    return _.reduce(array, function(memo, value) {
      if (_.isArray(value)) return memo.concat(_.flatten(value));
      memo[memo.length] = value;
      return memo;
    }, []);
  };

  // Return a version of the array that does not contain the specified value(s).
  _.without = function(array) {
    return _.difference(array, slice.call(arguments, 1));
  };

  // Produce a duplicate-free version of the array. If the array has already
  // been sorted, you have the option of using a faster algorithm.
  // Aliased as `unique`.
  _.uniq = _.unique = function(array, isSorted) {
    return _.reduce(array, function(memo, el, i) {
      if (0 == i || (isSorted === true ? _.last(memo) != el : !_.include(memo, el))) memo[memo.length] = el;
      return memo;
    }, []);
  };

  // Produce an array that contains the union: each distinct element from all of
  // the passed-in arrays.
  _.union = function() {
    return _.uniq(_.flatten(arguments));
  };

  // Produce an array that contains every item shared between all the
  // passed-in arrays. (Aliased as "intersect" for back-compat.)
  _.intersection = _.intersect = function(array) {
    var rest = slice.call(arguments, 1);
    return _.filter(_.uniq(array), function(item) {
      return _.every(rest, function(other) {
        return _.indexOf(other, item) >= 0;
      });
    });
  };

  // Take the difference between one array and another.
  // Only the elements present in just the first array will remain.
  _.difference = function(array, other) {
    return _.filter(array, function(value){ return !_.include(other, value); });
  };

  // Zip together multiple lists into a single array -- elements that share
  // an index go together.
  _.zip = function() {
    var args = slice.call(arguments);
    var length = _.max(_.pluck(args, 'length'));
    var results = new Array(length);
    for (var i = 0; i < length; i++) results[i] = _.pluck(args, "" + i);
    return results;
  };

  // If the browser doesn't supply us with indexOf (I'm looking at you, **MSIE**),
  // we need this function. Return the position of the first occurrence of an
  // item in an array, or -1 if the item is not included in the array.
  // Delegates to **ECMAScript 5**'s native `indexOf` if available.
  // If the array is large and already in sort order, pass `true`
  // for **isSorted** to use binary search.
  _.indexOf = function(array, item, isSorted) {
    if (array == null) return -1;
    var i, l;
    if (isSorted) {
      i = _.sortedIndex(array, item);
      return array[i] === item ? i : -1;
    }
    if (nativeIndexOf && array.indexOf === nativeIndexOf) return array.indexOf(item);
    for (i = 0, l = array.length; i < l; i++) if (array[i] === item) return i;
    return -1;
  };


  // Delegates to **ECMAScript 5**'s native `lastIndexOf` if available.
  _.lastIndexOf = function(array, item) {
    if (array == null) return -1;
    if (nativeLastIndexOf && array.lastIndexOf === nativeLastIndexOf) return array.lastIndexOf(item);
    var i = array.length;
    while (i--) if (array[i] === item) return i;
    return -1;
  };

  // Generate an integer Array containing an arithmetic progression. A port of
  // the native Python `range()` function. See
  // [the Python documentation](http://docs.python.org/library/functions.html#range).
  _.range = function(start, stop, step) {
    if (arguments.length <= 1) {
      stop = start || 0;
      start = 0;
    }
    step = arguments[2] || 1;

    var len = Math.max(Math.ceil((stop - start) / step), 0);
    var idx = 0;
    var range = new Array(len);

    while(idx < len) {
      range[idx++] = start;
      start += step;
    }

    return range;
  };

  // Function (ahem) Functions
  // ------------------

  // Create a function bound to a given object (assigning `this`, and arguments,
  // optionally). Binding with arguments is also known as `curry`.
  // Delegates to **ECMAScript 5**'s native `Function.bind` if available.
  // We check for `func.bind` first, to fail fast when `func` is undefined.
  _.bind = function(func, obj) {
    if (func.bind === nativeBind && nativeBind) return nativeBind.apply(func, slice.call(arguments, 1));
    var args = slice.call(arguments, 2);
    return function() {
      return func.apply(obj, args.concat(slice.call(arguments)));
    };
  };

  // Bind all of an object's methods to that object. Useful for ensuring that
  // all callbacks defined on an object belong to it.
  _.bindAll = function(obj) {
    var funcs = slice.call(arguments, 1);
    if (funcs.length == 0) funcs = _.functions(obj);
    each(funcs, function(f) { obj[f] = _.bind(obj[f], obj); });
    return obj;
  };

  // Memoize an expensive function by storing its results.
  _.memoize = function(func, hasher) {
    var memo = {};
    hasher || (hasher = _.identity);
    return function() {
      var key = hasher.apply(this, arguments);
      return hasOwnProperty.call(memo, key) ? memo[key] : (memo[key] = func.apply(this, arguments));
    };
  };

  // Delays a function for the given number of milliseconds, and then calls
  // it with the arguments supplied.
  _.delay = function(func, wait) {
    var args = slice.call(arguments, 2);
    return setTimeout(function(){ return func.apply(func, args); }, wait);
  };

  // Defers a function, scheduling it to run after the current call stack has
  // cleared.
  _.defer = function(func) {
    return _.delay.apply(_, [func, 1].concat(slice.call(arguments, 1)));
  };

  // Internal function used to implement `_.throttle` and `_.debounce`.
  var limit = function(func, wait, debounce) {
    var timeout;
    return function() {
      var context = this, args = arguments;
      var throttler = function() {
        timeout = null;
        func.apply(context, args);
      };
      if (debounce) clearTimeout(timeout);
      if (debounce || !timeout) timeout = setTimeout(throttler, wait);
    };
  };

  // Returns a function, that, when invoked, will only be triggered at most once
  // during a given window of time.
  _.throttle = function(func, wait) {
    return limit(func, wait, false);
  };

  // Returns a function, that, as long as it continues to be invoked, will not
  // be triggered. The function will be called after it stops being called for
  // N milliseconds.
  _.debounce = function(func, wait) {
    return limit(func, wait, true);
  };

  // Returns a function that will be executed at most one time, no matter how
  // often you call it. Useful for lazy initialization.
  _.once = function(func) {
    var ran = false, memo;
    return function() {
      if (ran) return memo;
      ran = true;
      return memo = func.apply(this, arguments);
    };
  };

  // Returns the first function passed as an argument to the second,
  // allowing you to adjust arguments, run code before and after, and
  // conditionally execute the original function.
  _.wrap = function(func, wrapper) {
    return function() {
      var args = [func].concat(slice.call(arguments));
      return wrapper.apply(this, args);
    };
  };

  // Returns a function that is the composition of a list of functions, each
  // consuming the return value of the function that follows.
  _.compose = function() {
    var funcs = slice.call(arguments);
    return function() {
      var args = slice.call(arguments);
      for (var i = funcs.length - 1; i >= 0; i--) {
        args = [funcs[i].apply(this, args)];
      }
      return args[0];
    };
  };

  // Returns a function that will only be executed after being called N times.
  _.after = function(times, func) {
    return function() {
      if (--times < 1) { return func.apply(this, arguments); }
    };
  };


  // Object Functions
  // ----------------

  // Retrieve the names of an object's properties.
  // Delegates to **ECMAScript 5**'s native `Object.keys`
  _.keys = nativeKeys || function(obj) {
    if (obj !== Object(obj)) throw new TypeError('Invalid object');
    var keys = [];
    for (var key in obj) if (hasOwnProperty.call(obj, key)) keys[keys.length] = key;
    return keys;
  };

  // Retrieve the values of an object's properties.
  _.values = function(obj) {
    return _.map(obj, _.identity);
  };

  // Return a sorted list of the function names available on the object.
  // Aliased as `methods`
  _.functions = _.methods = function(obj) {
    var names = [];
    for (var key in obj) {
      if (_.isFunction(obj[key])) names.push(key);
    }
    return names.sort();
  };

  // Extend a given object with all the properties in passed-in object(s).
  _.extend = function(obj) {
    each(slice.call(arguments, 1), function(source) {
      for (var prop in source) {
        if (source[prop] !== void 0) obj[prop] = source[prop];
      }
    });
    return obj;
  };

  // Fill in a given object with default properties.
  _.defaults = function(obj) {
    each(slice.call(arguments, 1), function(source) {
      for (var prop in source) {
        if (obj[prop] == null) obj[prop] = source[prop];
      }
    });
    return obj;
  };

  // Create a (shallow-cloned) duplicate of an object.
  _.clone = function(obj) {
    return _.isArray(obj) ? obj.slice() : _.extend({}, obj);
  };

  // Invokes interceptor with the obj, and then returns obj.
  // The primary purpose of this method is to "tap into" a method chain, in
  // order to perform operations on intermediate results within the chain.
  _.tap = function(obj, interceptor) {
    interceptor(obj);
    return obj;
  };

  // Perform a deep comparison to check if two objects are equal.
  _.isEqual = function(a, b) {
    // Check object identity.
    if (a === b) return true;
    // Different types?
    var atype = typeof(a), btype = typeof(b);
    if (atype != btype) return false;
    // Basic equality test (watch out for coercions).
    if (a == b) return true;
    // One is falsy and the other truthy.
    if ((!a && b) || (a && !b)) return false;
    // Unwrap any wrapped objects.
    if (a._chain) a = a._wrapped;
    if (b._chain) b = b._wrapped;
    // One of them implements an isEqual()?
    if (a.isEqual) return a.isEqual(b);
    if (b.isEqual) return b.isEqual(a);
    // Check dates' integer values.
    if (_.isDate(a) && _.isDate(b)) return a.getTime() === b.getTime();
    // Both are NaN?
    if (_.isNaN(a) && _.isNaN(b)) return false;
    // Compare regular expressions.
    if (_.isRegExp(a) && _.isRegExp(b))
      return a.source     === b.source &&
             a.global     === b.global &&
             a.ignoreCase === b.ignoreCase &&
             a.multiline  === b.multiline;
    // If a is not an object by this point, we can't handle it.
    if (atype !== 'object') return false;
    // Check for different array lengths before comparing contents.
    if (a.length && (a.length !== b.length)) return false;
    // Nothing else worked, deep compare the contents.
    var aKeys = _.keys(a), bKeys = _.keys(b);
    // Different object sizes?
    if (aKeys.length != bKeys.length) return false;
    // Recursive comparison of contents.
    for (var key in a) if (!(key in b) || !_.isEqual(a[key], b[key])) return false;
    return true;
  };

  // Is a given array or object empty?
  _.isEmpty = function(obj) {
    if (_.isArray(obj) || _.isString(obj)) return obj.length === 0;
    for (var key in obj) if (hasOwnProperty.call(obj, key)) return false;
    return true;
  };

  // Is a given value a DOM element?
  _.isElement = function(obj) {
    return !!(obj && obj.nodeType == 1);
  };

  // Is a given value an array?
  // Delegates to ECMA5's native Array.isArray
  _.isArray = nativeIsArray || function(obj) {
    return toString.call(obj) === '[object Array]';
  };

  // Is a given variable an object?
  _.isObject = function(obj) {
    return obj === Object(obj);
  };

  // Is a given variable an arguments object?
  _.isArguments = function(obj) {
    return !!(obj && hasOwnProperty.call(obj, 'callee'));
  };

  // Is a given value a function?
  _.isFunction = function(obj) {
    return !!(obj && obj.constructor && obj.call && obj.apply);
  };

  // Is a given value a string?
  _.isString = function(obj) {
    return !!(obj === '' || (obj && obj.charCodeAt && obj.substr));
  };

  // Is a given value a number?
  _.isNumber = function(obj) {
    return !!(obj === 0 || (obj && obj.toExponential && obj.toFixed));
  };

  // Is the given value `NaN`? `NaN` happens to be the only value in JavaScript
  // that does not equal itself.
  _.isNaN = function(obj) {
    return obj !== obj;
  };

  // Is a given value a boolean?
  _.isBoolean = function(obj) {
    return obj === true || obj === false;
  };

  // Is a given value a date?
  _.isDate = function(obj) {
    return !!(obj && obj.getTimezoneOffset && obj.setUTCFullYear);
  };

  // Is the given value a regular expression?
  _.isRegExp = function(obj) {
    return !!(obj && obj.test && obj.exec && (obj.ignoreCase || obj.ignoreCase === false));
  };

  // Is a given value equal to null?
  _.isNull = function(obj) {
    return obj === null;
  };

  // Is a given variable undefined?
  _.isUndefined = function(obj) {
    return obj === void 0;
  };

  // Utility Functions
  // -----------------

  // Run Underscore.js in *noConflict* mode, returning the `_` variable to its
  // previous owner. Returns a reference to the Underscore object.
  _.noConflict = function() {
    root._ = previousUnderscore;
    return this;
  };

  // Keep the identity function around for default iterators.
  _.identity = function(value) {
    return value;
  };

  // Run a function **n** times.
  _.times = function (n, iterator, context) {
    for (var i = 0; i < n; i++) iterator.call(context, i);
  };

  // Add your own custom functions to the Underscore object, ensuring that
  // they're correctly added to the OOP wrapper as well.
  _.mixin = function(obj) {
    each(_.functions(obj), function(name){
      addToWrapper(name, _[name] = obj[name]);
    });
  };

  // Generate a unique integer id (unique within the entire client session).
  // Useful for temporary DOM ids.
  var idCounter = 0;
  _.uniqueId = function(prefix) {
    var id = idCounter++;
    return prefix ? prefix + id : id;
  };

  // By default, Underscore uses ERB-style template delimiters, change the
  // following template settings to use alternative delimiters.
  _.templateSettings = {
    evaluate    : /<%([\s\S]+?)%>/g,
    interpolate : /<%=([\s\S]+?)%>/g
  };

  // JavaScript micro-templating, similar to John Resig's implementation.
  // Underscore templating handles arbitrary delimiters, preserves whitespace,
  // and correctly escapes quotes within interpolated code.
  _.template = function(str, data) {
    var c  = _.templateSettings;
    var tmpl = 'var __p=[],print=function(){__p.push.apply(__p,arguments);};' +
      'with(obj||{}){__p.push(\'' +
      str.replace(/\\/g, '\\\\')
         .replace(/'/g, "\\'")
         .replace(c.interpolate, function(match, code) {
           return "'," + code.replace(/\\'/g, "'") + ",'";
         })
         .replace(c.evaluate || null, function(match, code) {
           return "');" + code.replace(/\\'/g, "'")
                              .replace(/[\r\n\t]/g, ' ') + "__p.push('";
         })
         .replace(/\r/g, '\\r')
         .replace(/\n/g, '\\n')
         .replace(/\t/g, '\\t')
         + "');}return __p.join('');";
    var func = new Function('obj', tmpl);
    return data ? func(data) : func;
  };

  // The OOP Wrapper
  // ---------------

  // If Underscore is called as a function, it returns a wrapped object that
  // can be used OO-style. This wrapper holds altered versions of all the
  // underscore functions. Wrapped objects may be chained.
  var wrapper = function(obj) { this._wrapped = obj; };

  // Expose `wrapper.prototype` as `_.prototype`
  _.prototype = wrapper.prototype;

  // Helper function to continue chaining intermediate results.
  var result = function(obj, chain) {
    return chain ? _(obj).chain() : obj;
  };

  // A method to easily add functions to the OOP wrapper.
  var addToWrapper = function(name, func) {
    wrapper.prototype[name] = function() {
      var args = slice.call(arguments);
      unshift.call(args, this._wrapped);
      return result(func.apply(_, args), this._chain);
    };
  };

  // Add all of the Underscore functions to the wrapper object.
  _.mixin(_);

  // Add all mutator Array functions to the wrapper.
  each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) {
    var method = ArrayProto[name];
    wrapper.prototype[name] = function() {
      method.apply(this._wrapped, arguments);
      return result(this._wrapped, this._chain);
    };
  });

  // Add all accessor Array functions to the wrapper.
  each(['concat', 'join', 'slice'], function(name) {
    var method = ArrayProto[name];
    wrapper.prototype[name] = function() {
      return result(method.apply(this._wrapped, arguments), this._chain);
    };
  });

  // Start chaining a wrapped Underscore object.
  wrapper.prototype.chain = function() {
    this._chain = true;
    return this;
  };

  // Extracts the result from a wrapped and chained object.
  wrapper.prototype.value = function() {
    return this._wrapped;
  };

})();

//     Backbone.js 0.3.3
//     (c) 2010 Jeremy Ashkenas, DocumentCloud Inc.
//     Backbone may be freely distributed under the MIT license.
//     For all details and documentation:
//     http://documentcloud.github.com/backbone

(function(){

  // Initial Setup
  // -------------

  // Save a reference to the global object.
  var root = this;

  // Save the previous value of the `Backbone` variable.
  var previousBackbone = root.Backbone;

  // The top-level namespace. All public Backbone classes and modules will
  // be attached to this. Exported for both CommonJS and the browser.
  var Backbone;
  if (typeof exports !== 'undefined') {
    Backbone = exports;
  } else {
    Backbone = root.Backbone = {};
  }

  // Current version of the library. Keep in sync with `package.json`.
  Backbone.VERSION = '0.3.3';

  // Require Underscore, if we're on the server, and it's not already present.
  var _ = root._ || root.$;
  if (!_ && (typeof require !== 'undefined')) _ = require('underscore')._;

  // For Backbone's purposes, jQuery, Zepto, or Ender owns the `$` variable.
  var $ = root.jQuery || root.Zepto || root.$;

  // Runs Backbone.js in *noConflict* mode, returning the `Backbone` variable
  // to its previous owner. Returns a reference to this Backbone object.
  Backbone.noConflict = function() {
    root.Backbone = previousBackbone;
    return this;
  };

  // Turn on `emulateHTTP` to use support legacy HTTP servers. Setting this option will
  // fake `"PUT"` and `"DELETE"` requests via the `_method` parameter and set a
  // `X-Http-Method-Override` header.
  Backbone.emulateHTTP = false;

  // Turn on `emulateJSON` to support legacy servers that can't deal with direct
  // `application/json` requests ... will encode the body as
  // `application/x-www-form-urlencoded` instead and will send the model in a
  // form param named `model`.
  Backbone.emulateJSON = false;

  // Backbone.Events
  // -----------------

  // A module that can be mixed in to *any object* in order to provide it with
  // custom events. You may `bind` or `unbind` a callback function to an event;
  // `trigger`-ing an event fires all callbacks in succession.
  //
  //     var object = {};
  //     _.extend(object, Backbone.Events);
  //     object.bind('expand', function(){ alert('expanded'); });
  //     object.trigger('expand');
  //
  Backbone.Events = {

    // Bind an event, specified by a string name, `ev`, to a `callback` function.
    // Passing `"all"` will bind the callback to all events fired.
    bind : function(ev, callback) {
      var calls = this._callbacks || (this._callbacks = {});
      var list  = this._callbacks[ev] || (this._callbacks[ev] = []);
      list.push(callback);
      return this;
    },

    // Remove one or many callbacks. If `callback` is null, removes all
    // callbacks for the event. If `ev` is null, removes all bound callbacks
    // for all events.
    unbind : function(ev, callback) {
      var calls;
      if (!ev) {
        this._callbacks = {};
      } else if (calls = this._callbacks) {
        if (!callback) {
          calls[ev] = [];
        } else {
          var list = calls[ev];
          if (!list) return this;
          for (var i = 0, l = list.length; i < l; i++) {
            if (callback === list[i]) {
              list[i] = null;
              break;
            }
          }
        }
      }
      return this;
    },

    // Trigger an event, firing all bound callbacks. Callbacks are passed the
    // same arguments as `trigger` is, apart from the event name.
    // Listening for `"all"` passes the true event name as the first argument.
    trigger : function(eventName) {
      var list, calls, ev, callback, args, i, l;
      var both = 2;
      if (!(calls = this._callbacks)) return this;
      while (both--) {
        ev = both ? eventName : 'all';
        if (list = calls[ev]) {
          for (i = 0, l = list.length; i < l; i++) {
            if (!(callback = list[i])) {
              list.splice(i, 1); i--; l--;
            } else {
              args = both ? Array.prototype.slice.call(arguments, 1) : arguments;
              callback.apply(this, args);
            }
          }
        }
      }
      return this;
    }

  };

  // Backbone.Model
  // --------------

  // Create a new model, with defined attributes. A client id (`cid`)
  // is automatically generated and assigned for you.
  Backbone.Model = function(attributes, options) {
    var defaults;
    attributes || (attributes = {});
    if (defaults = this.defaults) {
      if (_.isFunction(defaults)) defaults = defaults();
      attributes = _.extend({}, defaults, attributes);
    }
    this.attributes = {};
    this._escapedAttributes = {};
    this.cid = _.uniqueId('c');
    this.set(attributes, {silent : true});
    this._changed = false;
    this._previousAttributes = _.clone(this.attributes);
    if (options && options.collection) this.collection = options.collection;
    this.initialize(attributes, options);
  };

  // Attach all inheritable methods to the Model prototype.
  _.extend(Backbone.Model.prototype, Backbone.Events, {

    // A snapshot of the model's previous attributes, taken immediately
    // after the last `"change"` event was fired.
    _previousAttributes : null,

    // Has the item been changed since the last `"change"` event?
    _changed : false,

    // The default name for the JSON `id` attribute is `"id"`. MongoDB and
    // CouchDB users may want to set this to `"_id"`.
    idAttribute : 'id',

    // Initialize is an empty function by default. Override it with your own
    // initialization logic.
    initialize : function(){},

    // Return a copy of the model's `attributes` object.
    toJSON : function() {
      return _.clone(this.attributes);
    },

    // Get the value of an attribute.
    get : function(attr) {
      return this.attributes[attr];
    },

    // Get the HTML-escaped value of an attribute.
    escape : function(attr) {
      var html;
      if (html = this._escapedAttributes[attr]) return html;
      var val = this.attributes[attr];
      return this._escapedAttributes[attr] = escapeHTML(val == null ? '' : '' + val);
    },

    // Returns `true` if the attribute contains a value that is not null
    // or undefined.
    has : function(attr) {
      return this.attributes[attr] != null;
    },

    // Set a hash of model attributes on the object, firing `"change"` unless you
    // choose to silence it.
    set : function(attrs, options) {

      // Extract attributes and options.
      options || (options = {});
      if (!attrs) return this;
      if (attrs.attributes) attrs = attrs.attributes;
      var now = this.attributes, escaped = this._escapedAttributes;

      // Run validation.
      if (!options.silent && this.validate && !this._performValidation(attrs, options)) return false;

      // Check for changes of `id`.
      if (this.idAttribute in attrs) this.id = attrs[this.idAttribute];

      // Update attributes.
      for (var attr in attrs) {
        var val = attrs[attr];
        if (!_.isEqual(now[attr], val)) {
          now[attr] = val;
          delete escaped[attr];
          this._changed = true;
          if (!options.silent) this.trigger('change:' + attr, this, val, options);
        }
      }

      // Fire the `"change"` event, if the model has been changed.
      if (!options.silent && this._changed) this.change(options);
      return this;
    },

    // Remove an attribute from the model, firing `"change"` unless you choose
    // to silence it. `unset` is a noop if the attribute doesn't exist.
    unset : function(attr, options) {
      if (!(attr in this.attributes)) return this;
      options || (options = {});
      var value = this.attributes[attr];

      // Run validation.
      var validObj = {};
      validObj[attr] = void 0;
      if (!options.silent && this.validate && !this._performValidation(validObj, options)) return false;

      // Remove the attribute.
      delete this.attributes[attr];
      delete this._escapedAttributes[attr];
      if (attr == this.idAttribute) delete this.id;
      this._changed = true;
      if (!options.silent) {
        this.trigger('change:' + attr, this, void 0, options);
        this.change(options);
      }
      return this;
    },

    // Clear all attributes on the model, firing `"change"` unless you choose
    // to silence it.
    clear : function(options) {
      options || (options = {});
      var old = this.attributes;

      // Run validation.
      var validObj = {};
      for (attr in old) validObj[attr] = void 0;
      if (!options.silent && this.validate && !this._performValidation(validObj, options)) return false;

      this.attributes = {};
      this._escapedAttributes = {};
      this._changed = true;
      if (!options.silent) {
        for (attr in old) {
          this.trigger('change:' + attr, this, void 0, options);
        }
        this.change(options);
      }
      return this;
    },

    // Fetch the model from the server. If the server's representation of the
    // model differs from its current attributes, they will be overriden,
    // triggering a `"change"` event.
    fetch : function(options) {
      options || (options = {});
      var model = this;
      var success = options.success;
      options.success = function(resp) {
        if (!model.set(model.parse(resp), options)) return false;
        if (success) success(model, resp);
      };
      options.error = wrapError(options.error, model, options);
      return (this.sync || Backbone.sync).call(this, 'read', this, options);
    },

    // Set a hash of model attributes, and sync the model to the server.
    // If the server returns an attributes hash that differs, the model's
    // state will be `set` again.
    save : function(attrs, options) {
      options || (options = {});
      if (attrs && !this.set(attrs, options)) return false;
      var model = this;
      var success = options.success;
      options.success = function(resp) {
        if (!model.set(model.parse(resp), options)) return false;
        if (success) success(model, resp);
      };
      options.error = wrapError(options.error, model, options);
      var method = this.isNew() ? 'create' : 'update';
      return (this.sync || Backbone.sync).call(this, method, this, options);
    },

    // Destroy this model on the server. Upon success, the model is removed
    // from its collection, if it has one.
    destroy : function(options) {
      options || (options = {});
      var model = this;
      var success = options.success;
      options.success = function(resp) {
        model.trigger('destroy', model, model.collection, options);
        if (success) success(model, resp);
      };
      options.error = wrapError(options.error, model, options);
      return (this.sync || Backbone.sync).call(this, 'delete', this, options);
    },

    // Default URL for the model's representation on the server -- if you're
    // using Backbone's restful methods, override this to change the endpoint
    // that will be called.
    url : function() {
      var base = getUrl(this.collection) || this.urlRoot || urlError();
      if (this.isNew()) return base;
      return base + (base.charAt(base.length - 1) == '/' ? '' : '/') + encodeURIComponent(this.id);
    },

    // **parse** converts a response into the hash of attributes to be `set` on
    // the model. The default implementation is just to pass the response along.
    parse : function(resp) {
      return resp;
    },

    // Create a new model with identical attributes to this one.
    clone : function() {
      return new this.constructor(this);
    },

    // A model is new if it has never been saved to the server, and has a negative
    // ID.
    isNew : function() {
      return !this.id;
    },

    // Call this method to manually fire a `change` event for this model.
    // Calling this will cause all objects observing the model to update.
    change : function(options) {
      this.trigger('change', this, options);
      this._previousAttributes = _.clone(this.attributes);
      this._changed = false;
    },

    // Determine if the model has changed since the last `"change"` event.
    // If you specify an attribute name, determine if that attribute has changed.
    hasChanged : function(attr) {
      if (attr) return this._previousAttributes[attr] != this.attributes[attr];
      return this._changed;
    },

    // Return an object containing all the attributes that have changed, or false
    // if there are no changed attributes. Useful for determining what parts of a
    // view need to be updated and/or what attributes need to be persisted to
    // the server.
    changedAttributes : function(now) {
      now || (now = this.attributes);
      var old = this._previousAttributes;
      var changed = false;
      for (var attr in now) {
        if (!_.isEqual(old[attr], now[attr])) {
          changed = changed || {};
          changed[attr] = now[attr];
        }
      }
      return changed;
    },

    // Get the previous value of an attribute, recorded at the time the last
    // `"change"` event was fired.
    previous : function(attr) {
      if (!attr || !this._previousAttributes) return null;
      return this._previousAttributes[attr];
    },

    // Get all of the attributes of the model at the time of the previous
    // `"change"` event.
    previousAttributes : function() {
      return _.clone(this._previousAttributes);
    },

    // Run validation against a set of incoming attributes, returning `true`
    // if all is well. If a specific `error` callback has been passed,
    // call that instead of firing the general `"error"` event.
    _performValidation : function(attrs, options) {
      var error = this.validate(attrs);
      if (error) {
        if (options.error) {
          options.error(this, error);
        } else {
          this.trigger('error', this, error, options);
        }
        return false;
      }
      return true;
    }

  });

  // Backbone.Collection
  // -------------------

  // Provides a standard collection class for our sets of models, ordered
  // or unordered. If a `comparator` is specified, the Collection will maintain
  // its models in sort order, as they're added and removed.
  Backbone.Collection = function(models, options) {
    options || (options = {});
    if (options.comparator) {
      this.comparator = options.comparator;
      delete options.comparator;
    }
    _.bindAll(this, '_onModelEvent', '_removeReference');
    this._reset();
    if (models) this.refresh(models, {silent: true});
    this.initialize(models, options);
  };

  // Define the Collection's inheritable methods.
  _.extend(Backbone.Collection.prototype, Backbone.Events, {

    // The default model for a collection is just a **Backbone.Model**.
    // This should be overridden in most cases.
    model : Backbone.Model,

    // Initialize is an empty function by default. Override it with your own
    // initialization logic.
    initialize : function(){},

    // The JSON representation of a Collection is an array of the
    // models' attributes.
    toJSON : function() {
      return this.map(function(model){ return model.toJSON(); });
    },

    // Add a model, or list of models to the set. Pass **silent** to avoid
    // firing the `added` event for every new model.
    add : function(models, options) {
      if (_.isArray(models)) {
        for (var i = 0, l = models.length; i < l; i++) {
          this._add(models[i], options);
        }
      } else {
        this._add(models, options);
      }
      return this;
    },

    // Remove a model, or a list of models from the set. Pass silent to avoid
    // firing the `removed` event for every model removed.
    remove : function(models, options) {
      if (_.isArray(models)) {
        for (var i = 0, l = models.length; i < l; i++) {
          this._remove(models[i], options);
        }
      } else {
        this._remove(models, options);
      }
      return this;
    },

    // Get a model from the set by id.
    get : function(id) {
      if (id == null) return null;
      return this._byId[id.id != null ? id.id : id];
    },

    // Get a model from the set by client id.
    getByCid : function(cid) {
      return cid && this._byCid[cid.cid || cid];
    },

    // Get the model at the given index.
    at: function(index) {
      return this.models[index];
    },

    // Force the collection to re-sort itself. You don't need to call this under normal
    // circumstances, as the set will maintain sort order as each item is added.
    sort : function(options) {
      options || (options = {});
      if (!this.comparator) throw new Error('Cannot sort a set without a comparator');
      this.models = this.sortBy(this.comparator);
      if (!options.silent) this.trigger('refresh', this, options);
      return this;
    },

    // Pluck an attribute from each model in the collection.
    pluck : function(attr) {
      return _.map(this.models, function(model){ return model.get(attr); });
    },

    // When you have more items than you want to add or remove individually,
    // you can refresh the entire set with a new list of models, without firing
    // any `added` or `removed` events. Fires `refresh` when finished.
    refresh : function(models, options) {
      models  || (models = []);
      options || (options = {});
      this.each(this._removeReference);
      this._reset();
      this.add(models, {silent: true});
      if (!options.silent) this.trigger('refresh', this, options);
      return this;
    },

    // Fetch the default set of models for this collection, refreshing the
    // collection when they arrive. If `add: true` is passed, appends the
    // models to the collection instead of refreshing.
    fetch : function(options) {
      options || (options = {});
      var collection = this;
      var success = options.success;
      options.success = function(resp) {
        collection[options.add ? 'add' : 'refresh'](collection.parse(resp), options);
        if (success) success(collection, resp);
      };
      options.error = wrapError(options.error, collection, options);
      return (this.sync || Backbone.sync).call(this, 'read', this, options);
    },

    // Create a new instance of a model in this collection. After the model
    // has been created on the server, it will be added to the collection.
    create : function(model, options) {
      var coll = this;
      options || (options = {});
      if (!(model instanceof Backbone.Model)) {
        var attrs = model;
        model = new this.model(null, {collection: coll});
        if (!model.set(attrs)) return false;
      } else {
        model.collection = coll;
      }
      var success = options.success;
      options.success = function(nextModel, resp) {
        coll.add(nextModel);
        if (success) success(nextModel, resp);
      };
      model.save(null, options);
      return model;
    },

    // **parse** converts a response into a list of models to be added to the
    // collection. The default implementation is just to pass it through.
    parse : function(resp) {
      return resp;
    },

    // Proxy to _'s chain. Can't be proxied the same way the rest of the
    // underscore methods are proxied because it relies on the underscore
    // constructor.
    chain: function () {
      return _(this.models).chain();
    },

    // Reset all internal state. Called when the collection is refreshed.
    _reset : function(options) {
      this.length = 0;
      this.models = [];
      this._byId  = {};
      this._byCid = {};
    },

    // Internal implementation of adding a single model to the set, updating
    // hash indexes for `id` and `cid` lookups.
    _add : function(model, options) {
      options || (options = {});
      if (!(model instanceof Backbone.Model)) {
        model = new this.model(model, {collection: this});
      }
      var already = this.getByCid(model);
      if (already) throw new Error(["Can't add the same model to a set twice", already.id]);
      this._byId[model.id] = model;
      this._byCid[model.cid] = model;
      if (!model.collection) {
        model.collection = this;
      }
      var index = this.comparator ? this.sortedIndex(model, this.comparator) : this.length;
      this.models.splice(index, 0, model);
      model.bind('all', this._onModelEvent);
      this.length++;
      if (!options.silent) model.trigger('add', model, this, options);
      return model;
    },

    // Internal implementation of removing a single model from the set, updating
    // hash indexes for `id` and `cid` lookups.
    _remove : function(model, options) {
      options || (options = {});
      model = this.getByCid(model) || this.get(model);
      if (!model) return null;
      delete this._byId[model.id];
      delete this._byCid[model.cid];
      this.models.splice(this.indexOf(model), 1);
      this.length--;
      if (!options.silent) model.trigger('remove', model, this, options);
      this._removeReference(model);
      return model;
    },

    // Internal method to remove a model's ties to a collection.
    _removeReference : function(model) {
      if (this == model.collection) {
        delete model.collection;
      }
      model.unbind('all', this._onModelEvent);
    },

    // Internal method called every time a model in the set fires an event.
    // Sets need to update their indexes when models change ids. All other
    // events simply proxy through. "add" and "remove" events that originate
    // in other collections are ignored.
    _onModelEvent : function(ev, model, collection, options) {
      if ((ev == 'add' || ev == 'remove') && collection != this) return;
      if (ev == 'destroy') {
        this._remove(model, options);
      }
      if (model && ev === 'change:' + model.idAttribute) {
        delete this._byId[model.previous(model.idAttribute)];
        this._byId[model.id] = model;
      }
      this.trigger.apply(this, arguments);
    }

  });

  // Underscore methods that we want to implement on the Collection.
  var methods = ['forEach', 'each', 'map', 'reduce', 'reduceRight', 'find', 'detect',
    'filter', 'select', 'reject', 'every', 'all', 'some', 'any', 'include',
    'invoke', 'max', 'min', 'sortBy', 'sortedIndex', 'toArray', 'size',
    'first', 'rest', 'last', 'without', 'indexOf', 'lastIndexOf', 'isEmpty'];

  // Mix in each Underscore method as a proxy to `Collection#models`.
  _.each(methods, function(method) {
    Backbone.Collection.prototype[method] = function() {
      return _[method].apply(_, [this.models].concat(_.toArray(arguments)));
    };
  });

  // Backbone.Controller
  // -------------------

  // Controllers map faux-URLs to actions, and fire events when routes are
  // matched. Creating a new one sets its `routes` hash, if not set statically.
  Backbone.Controller = function(options) {
    options || (options = {});
    if (options.routes) this.routes = options.routes;
    this._bindRoutes();
    this.initialize(options);
  };

  // Cached regular expressions for matching named param parts and splatted
  // parts of route strings.
  var namedParam    = /:([\w\d]+)/g;
  var splatParam    = /\*([\w\d]+)/g;
  var escapeRegExp  = /[-[\]{}()+?.,\\^$|#\s]/g;

  // Set up all inheritable **Backbone.Controller** properties and methods.
  _.extend(Backbone.Controller.prototype, Backbone.Events, {

    // Initialize is an empty function by default. Override it with your own
    // initialization logic.
    initialize : function(){},

    // Manually bind a single named route to a callback. For example:
    //
    //     this.route('search/:query/p:num', 'search', function(query, num) {
    //       ...
    //     });
    //
    route : function(route, name, callback) {
      Backbone.history || (Backbone.history = new Backbone.History);
      if (!_.isRegExp(route)) route = this._routeToRegExp(route);
      Backbone.history.route(route, _.bind(function(fragment) {
        var args = this._extractParameters(route, fragment);
        callback.apply(this, args);
        this.trigger.apply(this, ['route:' + name].concat(args));
      }, this));
    },

    // Simple proxy to `Backbone.history` to save a fragment into the history,
    // without triggering routes.
    saveLocation : function(fragment) {
      Backbone.history.saveLocation(fragment);
    },

    // Bind all defined routes to `Backbone.history`. We have to reverse the
    // order of the routes here to support behavior where the most general
    // routes can be defined at the bottom of the route map.
    _bindRoutes : function() {
      if (!this.routes) return;
      var routes = [];
      for (var route in this.routes) {
        routes.unshift([route, this.routes[route]]);
      }
      for (var i = 0, l = routes.length; i < l; i++) {
        this.route(routes[i][0], routes[i][1], this[routes[i][1]]);
      }
    },

    // Convert a route string into a regular expression, suitable for matching
    // against the current location fragment.
    _routeToRegExp : function(route) {
      route = route.replace(escapeRegExp, "\\$&")
                   .replace(namedParam, "([^\/]*)")
                   .replace(splatParam, "(.*?)");
      return new RegExp('^' + route + '$');
    },

    // Given a route, and a URL fragment that it matches, return the array of
    // extracted parameters.
    _extractParameters : function(route, fragment) {
      return route.exec(fragment).slice(1);
    }

  });

  // Backbone.History
  // ----------------

  // Handles cross-browser history management, based on URL hashes. If the
  // browser does not support `onhashchange`, falls back to polling.
  Backbone.History = function() {
    this.handlers = [];
    this.fragment = this.getFragment();
    _.bindAll(this, 'checkUrl');
  };

  // Cached regex for cleaning hashes.
  var hashStrip = /^#*/;

  // Cached regex for detecting MSIE.
  var isExplorer = /msie [\w.]+/;

  // Has the history handling already been started?
  var historyStarted = false;

  // Set up all inheritable **Backbone.History** properties and methods.
  _.extend(Backbone.History.prototype, {

    // The default interval to poll for hash changes, if necessary, is
    // twenty times a second.
    interval: 50,

    // Get the cross-browser normalized URL fragment.
    getFragment : function(loc) {
      return (loc || window.location).hash.replace(hashStrip, '');
    },

    // Start the hash change handling, returning `true` if the current URL matches
    // an existing route, and `false` otherwise.
    start : function() {
      if (historyStarted) throw new Error("Backbone.history has already been started");
      var docMode = document.documentMode;
      var oldIE = (isExplorer.exec(navigator.userAgent.toLowerCase()) && (!docMode || docMode <= 7));
      if (oldIE) {
        this.iframe = $('<iframe src="javascript:0" tabindex="-1" />').hide().appendTo('body')[0].contentWindow;
      }
      if ('onhashchange' in window && !oldIE) {
        $(window).bind('hashchange', this.checkUrl);
      } else {
        setInterval(this.checkUrl, this.interval);
      }
      historyStarted = true;
      return this.loadUrl();
    },

    // Add a route to be tested when the hash changes. Routes added later may
    // override previous routes.
    route : function(route, callback) {
      this.handlers.unshift({route : route, callback : callback});
    },

    // Checks the current URL to see if it has changed, and if it has,
    // calls `loadUrl`, normalizing across the hidden iframe.
    checkUrl : function() {
      var current = this.getFragment();
      if (current == this.fragment && this.iframe) {
        current = this.getFragment(this.iframe.location);
      }
      if (current == this.fragment ||
          current == decodeURIComponent(this.fragment)) return false;
      if (this.iframe) {
        window.location.hash = this.iframe.location.hash = current;
      }
      this.loadUrl();
    },

    // Attempt to load the current URL fragment. If a route succeeds with a
    // match, returns `true`. If no defined routes matches the fragment,
    // returns `false`.
    loadUrl : function() {
      var fragment = this.fragment = this.getFragment();
      var matched = _.any(this.handlers, function(handler) {
        if (handler.route.test(fragment)) {
          handler.callback(fragment);
          return true;
        }
      });
      return matched;
    },

    // Save a fragment into the hash history. You are responsible for properly
    // URL-encoding the fragment in advance. This does not trigger
    // a `hashchange` event.
    saveLocation : function(fragment) {
      fragment = (fragment || '').replace(hashStrip, '');
      if (this.fragment == fragment) return;
      window.location.hash = this.fragment = fragment;
      if (this.iframe && (fragment != this.getFragment(this.iframe.location))) {
        this.iframe.document.open().close();
        this.iframe.location.hash = fragment;
      }
    }

  });

  // Backbone.View
  // -------------

  // Creating a Backbone.View creates its initial element outside of the DOM,
  // if an existing element is not provided...
  Backbone.View = function(options) {
    this.cid = _.uniqueId('view');
    this._configure(options || {});
    this._ensureElement();
    this.delegateEvents();
    this.initialize(options);
  };

  // Element lookup, scoped to DOM elements within the current view.
  // This should be prefered to global lookups, if you're dealing with
  // a specific view.
  var selectorDelegate = function(selector) {
    return $(selector, this.el);
  };

  // Cached regex to split keys for `delegate`.
  var eventSplitter = /^(\w+)\s*(.*)$/;

  // List of view options to be merged as properties.
  var viewOptions = ['model', 'collection', 'el', 'id', 'attributes', 'className', 'tagName'];

  // Set up all inheritable **Backbone.View** properties and methods.
  _.extend(Backbone.View.prototype, Backbone.Events, {

    // The default `tagName` of a View's element is `"div"`.
    tagName : 'div',

    // Attach the `selectorDelegate` function as the `$` property.
    $       : selectorDelegate,

    // Initialize is an empty function by default. Override it with your own
    // initialization logic.
    initialize : function(){},

    // **render** is the core function that your view should override, in order
    // to populate its element (`this.el`), with the appropriate HTML. The
    // convention is for **render** to always return `this`.
    render : function() {
      return this;
    },

    // Remove this view from the DOM. Note that the view isn't present in the
    // DOM by default, so calling this method may be a no-op.
    remove : function() {
      $(this.el).remove();
      return this;
    },

    // For small amounts of DOM Elements, where a full-blown template isn't
    // needed, use **make** to manufacture elements, one at a time.
    //
    //     var el = this.make('li', {'class': 'row'}, this.model.escape('title'));
    //
    make : function(tagName, attributes, content) {
      var el = document.createElement(tagName);
      if (attributes) $(el).attr(attributes);
      if (content) $(el).html(content);
      return el;
    },

    // Set callbacks, where `this.callbacks` is a hash of
    //
    // *{"event selector": "callback"}*
    //
    //     {
    //       'mousedown .title':  'edit',
    //       'click .button':     'save'
    //     }
    //
    // pairs. Callbacks will be bound to the view, with `this` set properly.
    // Uses event delegation for efficiency.
    // Omitting the selector binds the event to `this.el`.
    // This only works for delegate-able events: not `focus`, `blur`, and
    // not `change`, `submit`, and `reset` in Internet Explorer.
    delegateEvents : function(events) {
      if (!(events || (events = this.events))) return;
      $(this.el).unbind('.delegateEvents' + this.cid);
      for (var key in events) {
        var methodName = events[key];
        var match = key.match(eventSplitter);
        var eventName = match[1], selector = match[2];
        var method = _.bind(this[methodName], this);
        eventName += '.delegateEvents' + this.cid;
        if (selector === '') {
          $(this.el).bind(eventName, method);
        } else {
          $(this.el).delegate(selector, eventName, method);
        }
      }
    },

    // Performs the initial configuration of a View with a set of options.
    // Keys with special meaning *(model, collection, id, className)*, are
    // attached directly to the view.
    _configure : function(options) {
      if (this.options) options = _.extend({}, this.options, options);
      for (var i = 0, l = viewOptions.length; i < l; i++) {
        var attr = viewOptions[i];
        if (options[attr]) this[attr] = options[attr];
      }
      this.options = options;
    },

    // Ensure that the View has a DOM element to render into.
    // If `this.el` is a string, pass it through `$()`, take the first
    // matching element, and re-assign it to `el`. Otherwise, create
    // an element from the `id`, `className` and `tagName` proeprties.
    _ensureElement : function() {
      if (!this.el) {
        var attrs = this.attributes || {};
        if (this.id) attrs.id = this.id;
        if (this.className) attrs['class'] = this.className;
        this.el = this.make(this.tagName, attrs);
      } else if (_.isString(this.el)) {
        this.el = $(this.el).get(0);
      }
    }

  });

  // The self-propagating extend function that Backbone classes use.
  var extend = function (protoProps, classProps) {
    var child = inherits(this, protoProps, classProps);
    child.extend = this.extend;
    return child;
  };

  // Set up inheritance for the model, collection, and view.
  Backbone.Model.extend = Backbone.Collection.extend =
    Backbone.Controller.extend = Backbone.View.extend = extend;

  // Map from CRUD to HTTP for our default `Backbone.sync` implementation.
  var methodMap = {
    'create': 'POST',
    'update': 'PUT',
    'delete': 'DELETE',
    'read'  : 'GET'
  };

  // Backbone.sync
  // -------------

  // Override this function to change the manner in which Backbone persists
  // models to the server. You will be passed the type of request, and the
  // model in question. By default, uses makes a RESTful Ajax request
  // to the model's `url()`. Some possible customizations could be:
  //
  // * Use `setTimeout` to batch rapid-fire updates into a single request.
  // * Send up the models as XML instead of JSON.
  // * Persist models via WebSockets instead of Ajax.
  //
  // Turn on `Backbone.emulateHTTP` in order to send `PUT` and `DELETE` requests
  // as `POST`, with a `_method` parameter containing the true HTTP method,
  // as well as all requests with the body as `application/x-www-form-urlencoded` instead of
  // `application/json` with the model in a param named `model`.
  // Useful when interfacing with server-side languages like **PHP** that make
  // it difficult to read the body of `PUT` requests.
  Backbone.sync = function(method, model, options) {
    var type = methodMap[method];

    // Default JSON-request options.
    var params = _.extend({
      type:         type,
      contentType:  'application/json',
      dataType:     'json',
      processData:  false
    }, options);

    // Ensure that we have a URL.
    if (!params.url) {
      params.url = getUrl(model) || urlError();
    }

    // Ensure that we have the appropriate request data.
    if (!params.data && model && (method == 'create' || method == 'update')) {
      params.data = JSON.stringify(model.toJSON());
    }

    // For older servers, emulate JSON by encoding the request into an HTML-form.
    if (Backbone.emulateJSON) {
      params.contentType = 'application/x-www-form-urlencoded';
      params.processData = true;
      params.data        = params.data ? {model : params.data} : {};
    }

    // For older servers, emulate HTTP by mimicking the HTTP method with `_method`
    // And an `X-HTTP-Method-Override` header.
    if (Backbone.emulateHTTP) {
      if (type === 'PUT' || type === 'DELETE') {
        if (Backbone.emulateJSON) params.data._method = type;
        params.type = 'POST';
        params.beforeSend = function(xhr) {
          xhr.setRequestHeader('X-HTTP-Method-Override', type);
        };
      }
    }

    // Make the request.
    return $.ajax(params);
  };

  // Helpers
  // -------

  // Shared empty constructor function to aid in prototype-chain creation.
  var ctor = function(){};

  // Helper function to correctly set up the prototype chain, for subclasses.
  // Similar to `goog.inherits`, but uses a hash of prototype properties and
  // class properties to be extended.
  var inherits = function(parent, protoProps, staticProps) {
    var child;

    // The constructor function for the new subclass is either defined by you
    // (the "constructor" property in your `extend` definition), or defaulted
    // by us to simply call `super()`.
    if (protoProps && protoProps.hasOwnProperty('constructor')) {
      child = protoProps.constructor;
    } else {
      child = function(){ return parent.apply(this, arguments); };
    }

    // Inherit class (static) properties from parent.
    _.extend(child, parent);

    // Set the prototype chain to inherit from `parent`, without calling
    // `parent`'s constructor function.
    ctor.prototype = parent.prototype;
    child.prototype = new ctor();

    // Add prototype properties (instance properties) to the subclass,
    // if supplied.
    if (protoProps) _.extend(child.prototype, protoProps);

    // Add static properties to the constructor function, if supplied.
    if (staticProps) _.extend(child, staticProps);

    // Correctly set child's `prototype.constructor`.
    child.prototype.constructor = child;

    // Set a convenience property in case the parent's prototype is needed later.
    child.__super__ = parent.prototype;

    return child;
  };

  // Helper function to get a URL from a Model or Collection as a property
  // or as a function.
  var getUrl = function(object) {
    if (!(object && object.url)) return null;
    return _.isFunction(object.url) ? object.url() : object.url;
  };

  // Throw an error when a URL is needed, and none is supplied.
  var urlError = function() {
    throw new Error("A 'url' property or function must be specified");
  };

  // Wrap an optional error callback with a fallback error event.
  var wrapError = function(onError, model, options) {
    return function(resp) {
      if (onError) {
        onError(model, resp, options);
      } else {
        model.trigger('error', model, resp, options);
      }
    };
  };

  // Helper function to escape a string for HTML rendering.
  var escapeHTML = function(string) {
    return string.replace(/&(?!\w+;|#\d+;|#x[\da-f]+;)/gi, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;');
  };

}).call(this);

/**
 * Cookie plugin
 *
 * Copyright (c) 2006 Klaus Hartl (stilbuero.de)
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 *
 */

/**
 * Create a cookie with the given name and value and other optional parameters.
 *
 * @example $.cookie('the_cookie', 'the_value');
 * @desc Set the value of a cookie.
 * @example $.cookie('the_cookie', 'the_value', { expires: 7, path: '/', domain: 'jquery.com', secure: true });
 * @desc Create a cookie with all available options.
 * @example $.cookie('the_cookie', 'the_value');
 * @desc Create a session cookie.
 * @example $.cookie('the_cookie', null);
 * @desc Delete a cookie by passing null as value. Keep in mind that you have to use the same path and domain
 *       used when the cookie was set.
 *
 * @param String name The name of the cookie.
 * @param String value The value of the cookie.
 * @param Object options An object literal containing key/value pairs to provide optional cookie attributes.
 * @option Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object.
 *                             If a negative value is specified (e.g. a date in the past), the cookie will be deleted.
 *                             If set to null or omitted, the cookie will be a session cookie and will not be retained
 *                             when the the browser exits.
 * @option String path The value of the path atribute of the cookie (default: path of page that created the cookie).
 * @option String domain The value of the domain attribute of the cookie (default: domain of page that created the cookie).
 * @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will
 *                        require a secure protocol (like HTTPS).
 * @type undefined
 *
 * @name $.cookie
 * @cat Plugins/Cookie
 * @author Klaus Hartl/klaus.hartl@stilbuero.de
 */

/**
 * Get the value of a cookie with the given name.
 *
 * @example $.cookie('the_cookie');
 * @desc Get the value of a cookie.
 *
 * @param String name The name of the cookie.
 * @return The value of the cookie.
 * @type String
 *
 * @name $.cookie
 * @cat Plugins/Cookie
 * @author Klaus Hartl/klaus.hartl@stilbuero.de
 */
jQuery.cookie = function(name, value, options) {
    if (typeof value != 'undefined') { // name and value given, set cookie
        options = options || {};
        if (value === null) {
            value = '';
            options.expires = -1;
        }
        var expires = '';
        if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) {
            var date;
            if (typeof options.expires == 'number') {
                date = new Date();
                date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
            } else {
                date = options.expires;
            }
            expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE
        }
        // CAUTION: Needed to parenthesize options.path and options.domain
        // in the following expressions, otherwise they evaluate to undefined
        // in the packed version for some reason...
        var path = options.path ? '; path=' + (options.path) : '';
        var domain = options.domain ? '; domain=' + (options.domain) : '';
        var secure = options.secure ? '; secure' : '';
        document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');
    } else { // only name given, get cookie
        var cookieValue = null;
        if (document.cookie && document.cookie != '') {
            var cookies = document.cookie.split(';');
            for (var i = 0; i < cookies.length; i++) {
                var cookie = jQuery.trim(cookies[i]);
                // Does this cookie string begin with the name we want?
                if (cookie.substring(0, name.length + 1) == (name + '=')) {
                    cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
                    break;
                }
            }
        }
        return cookieValue;
    }
};


/*!
jQuery Waypoints - v1.1
Copyright (c) 2011 Caleb Troughton
Dual licensed under the MIT license and GPL license.
https://github.com/imakewebthings/jquery-waypoints/blob/master/MIT-license.txt
https://github.com/imakewebthings/jquery-waypoints/blob/master/GPL-license.txt
*/

/*
Waypoints is a small jQuery plugin that makes it easy to execute a function
whenever you scroll to an element.

GitHub Repository: https://github.com/imakewebthings/jquery-waypoints
Documentation and Examples: http://imakewebthings.github.com/jquery-waypoints

Changelog:
	v1.1.
		- Moved the continuous option out of global settings and into the options
		  object for individual waypoints.
		- Added the context option, which allows for using waypoints within any
		  scrollable element, not just the window.
	v1.0.2
		- Moved scroll and resize handler bindings out of load.  Should play nicer
		  with async loaders like Head JS and LABjs.
		- Fixed a 1px off error when using certain % offsets.
		- Added unit tests.
	v1.0.1
		- Added $.waypoints('viewportHeight').
		- Fixed iOS bug (using the new viewportHeight method).
		- Added offset function alias: 'bottom-in-view'.
	v1.0
		- Initial release.
	
Support:
	- jQuery versions 1.4+
	- IE6+, FF3+, Chrome 6+, Safari 4+, Opera 11
	- Other versions and browsers may work, these are just the ones I've looked at.
*/

(function($, wp, wps, window, undefined){
	'$:nomunge';
	
	var $w = $(window),
	
	// Keeping common strings as variables = better minification
	eventName = 'waypoint.reached',
	
	/*
	For the waypoint and direction passed in, trigger the waypoint.reached
	event and deal with the triggerOnce option.
	*/
	triggerWaypoint = function(way, dir) {
		way.element.trigger(eventName, dir);
		if (way.options.triggerOnce) {
			way.element[wp]('destroy');
		}
	},
	
	/*
	Given a jQuery element and Context, returns the index of that element in the waypoints
	array.  Returns the index, or -1 if the element is not a waypoint.
	*/
	waypointIndex = function(el, context) {
		var i = context.waypoints.length - 1;
		while (i >= 0 && context.waypoints[i].element[0] !== el[0]) {
			i -= 1;
		}
		return i;
	},
	
	// Private list of all elements used as scrolling contexts for waypoints.
	contexts = [],
	
	/*
	Context Class - represents a scrolling context.  Properties include:
		element: jQuery object containing a single HTML element.
		waypoints: Array of waypoints operating under this scroll context.
		oldScroll: Keeps the previous scroll position to determine scroll direction.
		didScroll: Flag used in scrolling the context's scroll event.
		didResize: Flag used in scrolling the context's resize event.
		doScroll: Function that checks for crossed waypoints. Called from throttler.
	*/
	Context = function(context) {
		$.extend(this, {
			'element': $(context),
			
			/*
			Starting at a ridiculous negative number allows for a 'down' trigger of 0 or
			negative offset waypoints on load. Useful for setting initial states.
			*/
			'oldScroll': -99999,
			
			/*
			List of all elements that have been registered as waypoints.
			Each object in the array contains:
				element: jQuery object containing a single HTML element.
				offset: The window scroll offset, in px, that triggers the waypoint event.
				options: Options object that was passed to the waypoint fn function.
			*/
			'waypoints': [],
			
			didScroll: false,
			didResize: false,
	
			doScroll: $.proxy(function() {
				var newScroll = this.element.scrollTop(),
				
				// Are we scrolling up or down? Used for direction argument in callback.
				isDown = newScroll > this.oldScroll,
				that = this,

				// Get a list of all waypoints that were crossed since last scroll move.
				pointsHit = $.grep(this.waypoints, function(el, i) {
					return isDown ?
						(el.offset > that.oldScroll && el.offset <= newScroll) :
						(el.offset <= that.oldScroll && el.offset > newScroll);
				}),
				len = pointsHit.length;
				
				// iOS adjustment
				if (!this.oldScroll || !newScroll) {
					$[wps]('refresh');
				}

				// Done with scroll comparisons, store new scroll before ejection
				this.oldScroll = newScroll;

				// No waypoints crossed? Eject.
				if (!len) return;

				// If several waypoints triggered, need to do so in reverse order going up
				if (!isDown) pointsHit.reverse();

				/*
				One scroll move may cross several waypoints.  If the waypoint's continuous
				option is true it should fire even if it isn't the last waypoint.  If false,
				it will only fire if it's the last one.
				*/
				$.each(pointsHit, function(i, point) {
					if (point.options.continuous || i === len - 1) {
						triggerWaypoint(point, [isDown ? 'down' : 'up']);
					}
				});
			}, this)
		});
		
		// Setup scroll and resize handlers.  Throttled at the settings-defined rate limits.
		$(context).scroll($.proxy(function() {
			if (!this.didScroll) {
				this.didScroll = true;
				window.setTimeout($.proxy(function() {
					this.doScroll();
					this.didScroll = false;
				}, this), $[wps].settings.scrollThrottle);
			}
		}, this)).resize($.proxy(function() {
			if (!this.didResize) {
				this.didResize = true;
				window.setTimeout($.proxy(function() {
					$[wps]('refresh');
					this.didResize = false;
				}, this), $[wps].settings.resizeThrottle);
			}
		}, this));
		
		$w.load($.proxy(function() {
			/*
			Fire a scroll check, should the page be loaded at a non-zero scroll value,
			as with a fragment id link or a page refresh.
			*/
			this.doScroll();
		}, this));
	},
	
	/* Returns a Context object from the contexts array, given the raw HTML element
	for that context. */
	getContextByElement = function(element) {
		var found = null;
		
		$.each(contexts, function(i, c) {
			if (c.element[0] === element) {
				found = c;
				return false;
			}
		});
		
		return found;
	},
	
	// Methods exposed to the effin' object 
	methods = {
		/*
		jQuery.fn.waypoint([handler], [options])
		
		handler
			function, optional
			A callback function called when the user scrolls past the element.
			The function signature is function(event, direction) where event is
			a standard jQuery Event Object and direction is a string, either 'down'
			or 'up' indicating which direction the user is scrolling.
			
		options
			object, optional
			A map of options to apply to this set of waypoints, including where on
			the browser window the waypoint is triggered. For a full list of
			options and their defaults, see $.fn.waypoint.defaults.
			
		This is how you register an element as a waypoint. When the user scrolls past
		that element it triggers waypoint.reached, a custom event. Since the
		parameters for creating a waypoint are optional, we have a few different
		possible signatures. Let’s look at each of them.

		someElements.waypoint();
			
		Calling .waypoint with no parameters will register the elements as waypoints
		using the default options. The elements will fire the waypoint.reached event,
		but calling it in this way does not bind any handler to the event. You can
		bind to the event yourself, as with any other event, like so:

		someElements.bind('waypoint.reached', function(event, direction) {
		   // make it rain
		});
			
		You will usually want to create a waypoint and immediately bind a function to
		waypoint.reached, and can do so by passing a handler as the first argument to
		.waypoint:

		someElements.waypoint(function(event, direction) {
		   if (direction === 'down') {
		      // do this on the way down
		   }
		   else {
		      // do this on the way back up through the waypoint
		   }
		});
			
		This will still use the default options, which will trigger the waypoint when
		the top of the element hits the top of the window. We can pass .waypoint an
		options object to customize things:

		someElements.waypoint(function(event, direction) {
		   // do something amazing
		}, {
		   offset: '50%'  // middle of the page
		});
			
		You can also pass just an options object.

		someElements.waypoint({
		   offset: 100  // 100px from the top
		});
			
		This behaves like .waypoint(), in that it registers the elements as waypoints
		but binds no event handlers.

		Calling .waypoint on an existing waypoint will extend the previous options.
		If the call includes a handler, it will be bound to waypoint.reached without
		unbinding any other handlers.
		*/
		init: function(f, options) {
			// Register each element as a waypoint, add to array.
			this.each(function() {
				var cElement = $.fn[wp].defaults.context,
				context,
				$this = $(this);

				// Default window context or a specific element?
				if (options && options.context) {
					cElement = options.context;
				}

				// Find the closest element that matches the context
				if (!$.isWindow(cElement)) {
					cElement = $this.closest(cElement)[0];
				}
				context = getContextByElement(cElement);

				// Not a context yet? Create and push.
				if (!context) {
					context = new Context(cElement);
					contexts.push(context);
				}
				
				// Extend default and preexisting options
				var ndx = waypointIndex($this, context),
				base = ndx < 0 ? $.fn[wp].defaults : context.waypoints[ndx].options,
				opts = $.extend({}, base, options);
				
				// Offset aliases
				opts.offset = opts.offset === "bottom-in-view" ?
					function() {
						var cHeight = $.isWindow(cElement) ? $[wps]('viewportHeight')
							: $(cElement).height();
						return cHeight - $(this).outerHeight();
					} : opts.offset;

				// Update, or create new waypoint
				if (ndx < 0) {
					context.waypoints.push({
						'element': $this,
						'offset': $this.offset().top,
						'options': opts
					});
				}
				else {
					context.waypoints[ndx].options = opts;
				}
				
				// Bind the function if it was passed in.
				if (f) {
					$this.bind(eventName, f);
				}
			});
			
			// Need to re-sort+refresh the waypoints array after new elements are added.
			$[wps]('refresh');
			
			return this;
		},
		
		
		/*
		jQuery.fn.waypoint('remove')
		
		Passing the string 'remove' to .waypoint unregisters the elements as waypoints
		and wipes any custom options, but leaves the waypoint.reached events bound.
		Calling .waypoint again in the future would reregister the waypoint and the old
		handlers would continue to work.
		*/
		remove: function() {
			return this.each(function(i, el) {
				var $el = $(el);
				
				$.each(contexts, function(i, c) {
					var ndx = waypointIndex($el, c);

					if (ndx >= 0) {
						c.waypoints.splice(ndx, 1);
					}
				});
			});
		},
		
		/*
		jQuery.fn.waypoint('destroy')
		
		Passing the string 'destroy' to .waypoint will unbind all waypoint.reached
		event handlers on those elements and unregisters them as waypoints.
		*/
		destroy: function() {
			return this.unbind(eventName)[wp]('remove');
		}
	},
	
	/*
	Methods used by the jQuery object extension.
	*/
	jQMethods = {
		
		/*
		jQuery.waypoints('refresh')
		
		This will force a recalculation of each waypoint’s trigger point based on
		its offset option and context. This is called automatically whenever the window
		(or other defined context) is resized, new waypoints are added, or a waypoint’s
		options are modified. If your project is changing the DOM or page layout without
		doing one of these things, you may want to manually call this refresh.
		*/
		refresh: function() {
			$.each(contexts, function(i, c) {
				var isWin = $.isWindow(c.element[0]),
				contextOffset = isWin ? 0 : c.element.offset().top,
				contextHeight = isWin ? $[wps]('viewportHeight') : c.element.height(),
				contextScroll = isWin ? 0 : c.element.scrollTop();
				
				$.each(c.waypoints, function(j, o) {
					// Adjustment is just the offset if it's a px value
					var adjustment = o.options.offset,
					oldOffset = o.offset;
					
					// Set adjustment to the return value if offset is a function.
					if (typeof o.options.offset === "function") {
						adjustment = o.options.offset.apply(o.element);
					}
					// Calculate the adjustment if offset is a percentage.
					else if (typeof o.options.offset === "string") {
						var amount = parseFloat(o.options.offset);
						adjustment = o.options.offset.indexOf("%") ?
							Math.ceil(contextHeight * (amount / 100)) : amount;
					}

					/* 
					Set the element offset to the window scroll offset, less
					all our adjustments.
					*/
					o.offset = o.element.offset().top - contextOffset
						+ contextScroll - adjustment;

					/*
					An element offset change across the current scroll point triggers
					the event, just as if we scrolled past it.
					*/
					if (c.oldScroll > oldOffset && c.oldScroll <= o.offset) {
						triggerWaypoint(o, ['up']);
					}
					else if (c.oldScroll < oldOffset && c.oldScroll >= o.offset) {
						triggerWaypoint(o, ['down']);
					}
				});
				
				// Keep waypoints sorted by offset value.
				c.waypoints.sort(function(a, b) {
					return a.offset - b.offset;
				});
			});
		},
		
		
		/*
		jQuery.waypoints('viewportHeight')
		
		This will return the height of the viewport, adjusting for inconsistencies
		that come with calling $(window).height() in iOS. Recommended for use
		within any offset functions.
		*/
		viewportHeight: function() {
			return (window.innerHeight ? window.innerHeight : $w.height());
		},
		
		
		/*
		jQuery.waypoints()
		
		This will return a jQuery object with a collection of all registered waypoint
		elements.

		$('.post').waypoint();
		$('.ad-unit').waypoint(function(event, direction) {
		   // Passed an ad unit
		});
		console.log($.waypoints());
		
		The example above would log a jQuery object containing all .post and .ad-unit
		elements.
		*/
		aggregate: function() {
			var points = $();
			$.each(contexts, function(i, c) {
				$.each(c.waypoints, function(i, e) {
					points = points.add(e.element);
				});
			});
			return points;
		}
	};

	
	/*
	fn extension.  Delegates to appropriate method.
	*/
	$.fn[wp] = function(method) {
		
		if (methods[method]) {
			return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
		}
		else if (typeof method === "function" || !method) {
			return methods.init.apply(this, arguments);
		}
		else if (typeof method === "object") {
			return methods.init.apply(this, [null, method]);
		}
		else {
			$.error( 'Method ' +  method + ' does not exist on jQuery ' + wp );
		}
	};
	
	
	/*
	The default options object that is extended when calling .waypoint. It has the
	following properties:
	
	context
		string | element | jQuery*
		default: window
		The context defines which scrollable element the waypoint belongs to and acts
		within. The default, window, means the waypoint offset is calculated with relation
		to the whole viewport.  You can set this to another element to use the waypoints
		within that element.  Accepts a selector string, *but if you use jQuery 1.6+ it
		also accepts a raw HTML element or jQuery object.
	
	continuous
		boolean
		default: true
		If true, and multiple waypoints are triggered in one scroll, this waypoint will
		trigger even if it is not the last waypoint reached.  If false, it will only
		trigger if it is the last waypoint.

	offset
		number | string | function
		default: 0
		Determines how far the top of the element must be from the top of the browser
		window to trigger a waypoint. It can be a number, which is taken as a number
		of pixels, a string representing a percentage of the viewport height, or a
		function that will return a number of pixels.
		
	triggerOnce
		boolean
		default: false
		If true, the waypoint will be destroyed when triggered.
	
	An offset of 250 would trigger the waypoint when the top of the element is 250px
	from the top of the viewport. Negative values for any offset work as you might
	expect. A value of -100 would trigger the waypoint when the element is 100px above
	the top of the window.

	offset: '100%'
	
	A string percentage will determine the pixel offset based on the height of the
	window. When resizing the window, this offset will automatically be recalculated
	without needing to call $.waypoints('refresh').

	// The bottom of the element is in view
	offset: function() {
	   return $.waypoints('viewportHeight') - $(this).outerHeight();
	}
	
	Offset can take a function, which must return a number of pixels from the top of
	the window. The this value will always refer to the raw HTML element of the
	waypoint. As with % values, functions are recalculated automatically when the
	window resizes. For more on recalculating offsets, see $.waypoints('refresh').
	
	An offset value of 'bottom-in-view' will act as an alias for the function in the
	example above, as this is a common usage.
	
	offset: 'bottom-in-view'
	
	You can see this alias in use on the Scroll Analytics example page.

	The triggerOnce flag, if true, will destroy the waypoint after the first trigger.
	This is just a shortcut for calling .waypoint('destroy') within the waypoint
	handler. This is useful in situations such as scroll analytics, where you only
	want to record an event once for each page visit.
	
	The context option lets you use Waypoints within an element other than the window.
	You can define the context with a selector string and the waypoint will act within
	the nearest ancestor that matches this selector.
	
	$('.something-scrollable .waypoint').waypoint({
	   context: '.something-scrollable'
	});
	
	You can see this in action on the Dial Controls example.
	*/
	$.fn[wp].defaults = {
		continuous: true,
		offset: 0,
		triggerOnce: false,
		context: window
	};
	
	
	
	
	
	/*
	jQuery object extension. Delegates to appropriate methods above.
	*/
	$[wps] = function(method) {
		if (jQMethods[method]) {
			return jQMethods[method].apply(this);
		}
		else {
			return jQMethods['aggregate']();
		}
	};
	
	
	/*
	$.waypoints.settings
	
	Settings object that determines some of the plugin’s behavior.
		
	resizeThrottle
		number
		default: 200
		For performance reasons, the refresh performed during resizes is
		throttled. This value is the rate-limit in milliseconds between resize
		refreshes. For more information on throttling, check out Ben Alman’s
		throttle / debounce plugin.
		http://benalman.com/projects/jquery-throttle-debounce-plugin/
		
	scrollThrottle
		number
		default: 100
		For performance reasons, checking for any crossed waypoints during a
		scroll event is throttled. This value is the rate-limit in milliseconds
		between scroll checks. For more information on throttling, check out Ben
		Alman’s throttle / debounce plugin.
		http://benalman.com/projects/jquery-throttle-debounce-plugin/
	*/
	$[wps].settings = {
		resizeThrottle: 200,
		scrollThrottle: 100
	};
	
	$w.load(function() {
		// Calculate everything once on load.
		$[wps]('refresh');
	});
})(jQuery, 'waypoint', 'waypoints', this);
/*
 * Metadata - jQuery plugin for parsing metadata from elements
 *
 * Copyright (c) 2006 John Resig, Yehuda Katz, J�örn Zaefferer, Paul McLanahan
 *
 * Dual licensed under the MIT and GPL licenses:
 *   http://www.opensource.org/licenses/mit-license.php
 *   http://www.gnu.org/licenses/gpl.html
 *
 * Revision: $Id: jquery.metadata.js 3640 2007-10-11 18:34:38Z pmclanahan $
 *
 */

/**
 * Sets the type of metadata to use. Metadata is encoded in JSON, and each property
 * in the JSON will become a property of the element itself.
 *
 * There are four supported types of metadata storage:
 *
 *   attr:  Inside an attribute. The name parameter indicates *which* attribute.
 *          
 *   class: Inside the class attribute, wrapped in curly braces: { }
 *   
 *   elem:  Inside a child element (e.g. a script tag). The
 *          name parameter indicates *which* element.
 *   html5: Values are stored in data-* attributes.
 *          
 * The metadata for an element is loaded the first time the element is accessed via jQuery.
 *
 * As a result, you can define the metadata type, use $(expr) to load the metadata into the elements
 * matched by expr, then redefine the metadata type and run another $(expr) for other elements.
 * 
 * @name $.metadata.setType
 *
 * @example <p id="one" class="some_class {item_id: 1, item_label: 'Label'}">This is a p</p>
 * @before $.metadata.setType("class")
 * @after $("#one").metadata().item_id == 1; $("#one").metadata().item_label == "Label"
 * @desc Reads metadata from the class attribute
 * 
 * @example <p id="one" class="some_class" data="{item_id: 1, item_label: 'Label'}">This is a p</p>
 * @before $.metadata.setType("attr", "data")
 * @after $("#one").metadata().item_id == 1; $("#one").metadata().item_label == "Label"
 * @desc Reads metadata from a "data" attribute
 * 
 * @example <p id="one" class="some_class"><script>{item_id: 1, item_label: 'Label'}</script>This is a p</p>
 * @before $.metadata.setType("elem", "script")
 * @after $("#one").metadata().item_id == 1; $("#one").metadata().item_label == "Label"
 * @desc Reads metadata from a nested script element
 * 
 * @example <p id="one" class="some_class" data-item_id="1" data-item_label="Label">This is a p</p>
 * @before $.metadata.setType("html5")
 * @after $("#one").metadata().item_id == 1; $("#one").metadata().item_label == "Label"
 * @desc Reads metadata from a series of data-* attributes
 *
 * @param String type The encoding type
 * @param String name The name of the attribute to be used to get metadata (optional)
 * @cat Plugins/Metadata
 * @descr Sets the type of encoding to be used when loading metadata for the first time
 * @type undefined
 * @see metadata()
 */

(function($) {

$.extend({
  metadata : {
    defaults : {
      type: 'class',
      name: 'metadata',
      cre: /({.*})/,
      single: 'metadata'
    },
    setType: function( type, name ){
      this.defaults.type = type;
      this.defaults.name = name;
    },
    get: function( elem, opts ){
      var settings = $.extend({},this.defaults,opts);
      // check for empty string in single property
      if ( !settings.single.length ) settings.single = 'metadata';
      
      var data = $.data(elem, settings.single);
      // returned cached data if it already exists
      if ( data ) return data;
      
      data = "{}";
      
      var getData = function(data) {
        if(typeof data != "string") return data;
        
        if( data.indexOf('{') < 0 ) {
          data = eval("(" + data + ")");
        }
      }
      
      var getObject = function(data) {
        if(typeof data != "string") return data;
        
        data = eval("(" + data + ")");
        return data;
      }
      
      if ( settings.type == "html5" ) {
        var object = {};
        $( elem.attributes ).each(function() {
          var name = this.nodeName;
          if(name.match(/^data-/)) name = name.replace(/^data-/, '');
          else return true;
          object[name] = getObject(this.nodeValue);
        });
      } else {
        if ( settings.type == "class" ) {
          var m = settings.cre.exec( elem.className );
          if ( m )
            data = m[1];
        } else if ( settings.type == "elem" ) {
          if( !elem.getElementsByTagName ) return;
          var e = elem.getElementsByTagName(settings.name);
          if ( e.length )
            data = $.trim(e[0].innerHTML);
        } else if ( elem.getAttribute != undefined ) {
          var attr = elem.getAttribute( settings.name );
          if ( attr )
            data = attr;
        }
        object = getObject(data.indexOf("{") < 0 ? "{" + data + "}" : data);
      }
      
      $.data( elem, settings.single, object );
      return object;
    }
  }
});

/**
 * Returns the metadata object for the first member of the jQuery object.
 *
 * @name metadata
 * @descr Returns element's metadata object
 * @param Object opts An object contianing settings to override the defaults
 * @type jQuery
 * @cat Plugins/Metadata
 */
$.fn.metadata = function( opts ){
  return $.metadata.get( this[0], opts );
};

})(jQuery);
/*
 * 
 * TableSorter 2.0 - Client-side table sorting with ease!
 * Version 2.0.5b
 * @requires jQuery v1.2.3
 * 
 * Copyright (c) 2007 Christian Bach
 * Examples and docs at: http://tablesorter.com
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 * 
 */
/**
 * 
 * @description Create a sortable table with multi-column sorting capabilitys
 * 
 * @example $('table').tablesorter();
 * @desc Create a simple tablesorter interface.
 * 
 * @example $('table').tablesorter({ sortList:[[0,0],[1,0]] });
 * @desc Create a tablesorter interface and sort on the first and secound column column headers.
 * 
 * @example $('table').tablesorter({ headers: { 0: { sorter: false}, 1: {sorter: false} } });
 *          
 * @desc Create a tablesorter interface and disableing the first and second  column headers.
 *      
 * 
 * @example $('table').tablesorter({ headers: { 0: {sorter:"integer"}, 1: {sorter:"currency"} } });
 * 
 * @desc Create a tablesorter interface and set a column parser for the first
 *       and second column.
 * 
 * 
 * @param Object
 *            settings An object literal containing key/value pairs to provide
 *            optional settings.
 * 
 * 
 * @option String cssHeader (optional) A string of the class name to be appended
 *         to sortable tr elements in the thead of the table. Default value:
 *         "header"
 * 
 * @option String cssAsc (optional) A string of the class name to be appended to
 *         sortable tr elements in the thead on a ascending sort. Default value:
 *         "headerSortUp"
 * 
 * @option String cssDesc (optional) A string of the class name to be appended
 *         to sortable tr elements in the thead on a descending sort. Default
 *         value: "headerSortDown"
 * 
 * @option String sortInitialOrder (optional) A string of the inital sorting
 *         order can be asc or desc. Default value: "asc"
 * 
 * @option String sortMultisortKey (optional) A string of the multi-column sort
 *         key. Default value: "shiftKey"
 * 
 * @option String textExtraction (optional) A string of the text-extraction
 *         method to use. For complex html structures inside td cell set this
 *         option to "complex", on large tables the complex option can be slow.
 *         Default value: "simple"
 * 
 * @option Object headers (optional) An array containing the forces sorting
 *         rules. This option let's you specify a default sorting rule. Default
 *         value: null
 * 
 * @option Array sortList (optional) An array containing the forces sorting
 *         rules. This option let's you specify a default sorting rule. Default
 *         value: null
 * 
 * @option Array sortForce (optional) An array containing forced sorting rules.
 *         This option let's you specify a default sorting rule, which is
 *         prepended to user-selected rules. Default value: null
 * 
 * @option Boolean sortLocaleCompare (optional) Boolean flag indicating whatever
 *         to use String.localeCampare method or not. Default set to true.
 * 
 * 
 * @option Array sortAppend (optional) An array containing forced sorting rules.
 *         This option let's you specify a default sorting rule, which is
 *         appended to user-selected rules. Default value: null
 * 
 * @option Boolean widthFixed (optional) Boolean flag indicating if tablesorter
 *         should apply fixed widths to the table columns. This is usefull when
 *         using the pager companion plugin. This options requires the dimension
 *         jquery plugin. Default value: false
 * 
 * @option Boolean cancelSelection (optional) Boolean flag indicating if
 *         tablesorter should cancel selection of the table headers text.
 *         Default value: true
 * 
 * @option Boolean debug (optional) Boolean flag indicating if tablesorter
 *         should display debuging information usefull for development.
 * 
 * @type jQuery
 * 
 * @name tablesorter
 * 
 * @cat Plugins/Tablesorter
 * 
 * @author Christian Bach/christian.bach@polyester.se
 */

(function ($) {
    $.extend({
        tablesorter: new
        function () {

            var parsers = [],
                widgets = [];

            this.defaults = {
                cssHeader: "header",
                cssAsc: "headerSortUp",
                cssDesc: "headerSortDown",
                cssChildRow: "expand-child",
                sortInitialOrder: "asc",
                sortMultiSortKey: "shiftKey",
                sortForce: null,
                sortAppend: null,
                sortLocaleCompare: true,
                textExtraction: "simple",
                parsers: {}, widgets: [],
                widgetZebra: {
                    css: ["even", "odd"]
                }, headers: {}, widthFixed: false,
                cancelSelection: true,
                sortList: [],
                headerList: [],
                dateFormat: "us",
                decimal: '/\.|\,/g',
                onRenderHeader: null,
                selectorHeaders: 'thead th',
                debug: false
            };

            /* debuging utils */

            function benchmark(s, d) {
                log(s + "," + (new Date().getTime() - d.getTime()) + "ms");
            }

            this.benchmark = benchmark;

            function log(s) {
                if (typeof console != "undefined" && typeof console.debug != "undefined") {
                    console.log(s);
                } else {
                    alert(s);
                }
            }

            /* parsers utils */

            function buildParserCache(table, $headers) {

                if (table.config.debug) {
                    var parsersDebug = "";
                }

                if (table.tBodies.length == 0) return; // In the case of empty tables
                var rows = table.tBodies[0].rows;

                if (rows[0]) {

                    var list = [],
                        cells = rows[0].cells,
                        l = cells.length;

                    for (var i = 0; i < l; i++) {

                        var p = false;

                        if ($.metadata && ($($headers[i]).metadata() && $($headers[i]).metadata().sorter)) {

                            p = getParserById($($headers[i]).metadata().sorter);

                        } else if ((table.config.headers[i] && table.config.headers[i].sorter)) {

                            p = getParserById(table.config.headers[i].sorter);
                        }
                        if (!p) {

                            p = detectParserForColumn(table, rows, -1, i);
                        }

                        if (table.config.debug) {
                            parsersDebug += "column:" + i + " parser:" + p.id + "\n";
                        }

                        list.push(p);
                    }
                }

                if (table.config.debug) {
                    log(parsersDebug);
                }

                return list;
            };

            function detectParserForColumn(table, rows, rowIndex, cellIndex) {
                var l = parsers.length,
                    node = false,
                    nodeValue = false,
                    keepLooking = true;
                while (nodeValue == '' && keepLooking) {
                    rowIndex++;
                    if (rows[rowIndex]) {
                        node = getNodeFromRowAndCellIndex(rows, rowIndex, cellIndex);
                        nodeValue = trimAndGetNodeText(table.config, node);
                        if (table.config.debug) {
                            log('Checking if value was empty on row:' + rowIndex);
                        }
                    } else {
                        keepLooking = false;
                    }
                }
                for (var i = 1; i < l; i++) {
                    if (parsers[i].is(nodeValue, table, node)) {
                        return parsers[i];
                    }
                }
                // 0 is always the generic parser (text)
                return parsers[0];
            }

            function getNodeFromRowAndCellIndex(rows, rowIndex, cellIndex) {
                return rows[rowIndex].cells[cellIndex];
            }

            function trimAndGetNodeText(config, node) {
                return $.trim(getElementText(config, node));
            }

            function getParserById(name) {
                var l = parsers.length;
                for (var i = 0; i < l; i++) {
                    if (parsers[i].id.toLowerCase() == name.toLowerCase()) {
                        return parsers[i];
                    }
                }
                return false;
            }

            /* utils */

            function buildCache(table) {

                if (table.config.debug) {
                    var cacheTime = new Date();
                }

                var totalRows = (table.tBodies[0] && table.tBodies[0].rows.length) || 0,
                    totalCells = (table.tBodies[0].rows[0] && table.tBodies[0].rows[0].cells.length) || 0,
                    parsers = table.config.parsers,
                    cache = {
                        row: [],
                        normalized: []
                    };

                for (var i = 0; i < totalRows; ++i) {

                    /** Add the table data to main data array */
                    var c = $(table.tBodies[0].rows[i]),
                        cols = [];

                    // if this is a child row, add it to the last row's children and
                    // continue to the next row
                    if (c.hasClass(table.config.cssChildRow)) {
                        cache.row[cache.row.length - 1] = cache.row[cache.row.length - 1].add(c);
                        // go to the next for loop
                        continue;
                    }

                    cache.row.push(c);

                    for (var j = 0; j < totalCells; ++j) {
                        cols.push(parsers[j].format(getElementText(table.config, c[0].cells[j]), table, c[0].cells[j]));
                    }

                    cols.push(cache.normalized.length); // add position for rowCache
                    cache.normalized.push(cols);
                    cols = null;
                };

                if (table.config.debug) {
                    benchmark("Building cache for " + totalRows + " rows:", cacheTime);
                }

                return cache;
            };

            function getElementText(config, node) {

                var text = "";

                if (!node) return "";

                if (!config.supportsTextContent) config.supportsTextContent = node.textContent || false;

                if (config.textExtraction == "simple") {
                    if (config.supportsTextContent) {
                        text = node.textContent;
                    } else {
                        if (node.childNodes[0] && node.childNodes[0].hasChildNodes()) {
                            text = node.childNodes[0].innerHTML;
                        } else {
                            text = node.innerHTML;
                        }
                    }
                } else {
                    if (typeof(config.textExtraction) == "function") {
                        text = config.textExtraction(node);
                    } else {
                        text = $(node).text();
                    }
                }
                return text;
            }

            function appendToTable(table, cache) {

                if (table.config.debug) {
                    var appendTime = new Date()
                }

                var c = cache,
                    r = c.row,
                    n = c.normalized,
                    totalRows = n.length,
                    checkCell = (n[0].length - 1),
                    tableBody = $(table.tBodies[0]),
                    rows = [];


                for (var i = 0; i < totalRows; i++) {
                    var pos = n[i][checkCell];

                    rows.push(r[pos]);

                    if (!table.config.appender) {

                        //var o = ;
                        var l = r[pos].length;
                        for (var j = 0; j < l; j++) {
                            tableBody[0].appendChild(r[pos][j]);
                        }

                        // 
                    }
                }



                if (table.config.appender) {

                    table.config.appender(table, rows);
                }

                rows = null;

                if (table.config.debug) {
                    benchmark("Rebuilt table:", appendTime);
                }

                // apply table widgets
                applyWidget(table);

                // trigger sortend
                setTimeout(function () {
                    $(table).trigger("sortEnd");
                }, 0);

            };

            function buildHeaders(table) {

                if (table.config.debug) {
                    var time = new Date();
                }

                var meta = ($.metadata) ? true : false;
                
                var header_index = computeTableHeaderCellIndexes(table);

                $tableHeaders = $(table.config.selectorHeaders, table).each(function (index) {

                    this.column = header_index[this.parentNode.rowIndex + "-" + this.cellIndex];
                    // this.column = index;
                    this.order = formatSortingOrder(table.config.sortInitialOrder);
                    
					
					this.count = this.order;

                    if (checkHeaderMetadata(this) || checkHeaderOptions(table, index)) this.sortDisabled = true;
					if (checkHeaderOptionsSortingLocked(table, index)) this.order = this.lockedOrder = checkHeaderOptionsSortingLocked(table, index);

                    if (!this.sortDisabled) {
                        var $th = $(this).addClass(table.config.cssHeader);
                        if (table.config.onRenderHeader) table.config.onRenderHeader.apply($th);
                    }

                    // add cell to headerList
                    table.config.headerList[index] = this;
                });

                if (table.config.debug) {
                    benchmark("Built headers:", time);
                    log($tableHeaders);
                }

                return $tableHeaders;

            };

            // from:
            // http://www.javascripttoolbox.com/lib/table/examples.php
            // http://www.javascripttoolbox.com/temp/table_cellindex.html


            function computeTableHeaderCellIndexes(t) {
                var matrix = [];
                var lookup = {};
                var thead = t.getElementsByTagName('THEAD')[0];
                var trs = thead.getElementsByTagName('TR');

                for (var i = 0; i < trs.length; i++) {
                    var cells = trs[i].cells;
                    for (var j = 0; j < cells.length; j++) {
                        var c = cells[j];

                        var rowIndex = c.parentNode.rowIndex;
                        var cellId = rowIndex + "-" + c.cellIndex;
                        var rowSpan = c.rowSpan || 1;
                        var colSpan = c.colSpan || 1
                        var firstAvailCol;
                        if (typeof(matrix[rowIndex]) == "undefined") {
                            matrix[rowIndex] = [];
                        }
                        // Find first available column in the first row
                        for (var k = 0; k < matrix[rowIndex].length + 1; k++) {
                            if (typeof(matrix[rowIndex][k]) == "undefined") {
                                firstAvailCol = k;
                                break;
                            }
                        }
                        lookup[cellId] = firstAvailCol;
                        for (var k = rowIndex; k < rowIndex + rowSpan; k++) {
                            if (typeof(matrix[k]) == "undefined") {
                                matrix[k] = [];
                            }
                            var matrixrow = matrix[k];
                            for (var l = firstAvailCol; l < firstAvailCol + colSpan; l++) {
                                matrixrow[l] = "x";
                            }
                        }
                    }
                }
                return lookup;
            }

            function checkCellColSpan(table, rows, row) {
                var arr = [],
                    r = table.tHead.rows,
                    c = r[row].cells;

                for (var i = 0; i < c.length; i++) {
                    var cell = c[i];

                    if (cell.colSpan > 1) {
                        arr = arr.concat(checkCellColSpan(table, headerArr, row++));
                    } else {
                        if (table.tHead.length == 1 || (cell.rowSpan > 1 || !r[row + 1])) {
                            arr.push(cell);
                        }
                        // headerArr[row] = (i+row);
                    }
                }
                return arr;
            };

            function checkHeaderMetadata(cell) {
                if (($.metadata) && ($(cell).metadata().sorter === false)) {
                    return true;
                };
                return false;
            }

            function checkHeaderOptions(table, i) {
                if ((table.config.headers[i]) && (table.config.headers[i].sorter === false)) {
                    return true;
                };
                return false;
            }
			
			 function checkHeaderOptionsSortingLocked(table, i) {
                if ((table.config.headers[i]) && (table.config.headers[i].lockedOrder)) return table.config.headers[i].lockedOrder;
                return false;
            }
			
            function applyWidget(table) {
                var c = table.config.widgets;
                var l = c.length;
                for (var i = 0; i < l; i++) {

                    getWidgetById(c[i]).format(table);
                }

            }

            function getWidgetById(name) {
                var l = widgets.length;
                for (var i = 0; i < l; i++) {
                    if (widgets[i].id.toLowerCase() == name.toLowerCase()) {
                        return widgets[i];
                    }
                }
            };

            function formatSortingOrder(v) {
                if (typeof(v) != "Number") {
                    return (v.toLowerCase() == "desc") ? 1 : 0;
                } else {
                    return (v == 1) ? 1 : 0;
                }
            }

            function isValueInArray(v, a) {
                var l = a.length;
                for (var i = 0; i < l; i++) {
                    if (a[i][0] == v) {
                        return true;
                    }
                }
                return false;
            }

            function setHeadersCss(table, $headers, list, css) {
                // remove all header information
                $headers.removeClass(css[0]).removeClass(css[1]);

                var h = [];
                $headers.each(function (offset) {
                    if (!this.sortDisabled) {
                        h[this.column] = $(this);
                    }
                });

                var l = list.length;
                for (var i = 0; i < l; i++) {
                    h[list[i][0]].addClass(css[list[i][1]]);
                }
            }

            function fixColumnWidth(table, $headers) {
                var c = table.config;
                if (c.widthFixed) {
                    var colgroup = $('<colgroup>');
                    $("tr:first td", table.tBodies[0]).each(function () {
                        colgroup.append($('<col>').css('width', $(this).width()));
                    });
                    $(table).prepend(colgroup);
                };
            }

            function updateHeaderSortCount(table, sortList) {
                var c = table.config,
                    l = sortList.length;
                for (var i = 0; i < l; i++) {
                    var s = sortList[i],
                        o = c.headerList[s[0]];
                    o.count = s[1];
                    o.count++;
                }
            }

            /* sorting methods */

            function multisort(table, sortList, cache) {

                if (table.config.debug) {
                    var sortTime = new Date();
                }

                var dynamicExp = "var sortWrapper = function(a,b) {",
                    l = sortList.length;

                // TODO: inline functions.
                for (var i = 0; i < l; i++) {

                    var c = sortList[i][0];
                    var order = sortList[i][1];
                    // var s = (getCachedSortType(table.config.parsers,c) == "text") ?
                    // ((order == 0) ? "sortText" : "sortTextDesc") : ((order == 0) ?
                    // "sortNumeric" : "sortNumericDesc");
                    // var s = (table.config.parsers[c].type == "text") ? ((order == 0)
                    // ? makeSortText(c) : makeSortTextDesc(c)) : ((order == 0) ?
                    // makeSortNumeric(c) : makeSortNumericDesc(c));
                    var s = (table.config.parsers[c].type == "text") ? ((order == 0) ? makeSortFunction("text", "asc", c) : makeSortFunction("text", "desc", c)) : ((order == 0) ? makeSortFunction("numeric", "asc", c) : makeSortFunction("numeric", "desc", c));
                    var e = "e" + i;

                    dynamicExp += "var " + e + " = " + s; // + "(a[" + c + "],b[" + c
                    // + "]); ";
                    dynamicExp += "if(" + e + ") { return " + e + "; } ";
                    dynamicExp += "else { ";

                }

                // if value is the same keep orignal order
                var orgOrderCol = cache.normalized[0].length - 1;
                dynamicExp += "return a[" + orgOrderCol + "]-b[" + orgOrderCol + "];";

                for (var i = 0; i < l; i++) {
                    dynamicExp += "}; ";
                }

                dynamicExp += "return 0; ";
                dynamicExp += "}; ";

                if (table.config.debug) {
                    benchmark("Evaling expression:" + dynamicExp, new Date());
                }

                eval(dynamicExp);

                cache.normalized.sort(sortWrapper);

                if (table.config.debug) {
                    benchmark("Sorting on " + sortList.toString() + " and dir " + order + " time:", sortTime);
                }

                return cache;
            };

            function makeSortFunction(type, direction, index) {
                var a = "a[" + index + "]",
                    b = "b[" + index + "]";
                if (type == 'text' && direction == 'asc') {
                    return "(" + a + " == " + b + " ? 0 : (" + a + " === null ? Number.POSITIVE_INFINITY : (" + b + " === null ? Number.NEGATIVE_INFINITY : (" + a + " < " + b + ") ? -1 : 1 )));";
                } else if (type == 'text' && direction == 'desc') {
                    return "(" + a + " == " + b + " ? 0 : (" + a + " === null ? Number.POSITIVE_INFINITY : (" + b + " === null ? Number.NEGATIVE_INFINITY : (" + b + " < " + a + ") ? -1 : 1 )));";
                } else if (type == 'numeric' && direction == 'asc') {
                    return "(" + a + " === null && " + b + " === null) ? 0 :(" + a + " === null ? Number.POSITIVE_INFINITY : (" + b + " === null ? Number.NEGATIVE_INFINITY : " + a + " - " + b + "));";
                } else if (type == 'numeric' && direction == 'desc') {
                    return "(" + a + " === null && " + b + " === null) ? 0 :(" + a + " === null ? Number.POSITIVE_INFINITY : (" + b + " === null ? Number.NEGATIVE_INFINITY : " + b + " - " + a + "));";
                }
            };

            function makeSortText(i) {
                return "((a[" + i + "] < b[" + i + "]) ? -1 : ((a[" + i + "] > b[" + i + "]) ? 1 : 0));";
            };

            function makeSortTextDesc(i) {
                return "((b[" + i + "] < a[" + i + "]) ? -1 : ((b[" + i + "] > a[" + i + "]) ? 1 : 0));";
            };

            function makeSortNumeric(i) {
                return "a[" + i + "]-b[" + i + "];";
            };

            function makeSortNumericDesc(i) {
                return "b[" + i + "]-a[" + i + "];";
            };

            function sortText(a, b) {
                if (table.config.sortLocaleCompare) return a.localeCompare(b);
                return ((a < b) ? -1 : ((a > b) ? 1 : 0));
            };

            function sortTextDesc(a, b) {
                if (table.config.sortLocaleCompare) return b.localeCompare(a);
                return ((b < a) ? -1 : ((b > a) ? 1 : 0));
            };

            function sortNumeric(a, b) {
                return a - b;
            };

            function sortNumericDesc(a, b) {
                return b - a;
            };

            function getCachedSortType(parsers, i) {
                return parsers[i].type;
            }; /* public methods */
            this.construct = function (settings) {
                return this.each(function () {
                    // if no thead or tbody quit.
                    if (!this.tHead || !this.tBodies) return;
                    // declare
                    var $this, $document, $headers, cache, config, shiftDown = 0,
                        sortOrder;
                    // new blank config object
                    this.config = {};
                    // merge and extend.
                    config = $.extend(this.config, $.tablesorter.defaults, settings);
                    // store common expression for speed
                    $this = $(this);
                    // save the settings where they read
                    $.data(this, "tablesorter", config);
                    // build headers
                    $headers = buildHeaders(this);
                    // try to auto detect column type, and store in tables config
                    this.config.parsers = buildParserCache(this, $headers);
                    // build the cache for the tbody cells
                    cache = buildCache(this);
                    // get the css class names, could be done else where.
                    var sortCSS = [config.cssDesc, config.cssAsc];
                    // fixate columns if the users supplies the fixedWidth option
                    fixColumnWidth(this);
                    // apply event handling to headers
                    // this is to big, perhaps break it out?
                    $headers.click(

                    function (e) {
                        var totalRows = ($this[0].tBodies[0] && $this[0].tBodies[0].rows.length) || 0;
                        if (!this.sortDisabled && totalRows > 0) {
                            // Only call sortStart if sorting is
                            // enabled.
                            $this.trigger("sortStart");
                            // store exp, for speed
                            var $cell = $(this);
                            // get current column index
                            var i = this.column;
                            // get current column sort order
                            this.order = this.count++ % 2;
							// always sort on the locked order.
							if(this.lockedOrder) this.order = this.lockedOrder;
							
							// user only whants to sort on one
                            // column
                            if (!e[config.sortMultiSortKey]) {
                                // flush the sort list
                                config.sortList = [];
                                if (config.sortForce != null) {
                                    var a = config.sortForce;
                                    for (var j = 0; j < a.length; j++) {
                                        if (a[j][0] != i) {
                                            config.sortList.push(a[j]);
                                        }
                                    }
                                }
                                // add column to sort list
                                config.sortList.push([i, this.order]);
                                // multi column sorting
                            } else {
                                // the user has clicked on an all
                                // ready sortet column.
                                if (isValueInArray(i, config.sortList)) {
                                    // revers the sorting direction
                                    // for all tables.
                                    for (var j = 0; j < config.sortList.length; j++) {
                                        var s = config.sortList[j],
                                            o = config.headerList[s[0]];
                                        if (s[0] == i) {
                                            o.count = s[1];
                                            o.count++;
                                            s[1] = o.count % 2;
                                        }
                                    }
                                } else {
                                    // add column to sort list array
                                    config.sortList.push([i, this.order]);
                                }
                            };
                            setTimeout(function () {
                                // set css for headers
                                setHeadersCss($this[0], $headers, config.sortList, sortCSS);
                                appendToTable(
	                                $this[0], multisort(
	                                $this[0], config.sortList, cache)
								);
                            }, 1);
                            // stop normal event by returning false
                            return false;
                        }
                        // cancel selection
                    }).mousedown(function () {
                        if (config.cancelSelection) {
                            this.onselectstart = function () {
                                return false
                            };
                            return false;
                        }
                    });
                    // apply easy methods that trigger binded events
                    $this.bind("update", function () {
                        var me = this;
                        setTimeout(function () {
                            // rebuild parsers.
                            me.config.parsers = buildParserCache(
                            me, $headers);
                            // rebuild the cache map
                            cache = buildCache(me);
                        }, 1);
                    }).bind("updateCell", function (e, cell) {
                        var config = this.config;
                        // get position from the dom.
                        var pos = [(cell.parentNode.rowIndex - 1), cell.cellIndex];
                        // update cache
                        cache.normalized[pos[0]][pos[1]] = config.parsers[pos[1]].format(
                        getElementText(config, cell), cell);
                    }).bind("sorton", function (e, list) {
                        $(this).trigger("sortStart");
                        config.sortList = list;
                        // update and store the sortlist
                        var sortList = config.sortList;
                        // update header count index
                        updateHeaderSortCount(this, sortList);
                        // set css for headers
                        setHeadersCss(this, $headers, sortList, sortCSS);
                        // sort the table and append it to the dom
                        appendToTable(this, multisort(this, sortList, cache));
                    }).bind("appendCache", function () {
                        appendToTable(this, cache);
                    }).bind("applyWidgetId", function (e, id) {
                        getWidgetById(id).format(this);
                    }).bind("applyWidgets", function () {
                        // apply widgets
                        applyWidget(this);
                    });
                    if ($.metadata && ($(this).metadata() && $(this).metadata().sortlist)) {
                        config.sortList = $(this).metadata().sortlist;
                    }
                    // if user has supplied a sort list to constructor.
                    if (config.sortList.length > 0) {
                        $this.trigger("sorton", [config.sortList]);
                    }
                    // apply widgets
                    applyWidget(this);
                });
            };
            this.addParser = function (parser) {
                var l = parsers.length,
                    a = true;
                for (var i = 0; i < l; i++) {
                    if (parsers[i].id.toLowerCase() == parser.id.toLowerCase()) {
                        a = false;
                    }
                }
                if (a) {
                    parsers.push(parser);
                };
            };
            this.addWidget = function (widget) {
                widgets.push(widget);
            };
            this.formatFloat = function (s) {
                var i = parseFloat(s);
                return (isNaN(i)) ? 0 : i;
            };
            this.formatInt = function (s) {
                var i = parseInt(s);
                return (isNaN(i)) ? 0 : i;
            };
            this.isDigit = function (s, config) {
                // replace all an wanted chars and match.
                return /^[-+]?\d*$/.test($.trim(s.replace(/[,.']/g, '')));
            };
            this.clearTableBody = function (table) {
                if ($.browser.msie) {
                    function empty() {
                        while (this.firstChild)
                        this.removeChild(this.firstChild);
                    }
                    empty.apply(table.tBodies[0]);
                } else {
                    table.tBodies[0].innerHTML = "";
                }
            };
        }
    });

    // extend plugin scope
    $.fn.extend({
        tablesorter: $.tablesorter.construct
    });

    // make shortcut
    var ts = $.tablesorter;

    // add default parsers
    ts.addParser({
        id: "text",
        is: function (s) {
            return true;
        }, format: function (s) {
            return $.trim(s.toLocaleLowerCase());
        }, type: "text"
    });

    ts.addParser({
        id: "digit",
        is: function (s, table) {
            var c = table.config;
            return $.tablesorter.isDigit(s, c);
        }, format: function (s) {
            return $.tablesorter.formatFloat(s);
        }, type: "numeric"
    });

    ts.addParser({
        id: "currency",
        is: function (s) {
            return /^[£$€?.]/.test(s);
        }, format: function (s) {
            return $.tablesorter.formatFloat(s.replace(new RegExp(/[£$€]/g), ""));
        }, type: "numeric"
    });

    ts.addParser({
        id: "ipAddress",
        is: function (s) {
            return /^\d{2,3}[\.]\d{2,3}[\.]\d{2,3}[\.]\d{2,3}$/.test(s);
        }, format: function (s) {
            var a = s.split("."),
                r = "",
                l = a.length;
            for (var i = 0; i < l; i++) {
                var item = a[i];
                if (item.length == 2) {
                    r += "0" + item;
                } else {
                    r += item;
                }
            }
            return $.tablesorter.formatFloat(r);
        }, type: "numeric"
    });

    ts.addParser({
        id: "url",
        is: function (s) {
            return /^(https?|ftp|file):\/\/$/.test(s);
        }, format: function (s) {
            return jQuery.trim(s.replace(new RegExp(/(https?|ftp|file):\/\//), ''));
        }, type: "text"
    });

    ts.addParser({
        id: "isoDate",
        is: function (s) {
            return /^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(s);
        }, format: function (s) {
            return $.tablesorter.formatFloat((s != "") ? new Date(s.replace(
            new RegExp(/-/g), "/")).getTime() : "0");
        }, type: "numeric"
    });

    ts.addParser({
        id: "percent",
        is: function (s) {
            return /\%$/.test($.trim(s));
        }, format: function (s) {
            return $.tablesorter.formatFloat(s.replace(new RegExp(/%/g), ""));
        }, type: "numeric"
    });

    ts.addParser({
        id: "usLongDate",
        is: function (s) {
            return s.match(new RegExp(/^[A-Za-z]{3,10}\.? [0-9]{1,2}, ([0-9]{4}|'?[0-9]{2}) (([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\s(AM|PM)))$/));
        }, format: function (s) {
            return $.tablesorter.formatFloat(new Date(s).getTime());
        }, type: "numeric"
    });

    ts.addParser({
        id: "shortDate",
        is: function (s) {
            return /\d{1,2}[\/\-]\d{1,2}[\/\-]\d{2,4}/.test(s);
        }, format: function (s, table) {
            var c = table.config;
            s = s.replace(/\-/g, "/");
            if (c.dateFormat == "us") {
                // reformat the string in ISO format
                s = s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4})/, "$3/$1/$2");
            } else if (c.dateFormat == "uk") {
                // reformat the string in ISO format
                s = s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4})/, "$3/$2/$1");
            } else if (c.dateFormat == "dd/mm/yy" || c.dateFormat == "dd-mm-yy") {
                s = s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{2})/, "$1/$2/$3");
            }
            return $.tablesorter.formatFloat(new Date(s).getTime());
        }, type: "numeric"
    });
    ts.addParser({
        id: "time",
        is: function (s) {
            return /^(([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\s(am|pm)))$/.test(s);
        }, format: function (s) {
            return $.tablesorter.formatFloat(new Date("2000/01/01 " + s).getTime());
        }, type: "numeric"
    });
    ts.addParser({
        id: "metadata",
        is: function (s) {
            return false;
        }, format: function (s, table, cell) {
            var c = table.config,
                p = (!c.parserMetadataName) ? 'sortValue' : c.parserMetadataName;
            return $(cell).metadata()[p];
        }, type: "numeric"
    });
    // add default widgets
    ts.addWidget({
        id: "zebra",
        format: function (table) {
            if (table.config.debug) {
                var time = new Date();
            }
            var $tr, row = -1,
                odd;
            // loop through the visible rows
            $("tr:visible", table.tBodies[0]).each(function (i) {
                $tr = $(this);
                // style children rows the same way the parent
                // row was styled
                if (!$tr.hasClass(table.config.cssChildRow)) row++;
                odd = (row % 2 == 0);
                $tr.removeClass(
                table.config.widgetZebra.css[odd ? 0 : 1]).addClass(
                table.config.widgetZebra.css[odd ? 1 : 0])
            });
            if (table.config.debug) {
                $.tablesorter.benchmark("Applying Zebra widget", time);
            }
        }
    });
})(jQuery);
/*
 * jQuery columnHover plugin
 * Version: 0.1.1
 *
 * Copyright (c) 2007 Roman Weich
 * http://p.sohei.org
 *
 * Dual licensed under the MIT and GPL licenses 
 * (This means that you can choose the license that best suits your project, and use it accordingly):
 *   http://www.opensource.org/licenses/mit-license.php
 *   http://www.gnu.org/licenses/gpl.html
 *
 * Changelog: 
 * v 0.1.1 - 2007-08-05
 *	-change: included new option "ignoreCols", through which columns can be excluded from the highlighting process
 * v 0.1.0 - 2007-05-25
 */

(function($)
{
	/**
	 * Calculates the actual cellIndex value of all cells in the table and stores it in the realCell property of each cell.
	 * Thats done because the cellIndex value isn't correct when colspans or rowspans are used.
	 * Originally created by Matt Kruse for his table library - Big Thanks! (see http://www.javascripttoolbox.com/)
	 * @param {element} table	The table element.
	 */
	var fixCellIndexes = function(table) 
	{
		var rows = table.rows;
		var len = rows.length;
		var matrix = [];
		for ( var i = 0; i < len; i++ )
		{
			var cells = rows[i].cells;
			var clen = cells.length;
			for ( var j = 0; j < clen; j++ )
			{
				var c = cells[j];
				var rowSpan = c.rowSpan || 1;
				var colSpan = c.colSpan || 1;
				var firstAvailCol = -1;
				if ( !matrix[i] )
				{ 
					matrix[i] = []; 
				}
				var m = matrix[i];
				// Find first available column in the first row
				while ( m[++firstAvailCol] ) {}
				c.realIndex = firstAvailCol;
				for ( var k = i; k < i + rowSpan; k++ )
				{
					if ( !matrix[k] )
					{ 
						matrix[k] = []; 
					}
					var matrixrow = matrix[k];
					for ( var l = firstAvailCol; l < firstAvailCol + colSpan; l++ )
					{
						matrixrow[l] = 1;
					}
				}
			}
		}
	};

	/**
	 * Highlight whole table columns when hovering over a table.
	 * Works on tables with rowspans and colspans.
	 *
	 * @param {map} options			An object for optional settings (options described below).
	 *
	 * @option {string} hoverClass		A CSS class that is set on the cells in the column with the mouse over.
	 *							Default value: 'hover'
	 * @option {boolean} eachCell		Allows highlighting the column while hovering over the table body or table footer. When disabled, highlighting is allowed only through the table header.
	 *							Default value: false
	 * @option {boolean} includeSpans		Includes columns with the colspan attribute set in the hover and highlight process.
	 *							Default value: true
	 * @option {array} ignoreCols		An array of numbers. Each column with the matching column index won't be included in the highlighting process.
	 *							Index starting at 1!
	 *							Default value: [] (empty array)
	 *
	 * @example $('#table').columnHover();
	 * @desc Allow column hovering/highlighting for the table using the default settings.
	 *
	 * @example $('#table').columnHover({eachCell:true, hoverClass:'someclass'});
	 * @desc Allow column hovering/highlighting for the whole table (including the body and footer). Set the class "someclass" to the cells in the column with the mouse over.
	 *
	 * @type jQuery
	 *
	 * @name columnHover
	 * @cat Plugins/columnHover
	 * @author Roman Weich (http://p.sohei.org)
	 */
	$.fn.columnHover = function(options)
	{
		var settings = $.extend({
				hoverClass: 'hover',
				eachCell: false,
				includeSpans : true,
				ignoreCols : []
			}, options);

		/**
		 * Adds or removes the hover style on the column.
		 * @param {element} cell	The cell with the mouseover/mouseout event.
		 * @param {array} colIndex	The index with the stored columns.
		 * @param {boolean} on		Defines whether the style will be set or removed.
		 */
		var hover = function(cell, colIndex, on)
		{
			var a = colIndex[cell.realIndex];
			var i = 0;
			if ( $(settings.ignoreCols).index(cell.realIndex + 1) != -1 )
			{
				return; //dont highlight the columns in the ignoreCols array
			}
			while ( ++i < cell.colSpan )
			{
				a = a.concat(colIndex[cell.realIndex + i]);
			}
			if ( on )
			{
				$(a).addClass(settings.hoverClass);
			}
			else
			{
				$(a).removeClass(settings.hoverClass);
			}
		};

		/**
		 * Adds the hover events to the cell.
		 * @param {jQuery result array} $s	The elements to add the events to.
		 * @param {array} colIndex	The index with the stored columns.
		 */
		var addHover = function($s, colIndex)
		{
			$s.bind('mouseover', function(){
				hover(this, colIndex, true);
			}).bind('mouseout', function(){
				hover(this, colIndex, false);
			});
		};
		
		return this.each(function() 
        {
			var colIndex = [];
			var tbl = this;
			var body, row, c, tboI, rowI, cI, rI, s;

			if ( !tbl.tBodies || !tbl.tBodies.length || !tbl.tHead || !settings.hoverClass.length )
			{
				return;
			}
			fixCellIndexes(tbl);
			//create index - loop through the bodies
			for ( tboI = 0; tboI < tbl.tBodies.length; tboI++ )
			{
				body = tbl.tBodies[tboI];
				//loop through the rows
				for ( rowI = 0; rowI < body.rows.length; rowI++ )
				{
					row = body.rows[rowI];
					//each cell
					for ( cI = 0; cI < row.cells.length; cI++ )
					{
						c = row.cells[cI];
						//ignore cells with colspan?
						if ( !settings.includeSpans && c.colSpan > 1 )
						{
							continue;
						}
						s = (settings.includeSpans) ? c.colSpan : 1;
						while ( --s >= 0 )
						{
							rI = c.realIndex + s;
							if ( !colIndex[rI] )
							{
								colIndex[rI] = [];
							}
							colIndex[rI].push(c);
						}
						//add hover event?
						if ( settings.eachCell )
						{
							addHover($(c), colIndex);
						}
					}
				}
			}
			//events
			addHover($('td, th', tbl.tHead), colIndex);
			//add hover event to footer?
			if ( settings.eachCell && tbl.tFoot )
			{
				addHover($('td, th', tbl.tFoot), colIndex);
			}
		});
	};
})(jQuery); 

/*
 * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
 *
 * Uses the built in easing capabilities added In jQuery 1.1
 * to offer multiple easing options
 *
 * TERMS OF USE - jQuery Easing
 * 
 * Open source under the BSD License. 
 * 
 * Copyright © 2008 George McGinley Smith
 * All rights reserved.
 * 
 * Redistribution and use in source and binary forms, with or without modification, 
 * are permitted provided that the following conditions are met:
 * 
 * Redistributions of source code must retain the above copyright notice, this list of 
 * conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright notice, this list 
 * of conditions and the following disclaimer in the documentation and/or other materials 
 * provided with the distribution.
 * 
 * Neither the name of the author nor the names of contributors may be used to endorse 
 * or promote products derived from this software without specific prior written permission.
 * 
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
 *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 *  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
 *  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 
 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 
 * OF THE POSSIBILITY OF SUCH DAMAGE. 
 *
*/

// t: current time, b: begInnIng value, c: change In value, d: duration
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('h.i[\'1a\']=h.i[\'z\'];h.O(h.i,{y:\'D\',z:9(x,t,b,c,d){6 h.i[h.i.y](x,t,b,c,d)},17:9(x,t,b,c,d){6 c*(t/=d)*t+b},D:9(x,t,b,c,d){6-c*(t/=d)*(t-2)+b},13:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t+b;6-c/2*((--t)*(t-2)-1)+b},X:9(x,t,b,c,d){6 c*(t/=d)*t*t+b},U:9(x,t,b,c,d){6 c*((t=t/d-1)*t*t+1)+b},R:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t*t+b;6 c/2*((t-=2)*t*t+2)+b},N:9(x,t,b,c,d){6 c*(t/=d)*t*t*t+b},M:9(x,t,b,c,d){6-c*((t=t/d-1)*t*t*t-1)+b},L:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t*t*t+b;6-c/2*((t-=2)*t*t*t-2)+b},K:9(x,t,b,c,d){6 c*(t/=d)*t*t*t*t+b},J:9(x,t,b,c,d){6 c*((t=t/d-1)*t*t*t*t+1)+b},I:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t*t*t*t+b;6 c/2*((t-=2)*t*t*t*t+2)+b},G:9(x,t,b,c,d){6-c*8.C(t/d*(8.g/2))+c+b},15:9(x,t,b,c,d){6 c*8.n(t/d*(8.g/2))+b},12:9(x,t,b,c,d){6-c/2*(8.C(8.g*t/d)-1)+b},Z:9(x,t,b,c,d){6(t==0)?b:c*8.j(2,10*(t/d-1))+b},Y:9(x,t,b,c,d){6(t==d)?b+c:c*(-8.j(2,-10*t/d)+1)+b},W:9(x,t,b,c,d){e(t==0)6 b;e(t==d)6 b+c;e((t/=d/2)<1)6 c/2*8.j(2,10*(t-1))+b;6 c/2*(-8.j(2,-10*--t)+2)+b},V:9(x,t,b,c,d){6-c*(8.o(1-(t/=d)*t)-1)+b},S:9(x,t,b,c,d){6 c*8.o(1-(t=t/d-1)*t)+b},Q:9(x,t,b,c,d){e((t/=d/2)<1)6-c/2*(8.o(1-t*t)-1)+b;6 c/2*(8.o(1-(t-=2)*t)+1)+b},P:9(x,t,b,c,d){f s=1.l;f p=0;f a=c;e(t==0)6 b;e((t/=d)==1)6 b+c;e(!p)p=d*.3;e(a<8.w(c)){a=c;f s=p/4}m f s=p/(2*8.g)*8.r(c/a);6-(a*8.j(2,10*(t-=1))*8.n((t*d-s)*(2*8.g)/p))+b},H:9(x,t,b,c,d){f s=1.l;f p=0;f a=c;e(t==0)6 b;e((t/=d)==1)6 b+c;e(!p)p=d*.3;e(a<8.w(c)){a=c;f s=p/4}m f s=p/(2*8.g)*8.r(c/a);6 a*8.j(2,-10*t)*8.n((t*d-s)*(2*8.g)/p)+c+b},T:9(x,t,b,c,d){f s=1.l;f p=0;f a=c;e(t==0)6 b;e((t/=d/2)==2)6 b+c;e(!p)p=d*(.3*1.5);e(a<8.w(c)){a=c;f s=p/4}m f s=p/(2*8.g)*8.r(c/a);e(t<1)6-.5*(a*8.j(2,10*(t-=1))*8.n((t*d-s)*(2*8.g)/p))+b;6 a*8.j(2,-10*(t-=1))*8.n((t*d-s)*(2*8.g)/p)*.5+c+b},F:9(x,t,b,c,d,s){e(s==u)s=1.l;6 c*(t/=d)*t*((s+1)*t-s)+b},E:9(x,t,b,c,d,s){e(s==u)s=1.l;6 c*((t=t/d-1)*t*((s+1)*t+s)+1)+b},16:9(x,t,b,c,d,s){e(s==u)s=1.l;e((t/=d/2)<1)6 c/2*(t*t*(((s*=(1.B))+1)*t-s))+b;6 c/2*((t-=2)*t*(((s*=(1.B))+1)*t+s)+2)+b},A:9(x,t,b,c,d){6 c-h.i.v(x,d-t,0,c,d)+b},v:9(x,t,b,c,d){e((t/=d)<(1/2.k)){6 c*(7.q*t*t)+b}m e(t<(2/2.k)){6 c*(7.q*(t-=(1.5/2.k))*t+.k)+b}m e(t<(2.5/2.k)){6 c*(7.q*(t-=(2.14/2.k))*t+.11)+b}m{6 c*(7.q*(t-=(2.18/2.k))*t+.19)+b}},1b:9(x,t,b,c,d){e(t<d/2)6 h.i.A(x,t*2,0,c,d)*.5+b;6 h.i.v(x,t*2-d,0,c,d)*.5+c*.5+b}});',62,74,'||||||return||Math|function|||||if|var|PI|jQuery|easing|pow|75|70158|else|sin|sqrt||5625|asin|||undefined|easeOutBounce|abs||def|swing|easeInBounce|525|cos|easeOutQuad|easeOutBack|easeInBack|easeInSine|easeOutElastic|easeInOutQuint|easeOutQuint|easeInQuint|easeInOutQuart|easeOutQuart|easeInQuart|extend|easeInElastic|easeInOutCirc|easeInOutCubic|easeOutCirc|easeInOutElastic|easeOutCubic|easeInCirc|easeInOutExpo|easeInCubic|easeOutExpo|easeInExpo||9375|easeInOutSine|easeInOutQuad|25|easeOutSine|easeInOutBack|easeInQuad|625|984375|jswing|easeInOutBounce'.split('|'),0,{}))

/*
 *
 * TERMS OF USE - EASING EQUATIONS
 * 
 * Open source under the BSD License. 
 * 
 * Copyright © 2001 Robert Penner
 * All rights reserved.
 * 
 * Redistribution and use in source and binary forms, with or without modification, 
 * are permitted provided that the following conditions are met:
 * 
 * Redistributions of source code must retain the above copyright notice, this list of 
 * conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright notice, this list 
 * of conditions and the following disclaimer in the documentation and/or other materials 
 * provided with the distribution.
 * 
 * Neither the name of the author nor the names of contributors may be used to endorse 
 * or promote products derived from this software without specific prior written permission.
 * 
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
 *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 *  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
 *  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 
 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 
 * OF THE POSSIBILITY OF SUCH DAMAGE. 
 *
 */

/*
 * FancyBox - jQuery Plugin
 * Simple and fancy lightbox alternative
 *
 * Examples and documentation at: http://fancybox.net
 *
 * Copyright (c) 2008 - 2010 Janis Skarnelis
 * That said, it is hardly a one-person project. Many people have submitted bugs, code, and offered their advice freely. Their support is greatly appreciated.
 *
 * Version: 1.3.4 (11/11/2010)
 * Requires: jQuery v1.3+
 *
 * Dual licensed under the MIT and GPL licenses:
 *   http://www.opensource.org/licenses/mit-license.php
 *   http://www.gnu.org/licenses/gpl.html
 */

;(function($) {
	var tmp, loading, overlay, wrap, outer, content, close, title, nav_left, nav_right,

		selectedIndex = 0, selectedOpts = {}, selectedArray = [], currentIndex = 0, currentOpts = {}, currentArray = [],

		ajaxLoader = null, imgPreloader = new Image(), imgRegExp = /\.(jpg|gif|png|bmp|jpeg)(.*)?$/i, swfRegExp = /[^\.]\.(swf)\s*$/i,

		loadingTimer, loadingFrame = 1,

		titleHeight = 0, titleStr = '', start_pos, final_pos, busy = false, fx = $.extend($('<div/>')[0], { prop: 0 }),

		isIE6 = $.browser.msie && $.browser.version < 7 && !window.XMLHttpRequest,

		/*
		 * Private methods 
		 */

		_abort = function() {
			loading.hide();

			imgPreloader.onerror = imgPreloader.onload = null;

			if (ajaxLoader) {
				ajaxLoader.abort();
			}

			tmp.empty();
		},

		_error = function() {
			if (false === selectedOpts.onError(selectedArray, selectedIndex, selectedOpts)) {
				loading.hide();
				busy = false;
				return;
			}

			selectedOpts.titleShow = false;

			selectedOpts.width = 'auto';
			selectedOpts.height = 'auto';

			tmp.html( '<p id="fancybox-error">The requested content cannot be loaded.<br />Please try again later.</p>' );

			_process_inline();
		},

		_start = function() {
			var obj = selectedArray[ selectedIndex ],
				href, 
				type, 
				title,
				str,
				emb,
				ret;

			_abort();

			selectedOpts = $.extend({}, $.fn.fancybox.defaults, (typeof $(obj).data('fancybox') == 'undefined' ? selectedOpts : $(obj).data('fancybox')));

			ret = selectedOpts.onStart(selectedArray, selectedIndex, selectedOpts);

			if (ret === false) {
				busy = false;
				return;
			} else if (typeof ret == 'object') {
				selectedOpts = $.extend(selectedOpts, ret);
			}

			title = selectedOpts.title || (obj.nodeName ? $(obj).attr('title') : obj.title) || '';

			if (obj.nodeName && !selectedOpts.orig) {
				selectedOpts.orig = $(obj).children("img:first").length ? $(obj).children("img:first") : $(obj);
			}

			if (title === '' && selectedOpts.orig && selectedOpts.titleFromAlt) {
				title = selectedOpts.orig.attr('alt');
			}

			href = selectedOpts.href || (obj.nodeName ? $(obj).attr('href') : obj.href) || null;

			if ((/^(?:javascript)/i).test(href) || href == '#') {
				href = null;
			}

			if (selectedOpts.type) {
				type = selectedOpts.type;

				if (!href) {
					href = selectedOpts.content;
				}

			} else if (selectedOpts.content) {
				type = 'html';

			} else if (href) {
				if (href.match(imgRegExp)) {
					type = 'image';

				} else if (href.match(swfRegExp)) {
					type = 'swf';

				} else if ($(obj).hasClass("iframe")) {
					type = 'iframe';

				} else if (href.indexOf("#") === 0) {
					type = 'inline';

				} else {
					type = 'ajax';
				}
			}

			if (!type) {
				_error();
				return;
			}

			if (type == 'inline') {
				obj	= href.substr(href.indexOf("#"));
				type = $(obj).length > 0 ? 'inline' : 'ajax';
			}

			selectedOpts.type = type;
			selectedOpts.href = href;
			selectedOpts.title = title;

			if (selectedOpts.autoDimensions) {
				if (selectedOpts.type == 'html' || selectedOpts.type == 'inline' || selectedOpts.type == 'ajax') {
					selectedOpts.width = 'auto';
					selectedOpts.height = 'auto';
				} else {
					selectedOpts.autoDimensions = false;	
				}
			}

			if (selectedOpts.modal) {
				selectedOpts.overlayShow = true;
				selectedOpts.hideOnOverlayClick = false;
				selectedOpts.hideOnContentClick = false;
				selectedOpts.enableEscapeButton = false;
				selectedOpts.showCloseButton = false;
			}

			selectedOpts.padding = parseInt(selectedOpts.padding, 10);
			selectedOpts.margin = parseInt(selectedOpts.margin, 10);

			tmp.css('padding', (selectedOpts.padding + selectedOpts.margin));

			$('.fancybox-inline-tmp').unbind('fancybox-cancel').bind('fancybox-change', function() {
				$(this).replaceWith(content.children());				
			});

			switch (type) {
				case 'html' :
					tmp.html( selectedOpts.content );
					_process_inline();
				break;

				case 'inline' :
					if ( $(obj).parent().is('#fancybox-content') === true) {
						busy = false;
						return;
					}

					$('<div class="fancybox-inline-tmp" />')
						.hide()
						.insertBefore( $(obj) )
						.bind('fancybox-cleanup', function() {
							$(this).replaceWith(content.children());
						}).bind('fancybox-cancel', function() {
							$(this).replaceWith(tmp.children());
						});

					$(obj).appendTo(tmp);

					_process_inline();
				break;

				case 'image':
					busy = false;

					$.fancybox.showActivity();

					imgPreloader = new Image();

					imgPreloader.onerror = function() {
						_error();
					};

					imgPreloader.onload = function() {
						busy = true;

						imgPreloader.onerror = imgPreloader.onload = null;

						_process_image();
					};

					imgPreloader.src = href;
				break;

				case 'swf':
					selectedOpts.scrolling = 'no';

					str = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="' + selectedOpts.width + '" height="' + selectedOpts.height + '"><param name="movie" value="' + href + '"></param>';
					emb = '';

					$.each(selectedOpts.swf, function(name, val) {
						str += '<param name="' + name + '" value="' + val + '"></param>';
						emb += ' ' + name + '="' + val + '"';
					});

					str += '<embed src="' + href + '" type="application/x-shockwave-flash" width="' + selectedOpts.width + '" height="' + selectedOpts.height + '"' + emb + '></embed></object>';

					tmp.html(str);

					_process_inline();
				break;

				case 'ajax':
					busy = false;

					$.fancybox.showActivity();

					selectedOpts.ajax.win = selectedOpts.ajax.success;

					ajaxLoader = $.ajax($.extend({}, selectedOpts.ajax, {
						url	: href,
						data : selectedOpts.ajax.data || {},
						error : function(XMLHttpRequest, textStatus, errorThrown) {
							if ( XMLHttpRequest.status > 0 ) {
								_error();
							}
						},
						success : function(data, textStatus, XMLHttpRequest) {
							var o = typeof XMLHttpRequest == 'object' ? XMLHttpRequest : ajaxLoader;
							if (o.status == 200) {
								if ( typeof selectedOpts.ajax.win == 'function' ) {
									ret = selectedOpts.ajax.win(href, data, textStatus, XMLHttpRequest);

									if (ret === false) {
										loading.hide();
										return;
									} else if (typeof ret == 'string' || typeof ret == 'object') {
										data = ret;
									}
								}

								tmp.html( data );
								_process_inline();
							}
						}
					}));

				break;

				case 'iframe':
					_show();
				break;
			}
		},

		_process_inline = function() {
			var
				w = selectedOpts.width,
				h = selectedOpts.height;

			if (w.toString().indexOf('%') > -1) {
				w = parseInt( ($(window).width() - (selectedOpts.margin * 2)) * parseFloat(w) / 100, 10) + 'px';

			} else {
				w = w == 'auto' ? 'auto' : w + 'px';	
			}

			if (h.toString().indexOf('%') > -1) {
				h = parseInt( ($(window).height() - (selectedOpts.margin * 2)) * parseFloat(h) / 100, 10) + 'px';

			} else {
				h = h == 'auto' ? 'auto' : h + 'px';	
			}

			tmp.wrapInner('<div style="width:' + w + ';height:' + h + ';overflow: ' + (selectedOpts.scrolling == 'auto' ? 'auto' : (selectedOpts.scrolling == 'yes' ? 'scroll' : 'hidden')) + ';position:relative;"></div>');

			selectedOpts.width = tmp.width();
			selectedOpts.height = tmp.height();

			_show();
		},

		_process_image = function() {
			selectedOpts.width = imgPreloader.width;
			selectedOpts.height = imgPreloader.height;

			$("<img />").attr({
				'id' : 'fancybox-img',
				'src' : imgPreloader.src,
				'alt' : selectedOpts.title
			}).appendTo( tmp );

			_show();
		},

		_show = function() {
			var pos, equal;

			loading.hide();

			if (wrap.is(":visible") && false === currentOpts.onCleanup(currentArray, currentIndex, currentOpts)) {
				$.event.trigger('fancybox-cancel');

				busy = false;
				return;
			}

			busy = true;

			$(content.add( overlay )).unbind();

			$(window).unbind("resize.fb scroll.fb");
			$(document).unbind('keydown.fb');

			if (wrap.is(":visible") && currentOpts.titlePosition !== 'outside') {
				wrap.css('height', wrap.height());
			}

			currentArray = selectedArray;
			currentIndex = selectedIndex;
			currentOpts = selectedOpts;

			if (currentOpts.overlayShow) {
				overlay.css({
					'background-color' : currentOpts.overlayColor,
					'opacity' : currentOpts.overlayOpacity,
					'cursor' : currentOpts.hideOnOverlayClick ? 'pointer' : 'auto',
					'height' : $(document).height()
				});

				if (!overlay.is(':visible')) {
					if (isIE6) {
						$('select:not(#fancybox-tmp select)').filter(function() {
							return this.style.visibility !== 'hidden';
						}).css({'visibility' : 'hidden'}).one('fancybox-cleanup', function() {
							this.style.visibility = 'inherit';
						});
					}

					overlay.show();
				}
			} else {
				overlay.hide();
			}

			final_pos = _get_zoom_to();

			_process_title();

			if (wrap.is(":visible")) {
				$( close.add( nav_left ).add( nav_right ) ).hide();

				pos = wrap.position(),

				start_pos = {
					top	 : pos.top,
					left : pos.left,
					width : wrap.width(),
					height : wrap.height()
				};

				equal = (start_pos.width == final_pos.width && start_pos.height == final_pos.height);

				content.fadeTo(currentOpts.changeFade, 0.3, function() {
					var finish_resizing = function() {
						content.html( tmp.contents() ).fadeTo(currentOpts.changeFade, 1, _finish);
					};

					$.event.trigger('fancybox-change');

					content
						.empty()
						.removeAttr('filter')
						.css({
							'border-width' : currentOpts.padding,
							'width'	: final_pos.width - currentOpts.padding * 2,
							'height' : selectedOpts.autoDimensions ? 'auto' : final_pos.height - titleHeight - currentOpts.padding * 2
						});

					if (equal) {
						finish_resizing();

					} else {
						fx.prop = 0;

						$(fx).animate({prop: 1}, {
							 duration : currentOpts.changeSpeed,
							 easing : currentOpts.easingChange,
							 step : _draw,
							 complete : finish_resizing
						});
					}
				});

				return;
			}

			wrap.removeAttr("style");

			content.css('border-width', currentOpts.padding);

			if (currentOpts.transitionIn == 'elastic') {
				start_pos = _get_zoom_from();

				content.html( tmp.contents() );

				wrap.show();

				if (currentOpts.opacity) {
					final_pos.opacity = 0;
				}

				fx.prop = 0;

				$(fx).animate({prop: 1}, {
					 duration : currentOpts.speedIn,
					 easing : currentOpts.easingIn,
					 step : _draw,
					 complete : _finish
				});

				return;
			}

			if (currentOpts.titlePosition == 'inside' && titleHeight > 0) {	
				title.show();	
			}

			content
				.css({
					'width' : final_pos.width - currentOpts.padding * 2,
					'height' : selectedOpts.autoDimensions ? 'auto' : final_pos.height - titleHeight - currentOpts.padding * 2
				})
				.html( tmp.contents() );

			wrap
				.css(final_pos)
				.fadeIn( currentOpts.transitionIn == 'none' ? 0 : currentOpts.speedIn, _finish );
		},

		_format_title = function(title) {
			if (title && title.length) {
				if (currentOpts.titlePosition == 'float') {
					return '<table id="fancybox-title-float-wrap" cellpadding="0" cellspacing="0"><tr><td id="fancybox-title-float-left"></td><td id="fancybox-title-float-main">' + title + '</td><td id="fancybox-title-float-right"></td></tr></table>';
				}

				return '<div id="fancybox-title-' + currentOpts.titlePosition + '">' + title + '</div>';
			}

			return false;
		},

		_process_title = function() {
			titleStr = currentOpts.title || '';
			titleHeight = 0;

			title
				.empty()
				.removeAttr('style')
				.removeClass();

			if (currentOpts.titleShow === false) {
				title.hide();
				return;
			}

			titleStr = $.isFunction(currentOpts.titleFormat) ? currentOpts.titleFormat(titleStr, currentArray, currentIndex, currentOpts) : _format_title(titleStr);

			if (!titleStr || titleStr === '') {
				title.hide();
				return;
			}

			title
				.addClass('fancybox-title-' + currentOpts.titlePosition)
				.html( titleStr )
				.appendTo( 'body' )
				.show();

			switch (currentOpts.titlePosition) {
				case 'inside':
					title
						.css({
							'width' : final_pos.width - (currentOpts.padding * 2),
							'marginLeft' : currentOpts.padding,
							'marginRight' : currentOpts.padding
						});

					titleHeight = title.outerHeight(true);

					title.appendTo( outer );

					final_pos.height += titleHeight;
				break;

				case 'over':
					title
						.css({
							'marginLeft' : currentOpts.padding,
							'width'	: final_pos.width - (currentOpts.padding * 2),
							'bottom' : currentOpts.padding
						})
						.appendTo( outer );
				break;

				case 'float':
					title
						.css('left', parseInt((title.width() - final_pos.width - 40)/ 2, 10) * -1)
						.appendTo( wrap );
				break;

				default:
					title
						.css({
							'width' : final_pos.width - (currentOpts.padding * 2),
							'paddingLeft' : currentOpts.padding,
							'paddingRight' : currentOpts.padding
						})
						.appendTo( wrap );
				break;
			}

			title.hide();
		},

		_set_navigation = function() {
			if (currentOpts.enableEscapeButton || currentOpts.enableKeyboardNav) {
				$(document).bind('keydown.fb', function(e) {
					if (e.keyCode == 27 && currentOpts.enableEscapeButton) {
						e.preventDefault();
						$.fancybox.close();

					} else if ((e.keyCode == 37 || e.keyCode == 39) && currentOpts.enableKeyboardNav && e.target.tagName !== 'INPUT' && e.target.tagName !== 'TEXTAREA' && e.target.tagName !== 'SELECT') {
						e.preventDefault();
						$.fancybox[ e.keyCode == 37 ? 'prev' : 'next']();
					}
				});
			}

			if (!currentOpts.showNavArrows) { 
				nav_left.hide();
				nav_right.hide();
				return;
			}

			if ((currentOpts.cyclic && currentArray.length > 1) || currentIndex !== 0) {
				nav_left.show();
			}

			if ((currentOpts.cyclic && currentArray.length > 1) || currentIndex != (currentArray.length -1)) {
				nav_right.show();
			}
		},

		_finish = function () {
			if (!$.support.opacity) {
				content.get(0).style.removeAttribute('filter');
				wrap.get(0).style.removeAttribute('filter');
			}

			if (selectedOpts.autoDimensions) {
				content.css('height', 'auto');
			}

			wrap.css('height', 'auto');

			if (titleStr && titleStr.length) {
				title.show();
			}

			if (currentOpts.showCloseButton) {
				close.show();
			}

			_set_navigation();
	
			if (currentOpts.hideOnContentClick)	{
				content.bind('click', $.fancybox.close);
			}

			if (currentOpts.hideOnOverlayClick)	{
				overlay.bind('click', $.fancybox.close);
			}

			$(window).bind("resize.fb", $.fancybox.resize);

			if (currentOpts.centerOnScroll) {
				$(window).bind("scroll.fb", $.fancybox.center);
			}

			if (currentOpts.type == 'iframe') {
				$('<iframe id="fancybox-frame" name="fancybox-frame' + new Date().getTime() + '" frameborder="0" hspace="0" ' + ($.browser.msie ? 'allowtransparency="true""' : '') + ' scrolling="' + selectedOpts.scrolling + '" src="' + currentOpts.href + '"></iframe>').appendTo(content);
			}

			wrap.show();

			busy = false;

			$.fancybox.center();

			currentOpts.onComplete(currentArray, currentIndex, currentOpts);

			_preload_images();
		},

		_preload_images = function() {
			var href, 
				objNext;

			if ((currentArray.length -1) > currentIndex) {
				href = currentArray[ currentIndex + 1 ].href;

				if (typeof href !== 'undefined' && href.match(imgRegExp)) {
					objNext = new Image();
					objNext.src = href;
				}
			}

			if (currentIndex > 0) {
				href = currentArray[ currentIndex - 1 ].href;

				if (typeof href !== 'undefined' && href.match(imgRegExp)) {
					objNext = new Image();
					objNext.src = href;
				}
			}
		},

		_draw = function(pos) {
			var dim = {
				width : parseInt(start_pos.width + (final_pos.width - start_pos.width) * pos, 10),
				height : parseInt(start_pos.height + (final_pos.height - start_pos.height) * pos, 10),

				top : parseInt(start_pos.top + (final_pos.top - start_pos.top) * pos, 10),
				left : parseInt(start_pos.left + (final_pos.left - start_pos.left) * pos, 10)
			};

			if (typeof final_pos.opacity !== 'undefined') {
				dim.opacity = pos < 0.5 ? 0.5 : pos;
			}

			wrap.css(dim);

			content.css({
				'width' : dim.width - currentOpts.padding * 2,
				'height' : dim.height - (titleHeight * pos) - currentOpts.padding * 2
			});
		},

		_get_viewport = function() {
			return [
				$(window).width() - (currentOpts.margin * 2),
				$(window).height() - (currentOpts.margin * 2),
				$(document).scrollLeft() + currentOpts.margin,
				$(document).scrollTop() + currentOpts.margin
			];
		},

		_get_zoom_to = function () {
			var view = _get_viewport(),
				to = {},
				resize = currentOpts.autoScale,
				double_padding = currentOpts.padding * 2,
				ratio;

			if (currentOpts.width.toString().indexOf('%') > -1) {
				to.width = parseInt((view[0] * parseFloat(currentOpts.width)) / 100, 10);
			} else {
				to.width = currentOpts.width + double_padding;
			}

			if (currentOpts.height.toString().indexOf('%') > -1) {
				to.height = parseInt((view[1] * parseFloat(currentOpts.height)) / 100, 10);
			} else {
				to.height = currentOpts.height + double_padding;
			}

			if (resize && (to.width > view[0] || to.height > view[1])) {
				if (selectedOpts.type == 'image' || selectedOpts.type == 'swf') {
					ratio = (currentOpts.width ) / (currentOpts.height );

					if ((to.width ) > view[0]) {
						to.width = view[0];
						to.height = parseInt(((to.width - double_padding) / ratio) + double_padding, 10);
					}

					if ((to.height) > view[1]) {
						to.height = view[1];
						to.width = parseInt(((to.height - double_padding) * ratio) + double_padding, 10);
					}

				} else {
					to.width = Math.min(to.width, view[0]);
					to.height = Math.min(to.height, view[1]);
				}
			}

			to.top = parseInt(Math.max(view[3] - 20, view[3] + ((view[1] - to.height - 40) * 0.5)), 10);
			to.left = parseInt(Math.max(view[2] - 20, view[2] + ((view[0] - to.width - 40) * 0.5)), 10);

			return to;
		},

		_get_obj_pos = function(obj) {
			var pos = obj.offset();

			pos.top += parseInt( obj.css('paddingTop'), 10 ) || 0;
			pos.left += parseInt( obj.css('paddingLeft'), 10 ) || 0;

			pos.top += parseInt( obj.css('border-top-width'), 10 ) || 0;
			pos.left += parseInt( obj.css('border-left-width'), 10 ) || 0;

			pos.width = obj.width();
			pos.height = obj.height();

			return pos;
		},

		_get_zoom_from = function() {
			var orig = selectedOpts.orig ? $(selectedOpts.orig) : false,
				from = {},
				pos,
				view;

			if (orig && orig.length) {
				pos = _get_obj_pos(orig);

				from = {
					width : pos.width + (currentOpts.padding * 2),
					height : pos.height + (currentOpts.padding * 2),
					top	: pos.top - currentOpts.padding - 20,
					left : pos.left - currentOpts.padding - 20
				};

			} else {
				view = _get_viewport();

				from = {
					width : currentOpts.padding * 2,
					height : currentOpts.padding * 2,
					top	: parseInt(view[3] + view[1] * 0.5, 10),
					left : parseInt(view[2] + view[0] * 0.5, 10)
				};
			}

			return from;
		},

		_animate_loading = function() {
			if (!loading.is(':visible')){
				clearInterval(loadingTimer);
				return;
			}

			$('div', loading).css('top', (loadingFrame * -40) + 'px');

			loadingFrame = (loadingFrame + 1) % 12;
		};

	/*
	 * Public methods 
	 */

	$.fn.fancybox = function(options) {
		if (!$(this).length) {
			return this;
		}

		$(this)
			.data('fancybox', $.extend({}, options, ($.metadata ? $(this).metadata() : {})))
			.unbind('click.fb')
			.bind('click.fb', function(e) {
				e.preventDefault();

				if (busy) {
					return;
				}

				busy = true;

				$(this).blur();

				selectedArray = [];
				selectedIndex = 0;

				var rel = $(this).attr('rel') || '';

				if (!rel || rel == '' || rel === 'nofollow') {
					selectedArray.push(this);

				} else {
					selectedArray = $("a[rel=" + rel + "], area[rel=" + rel + "]");
					selectedIndex = selectedArray.index( this );
				}

				_start();

				return;
			});

		return this;
	};

	$.fancybox = function(obj) {
		var opts;

		if (busy) {
			return;
		}

		busy = true;
		opts = typeof arguments[1] !== 'undefined' ? arguments[1] : {};

		selectedArray = [];
		selectedIndex = parseInt(opts.index, 10) || 0;

		if ($.isArray(obj)) {
			for (var i = 0, j = obj.length; i < j; i++) {
				if (typeof obj[i] == 'object') {
					$(obj[i]).data('fancybox', $.extend({}, opts, obj[i]));
				} else {
					obj[i] = $({}).data('fancybox', $.extend({content : obj[i]}, opts));
				}
			}

			selectedArray = jQuery.merge(selectedArray, obj);

		} else {
			if (typeof obj == 'object') {
				$(obj).data('fancybox', $.extend({}, opts, obj));
			} else {
				obj = $({}).data('fancybox', $.extend({content : obj}, opts));
			}

			selectedArray.push(obj);
		}

		if (selectedIndex > selectedArray.length || selectedIndex < 0) {
			selectedIndex = 0;
		}

		_start();
	};

	$.fancybox.showActivity = function() {
		clearInterval(loadingTimer);

		loading.show();
		loadingTimer = setInterval(_animate_loading, 66);
	};

	$.fancybox.hideActivity = function() {
		loading.hide();
	};

	$.fancybox.next = function() {
		return $.fancybox.pos( currentIndex + 1);
	};

	$.fancybox.prev = function() {
		return $.fancybox.pos( currentIndex - 1);
	};

	$.fancybox.pos = function(pos) {
		if (busy) {
			return;
		}

		pos = parseInt(pos);

		selectedArray = currentArray;

		if (pos > -1 && pos < currentArray.length) {
			selectedIndex = pos;
			_start();

		} else if (currentOpts.cyclic && currentArray.length > 1) {
			selectedIndex = pos >= currentArray.length ? 0 : currentArray.length - 1;
			_start();
		}

		return;
	};

	$.fancybox.cancel = function() {
		if (busy) {
			return;
		}

		busy = true;

		$.event.trigger('fancybox-cancel');

		_abort();

		selectedOpts.onCancel(selectedArray, selectedIndex, selectedOpts);

		busy = false;
	};

	// Note: within an iframe use - parent.$.fancybox.close();
	$.fancybox.close = function() {
		if (busy || wrap.is(':hidden')) {
			return;
		}

		busy = true;

		if (currentOpts && false === currentOpts.onCleanup(currentArray, currentIndex, currentOpts)) {
			busy = false;
			return;
		}

		_abort();

		$(close.add( nav_left ).add( nav_right )).hide();

		$(content.add( overlay )).unbind();

		$(window).unbind("resize.fb scroll.fb");
		$(document).unbind('keydown.fb');

		content.find('iframe').attr('src', isIE6 && /^https/i.test(window.location.href || '') ? 'javascript:void(false)' : 'about:blank');

		if (currentOpts.titlePosition !== 'inside') {
			title.empty();
		}

		wrap.stop();

		function _cleanup() {
			overlay.fadeOut('fast');

			title.empty().hide();
			wrap.hide();

			$.event.trigger('fancybox-cleanup');

			content.empty();

			currentOpts.onClosed(currentArray, currentIndex, currentOpts);

			currentArray = selectedOpts	= [];
			currentIndex = selectedIndex = 0;
			currentOpts = selectedOpts	= {};

			busy = false;
		}

		if (currentOpts.transitionOut == 'elastic') {
			start_pos = _get_zoom_from();

			var pos = wrap.position();

			final_pos = {
				top	 : pos.top ,
				left : pos.left,
				width :	wrap.width(),
				height : wrap.height()
			};

			if (currentOpts.opacity) {
				final_pos.opacity = 1;
			}

			title.empty().hide();

			fx.prop = 1;

			$(fx).animate({ prop: 0 }, {
				 duration : currentOpts.speedOut,
				 easing : currentOpts.easingOut,
				 step : _draw,
				 complete : _cleanup
			});

		} else {
			wrap.fadeOut( currentOpts.transitionOut == 'none' ? 0 : currentOpts.speedOut, _cleanup);
		}
	};

	$.fancybox.resize = function() {
		if (overlay.is(':visible')) {
			overlay.css('height', $(document).height());
		}

		$.fancybox.center(true);
	};

	$.fancybox.center = function() {
		var view, align;

		if (busy) {
			return;	
		}

		align = arguments[0] === true ? 1 : 0;
		view = _get_viewport();

		if (!align && (wrap.width() > view[0] || wrap.height() > view[1])) {
			return;	
		}

		wrap
			.stop()
			.animate({
				'top' : parseInt(Math.max(view[3] - 20, view[3] + ((view[1] - content.height() - 40) * 0.5) - currentOpts.padding)),
				'left' : parseInt(Math.max(view[2] - 20, view[2] + ((view[0] - content.width() - 40) * 0.5) - currentOpts.padding))
			}, typeof arguments[0] == 'number' ? arguments[0] : 200);
	};

	$.fancybox.init = function() {
		if ($("#fancybox-wrap").length) {
			return;
		}

		$('body').append(
			tmp	= $('<div id="fancybox-tmp"></div>'),
			loading	= $('<div id="fancybox-loading"><div></div></div>'),
			overlay	= $('<div id="fancybox-overlay"></div>'),
			wrap = $('<div id="fancybox-wrap"></div>')
		);

		outer = $('<div id="fancybox-outer"></div>')
			.append('<div class="fancybox-bg" id="fancybox-bg-n"></div><div class="fancybox-bg" id="fancybox-bg-ne"></div><div class="fancybox-bg" id="fancybox-bg-e"></div><div class="fancybox-bg" id="fancybox-bg-se"></div><div class="fancybox-bg" id="fancybox-bg-s"></div><div class="fancybox-bg" id="fancybox-bg-sw"></div><div class="fancybox-bg" id="fancybox-bg-w"></div><div class="fancybox-bg" id="fancybox-bg-nw"></div>')
			.appendTo( wrap );

		outer.append(
			content = $('<div id="fancybox-content"></div>'),
			close = $('<a id="fancybox-close"></a>'),
			title = $('<div id="fancybox-title"></div>'),

			nav_left = $('<a href="javascript:;" id="fancybox-left"><span class="fancy-ico" id="fancybox-left-ico"></span></a>'),
			nav_right = $('<a href="javascript:;" id="fancybox-right"><span class="fancy-ico" id="fancybox-right-ico"></span></a>')
		);

		close.click($.fancybox.close);
		loading.click($.fancybox.cancel);

		nav_left.click(function(e) {
			e.preventDefault();
			$.fancybox.prev();
		});

		nav_right.click(function(e) {
			e.preventDefault();
			$.fancybox.next();
		});

		if ($.fn.mousewheel) {
			wrap.bind('mousewheel.fb', function(e, delta) {
				if (busy) {
					e.preventDefault();

				} else if ($(e.target).get(0).clientHeight == 0 || $(e.target).get(0).scrollHeight === $(e.target).get(0).clientHeight) {
					e.preventDefault();
					$.fancybox[ delta > 0 ? 'prev' : 'next']();
				}
			});
		}

		if (!$.support.opacity) {
			wrap.addClass('fancybox-ie');
		}

		if (isIE6) {
			loading.addClass('fancybox-ie6');
			wrap.addClass('fancybox-ie6');

			$('<iframe id="fancybox-hide-sel-frame" src="' + (/^https/i.test(window.location.href || '') ? 'javascript:void(false)' : 'about:blank' ) + '" scrolling="no" border="0" frameborder="0" tabindex="-1"></iframe>').prependTo(outer);
		}
	};

	$.fn.fancybox.defaults = {
		padding : 10,
		margin : 40,
		opacity : false,
		modal : false,
		cyclic : false,
		scrolling : 'auto',	// 'auto', 'yes' or 'no'

		width : 560,
		height : 340,

		autoScale : true,
		autoDimensions : true,
		centerOnScroll : false,

		ajax : {},
		swf : { wmode: 'transparent' },

		hideOnOverlayClick : true,
		hideOnContentClick : false,

		overlayShow : true,
		overlayOpacity : 0.7,
		overlayColor : '#777',

		titleShow : true,
		titlePosition : 'float', // 'float', 'outside', 'inside' or 'over'
		titleFormat : null,
		titleFromAlt : false,

		transitionIn : 'fade', // 'elastic', 'fade' or 'none'
		transitionOut : 'fade', // 'elastic', 'fade' or 'none'

		speedIn : 300,
		speedOut : 300,

		changeSpeed : 300,
		changeFade : 'fast',

		easingIn : 'swing',
		easingOut : 'swing',

		showCloseButton	 : true,
		showNavArrows : true,
		enableEscapeButton : true,
		enableKeyboardNav : true,

		onStart : function(){},
		onCancel : function(){},
		onComplete : function(){},
		onCleanup : function(){},
		onClosed : function(){},
		onError : function(){}
	};

	$(document).ready(function() {
		$.fancybox.init();
	});

})(jQuery);
/*
* qTip2 - Pretty powerful tooltips
* http://craigsworks.com/projects/qtip2/
*
* Version: nightly
* Copyright 2009-2010 Craig Michael Thompson - http://craigsworks.com
*
* Dual licensed under MIT or GPLv2 licenses
*   http://en.wikipedia.org/wiki/MIT_License
*   http://en.wikipedia.org/wiki/GNU_General_Public_License
*
* Date: Wed Jul 13 11:48:29 PDT 2011
*/

/*jslint browser: true, onevar: true, undef: true, nomen: true, bitwise: true, regexp: true, newcap: true, immed: true, strict: true */
/*global window: false, jQuery: false, console: false */


(function($, window, undefined) {

	"use strict"; // Enable ECMAScript "strict" operation for this function. See more: http://ejohn.org/blog/ecmascript-5-strict-mode-json-and-more/
	
	// Munge the primitives - Paul Irish tip
	var TRUE = true,
		FALSE = false,
		NULL = null,
		
		// Shortcut vars
		QTIP, PLUGINS, MOUSE,
		usedIDs = {},
		uitooltip = 'ui-tooltip',
		widget = 'ui-widget',
		disabled = 'ui-state-disabled',
		selector = 'div.qtip.'+uitooltip,
		defaultClass = uitooltip + '-default',
		focusClass = uitooltip + '-focus',
		hoverClass = uitooltip + '-hover',
		fluidClass = uitooltip + '-fluid',
		hideOffset = '-31000px',
		replaceSuffix = '_replacedByqTip',
		oldtitle = 'oldtitle',
		trackingBound;
		
	/* Thanks to Paul Irish for this one: http://paulirish.com/2009/log-a-lightweight-wrapper-for-consolelog/ */
	function log() {
		log.history = log.history || [];
		log.history.push(arguments);
		
		// Make sure console is present
		if('object' === typeof console) {

			// Setup console and arguments
			var c = console[ console.warn ? 'warn' : 'log' ],
			args = Array.prototype.slice.call(arguments), a;

			// Add qTip2 marker to first argument if it's a string
			if(typeof arguments[0] === 'string') { args[0] = 'qTip2: ' + args[0]; }

			// Apply console.warn or .log if not supported
			a = c.apply ? c.apply(console, args) : c(args);
		}
	}

// Option object sanitizer
function sanitizeOptions(opts)
{
	var content;

	if(!opts || 'object' !== typeof opts) { return FALSE; }

	if('object' !== typeof opts.metadata) {
		opts.metadata = {
			type: opts.metadata
		};
	}

	if('content' in opts) {
		if('object' !== typeof opts.content || opts.content.jquery) {
			opts.content = {
				text: opts.content
			};
		}

		content = opts.content.text || FALSE;
		if(!$.isFunction(content) && ((!content && !content.attr) || content.length < 1 || ('object' === typeof content && !content.jquery))) {
			opts.content.text = FALSE;
		}

		if('title' in opts.content) {
			if('object' !== typeof opts.content.title) {
				opts.content.title = {
					text: opts.content.title
				};
			}

			content = opts.content.title.text || FALSE;
			if(!$.isFunction(content) && ((!content && !content.attr) || content.length < 1 || ('object' === typeof content && !content.jquery))) {
				opts.content.title.text = FALSE;
			}
		}
	}

	if('position' in opts) {
		if('object' !== typeof opts.position) {
			opts.position = {
				my: opts.position,
				at: opts.position
			};
		}
	}

	if('show' in opts) {
		if('object' !== typeof opts.show) {
			if(opts.show.jquery) {
				opts.show = { target: opts.show };
			}
			else {
				opts.show = { event: opts.show };
			}
		}
	}

	if('hide' in opts) {
		if('object' !== typeof opts.hide) {
			if(opts.hide.jquery) {
				opts.hide = { target: opts.hide };
			}
			else {
				opts.hide = { event: opts.hide };
			}
		}
	}

	if('style' in opts) {
		if('object' !== typeof opts.style) {
			opts.style = {
				classes: opts.style
			};
		}
	}

	// Sanitize plugin options
	$.each(PLUGINS, function() {
		if(this.sanitize) { this.sanitize(opts); }
	});
	
	return opts;
}

/*
* Core plugin implementation
*/
function QTip(target, options, id, attr)
{
	// Declare this reference
	var self = this,
		docBody = document.body,
		tooltipID = uitooltip + '-' + id,
		isPositioning = 0,
		isDrawing = 0,
		tooltip = $(),
		namespace = '.qtip-' + id,
		elements, cache;

	// Setup class attributes
	self.id = id;
	self.rendered = FALSE;
	self.elements = elements = { target: target };
	self.timers = { img: {} };
	self.options = options;
	self.checks = {};
	self.plugins = {};
	self.cache = cache = {
		event: {},
		target: $(),
		disabled: FALSE,
		attr: attr
	};

	/*
	* Private core functions
	*/
	function convertNotation(notation)
	{
		var i = 0, obj, option = options, 

		// Split notation into array
		levels = notation.split('.');

		// Loop through
		while( option = option[ levels[i++] ] ) {
			if(i < levels.length) { obj = option; }
		}

		return [obj || options, levels.pop()];
	}

	function setWidget() {
		var on = options.style.widget;

		tooltip.toggleClass(widget, on).toggleClass(defaultClass, !on);
		elements.content.toggleClass(widget+'-content', on);
		
		if(elements.titlebar){
			elements.titlebar.toggleClass(widget+'-header', on);
		}
		if(elements.button){
			elements.button.toggleClass(uitooltip+'-icon', !on);
		}
	}

	function removeTitle()
	{
		if(elements.title) {
			elements.titlebar.remove();
			elements.titlebar = elements.title = elements.button = NULL;
			self.reposition();
		}
	}

	function createButton()
	{
		var button = options.content.title.button,
			isString = typeof button === 'string',
			close = isString ? button : 'Close tooltip';

		if(elements.button) { elements.button.remove(); }

		// Use custom button if one was supplied by user, else use default
		if(button.jquery) {
			elements.button = button;
		}
		else {
			elements.button = $('<a />', {
				'class': 'ui-state-default ' + (options.style.widget ? '' : uitooltip+'-icon'),
				'title': close,
				'aria-label': close
			})
			.prepend(
				$('<span />', {
					'class': 'ui-icon ui-icon-close',
					'html': '&times;'
				})
			);
		}

		// Create button and setup attributes
		elements.button.appendTo(elements.titlebar)
			.attr('role', 'button')
			.hover(function(event){ $(this).toggleClass('ui-state-hover', event.type === 'mouseenter'); })
			.click(function(event) {
				if(!tooltip.hasClass(disabled)) { self.hide(event); }
				return FALSE;
			})
			.bind('mousedown keydown mouseup keyup mouseout', function(event) {
				$(this).toggleClass('ui-state-active ui-state-focus', event.type.substr(-4) === 'down');
			});

		// Redraw the tooltip when we're done
		self.redraw();
	}

	function createTitle()
	{
		var id = tooltipID+'-title';

		// Destroy previous title element, if present
		if(elements.titlebar) { removeTitle(); }

		// Create title bar and title elements
		elements.titlebar = $('<div />', {
			'class': uitooltip + '-titlebar ' + (options.style.widget ? 'ui-widget-header' : '')
		})
		.append(
			elements.title = $('<div />', {
				'id': id,
				'class': uitooltip + '-title',
				'aria-atomic': TRUE
			})
		)
		.insertBefore(elements.content);

		// Create button if enabled
		if(options.content.title.button) { createButton(); }

		// Redraw the tooltip dimensions if it's rendered
		else if(self.rendered){ self.redraw(); } 
	}

	function updateButton(button)
	{
		var elem = elements.button,
			title = elements.title;

		// Make sure tooltip is rendered and if not, return
		if(!self.rendered) { return FALSE; }

		if(!button) {
			elem.remove();
		}
		else {
			if(!title) {
				createTitle();
			}
			createButton();
		}
	}

	function updateTitle(content, reposition)
	{
		var elem = elements.title;

		// Make sure tooltip is rendered and if not, return
		if(!self.rendered || !content) { return FALSE; }

		// Use function to parse content
		if($.isFunction(content)) {
			content = content.call(target, cache.event, self) || '';
		}

		// Remove title if content is FALSE
		if(elem && content === FALSE) { removeTitle(); }

		// Append new content if its a DOM array and show it if hidden
		else if(content.jquery && content.length > 0) {
			elem.empty().append(content.css({ display: 'block' }));
		}

		// Content is a regular string, insert the new content
		else { elem.html(content); }

		// Redraw and reposition
		self.redraw();
		if(reposition !== FALSE && self.rendered && tooltip.is(':visible')) {
			self.reposition(cache.event);
		}
	}

	function updateContent(content, reposition)
	{
		var elem = elements.content;

		// Make sure tooltip is rendered and content is defined. If not return
		if(!self.rendered || !content) { return FALSE; }

		// Use function to parse content
		if($.isFunction(content)) {
			content = content.call(target, cache.event, self) || '';
		}

		// Append new content if its a DOM array and show it if hidden
		if(content.jquery && content.length > 0) {
			elem.empty().append(content.css({ display: 'block' }));
		}

		// Content is a regular string, insert the new content
		else { elem.html(content); }

		// Image detection
		function detectImages(next) {
			var images;

			function imageLoad(event) {
				// Clear any timers and events associated with the image
				clearTimeout(self.timers.img[this]);
				$(this).unbind(namespace);

				// If queue is empty after image removal, update tooltip and continue the queue
				if((images = images.not(this)).length === 0) {
					self.redraw();
					if(reposition !== FALSE) {
						self.reposition(cache.event);
					}
					
					next();
				}
			}

			// Find all content images without dimensions, and if no images were found, continue
			if((images = elem.find('img:not([height]):not([width])')).length === 0) { return imageLoad.call(images); }

			// Apply timer to each image to poll for dimensions
			images.each(function(i, elem) {
				(function timer(){
					// When the dimensions are found, remove the image from the queue
					if(elem.height && elem.width) { return imageLoad.call(elem); }

					// Restart timer
					self.timers.img[elem] = setTimeout(timer, 1000);
				}());

				// Also apply regular load/error event handlers
				$(elem).bind('error'+namespace+' load'+namespace, imageLoad);
			});
		}

		/*
		 * If we're still rendering... insert into 'fx' queue our image dimension
		 * checker which will halt the showing of the tooltip until image dimensions
		 * can be detected properly.
		 */
		if(self.rendered < 0) { tooltip.queue('fx', detectImages); }

		// We're fully rendered, so reset isDrawing flag and proceed without queue delay
		else { isDrawing = 0; detectImages($.noop); }

		return self;
	}

	function assignEvents()
	{
		var posOptions = options.position,
			targets = {
				show: options.show.target,
				hide: options.hide.target,
				viewport: $(posOptions.viewport),
				document: $(document),
				window: $(window)
			},
			events = {
				show: $.trim('' + options.show.event).split(' '),
				hide: $.trim('' + options.hide.event).split(' ')
			},
			IE6 = $.browser.msie && parseInt($.browser.version, 10) === 6;

		// Define show event method
		function showMethod(event)
		{
			if(tooltip.hasClass(disabled)) { return FALSE; }

			// If set, hide tooltip when inactive for delay period
			targets.show.trigger('qtip-'+id+'-inactive');

			// Clear hide timers
			clearTimeout(self.timers.show);
			clearTimeout(self.timers.hide);

			// Start show timer
			var callback = function(){ self.toggle(TRUE, event); };
			if(options.show.delay > 0) {
				self.timers.show = setTimeout(callback, options.show.delay);
			}
			else{ callback(); }
		}

		// Define hide method
		function hideMethod(event)
		{
			if(tooltip.hasClass(disabled)) { return FALSE; }

			// Check if new target was actually the tooltip element
			var relatedTarget = $(event.relatedTarget || event.target),
				ontoTooltip = relatedTarget.closest(selector)[0] === tooltip[0],
				ontoTarget = relatedTarget[0] === targets.show[0];

			// Clear timers and stop animation queue
			clearTimeout(self.timers.show);
			clearTimeout(self.timers.hide);

			// Prevent hiding if tooltip is fixed and event target is the tooltip. Or if mouse positioning is enabled and cursor momentarily overlaps
			if((posOptions.target === 'mouse' && ontoTooltip) || (options.hide.fixed && ((/mouse(out|leave|move)/).test(event.type) && (ontoTooltip || ontoTarget)))) {
				event.preventDefault(); return;
			}

			// If tooltip has displayed, start hide timer
			if(options.hide.delay > 0) {
				self.timers.hide = setTimeout(function(){ self.hide(event); }, options.hide.delay);
			}
			else{ self.hide(event); }
		}

		// Define inactive method
		function inactiveMethod(event)
		{
			if(tooltip.hasClass(disabled)) { return FALSE; }

			// Clear timer
			clearTimeout(self.timers.inactive);
			self.timers.inactive = setTimeout(function(){ self.hide(event); }, options.hide.inactive);
		}

		function repositionMethod(event) {
			if(tooltip.is(':visible')) { self.reposition(event); }
		}

		// On mouseenter/mouseleave...
		tooltip.bind('mouseenter'+namespace+' mouseleave'+namespace, function(event) {
			var state = event.type === 'mouseenter';

			// Focus the tooltip on mouseenter (z-index stacking)
			if(state) { self.focus(event); }

			// Add hover class
			tooltip.toggleClass(hoverClass, state);
		});

		// Enable hide.fixed
		if(options.hide.fixed) {
			// Add tooltip as a hide target
			targets.hide = targets.hide.add(tooltip);

			// Clear hide timer on tooltip hover to prevent it from closing
			tooltip.bind('mouseover'+namespace, function() {
				if(!tooltip.hasClass(disabled)) { clearTimeout(self.timers.hide); }
			});
		}

		// If using mouseout/mouseleave as a hide event...
		if(/mouse(out|leave)/i.test(options.hide.event)) {
			// Hide tooltips when leaving current window/frame (but not select/option elements)
			if(options.hide.leave === 'window') {
				targets.window.bind('mouseout' + namespace, function(event) {
					if(/select|option/.test(event.target) && !event.relatedTarget) { self.hide(event); }
				});
			}
		}

		/*
		 * Make sure hoverIntent functions properly by using mouseleave to clear show timer if
		 * mouseenter/mouseout is used for show.event, even if it isn't in the users options.
		 */
		else if(/mouse(over|enter)/i.test(options.show.event)) {
			targets.hide.bind('mouseleave'+namespace, function(event) {
				clearTimeout(self.timers.show);
			});
		}

		// Hide tooltip on document mousedown if unfocus events are enabled
		if(('' + options.hide.event).indexOf('unfocus') > -1) {
			targets.document.bind('mousedown'+namespace, function(event) {
				var $target = $(event.target),
					enabled = !tooltip.hasClass(disabled) && tooltip.is(':visible');

				if($target.parents(selector).length === 0 && $target.add(target).length > 1) {
					self.hide(event);
				}
			});
		}

		// Check if the tooltip hides when inactive
		if('number' === typeof options.hide.inactive) {
			// Bind inactive method to target as a custom event
			targets.show.bind('qtip-'+id+'-inactive', inactiveMethod);
			
			// Define events which reset the 'inactive' event handler
			$.each(QTIP.inactiveEvents, function(index, type){
				targets.hide.add(elements.tooltip).bind(type+namespace+'-inactive', inactiveMethod);
			});
		}

		// Apply hide events
		$.each(events.hide, function(index, type) {
			var showIndex = $.inArray(type, events.show),
					targetHide = $(targets.hide);

			// Both events and targets are identical, apply events using a toggle
			if((showIndex > -1 && targetHide.add(targets.show).length === targetHide.length) || type === 'unfocus')
			{
				targets.show.bind(type+namespace, function(event) {
					if(tooltip.is(':visible')) { hideMethod(event); }
					else { showMethod(event); }
				});

				// Don't bind the event again
				delete events.show[ showIndex ];
			}

			// Events are not identical, bind normally
			else { targets.hide.bind(type+namespace, hideMethod); }
		});

		// Apply show events
		$.each(events.show, function(index, type) {
			targets.show.bind(type+namespace, showMethod);
		});

		// Check if the tooltip hides when mouse is moved a certain distance
		if('number' === typeof options.hide.distance) {
			// Bind mousemove to target to detect distance difference
			targets.show.bind('mousemove'+namespace, function(event) {
				var origin = cache.origin || {},
					limit = options.hide.distance,
					abs = Math.abs;

				// Check if the movement has gone beyond the limit, and hide it if so
				if(abs(event.pageX - origin.pageX) >= limit || abs(event.pageY - origin.pageY) >= limit) {
					self.hide(event);
				}
			});
		}

		// Mouse positioning events
		if(posOptions.target === 'mouse') {
			// Cache mousemove coords on show targets
			targets.show.bind('mousemove'+namespace, function(event) {
				MOUSE = { pageX: event.pageX, pageY: event.pageY, type: 'mousemove' };
			});

			// If mouse adjustment is on...
			if(posOptions.adjust.mouse) {
				// Apply a mouseleave event so we don't get problems with overlapping
				if(options.hide.event) {
					tooltip.bind('mouseleave'+namespace, function(event) {
						if((event.relatedTarget || event.target) !== targets.show[0]) { self.hide(event); }
					});
				}

				// Update tooltip position on mousemove
				targets.document.bind('mousemove'+namespace, function(event) {
					// Update the tooltip position only if the tooltip is visible and adjustment is enabled
					if(!tooltip.hasClass(disabled) && tooltip.is(':visible')) {
						self.reposition(event || MOUSE);
					}
				});
			}
		}

		// Adjust positions of the tooltip on window resize if enabled
		if(posOptions.adjust.resize || targets.viewport.length) {
			($.event.special.resize ? targets.viewport : targets.window).bind('resize'+namespace, repositionMethod);
		}

		// Adjust tooltip position on scroll if screen adjustment is enabled
		if(targets.viewport.length || (IE6 && tooltip.css('position') === 'fixed')) {
			targets.viewport.bind('scroll'+namespace, repositionMethod);
		}
	}

	function unassignEvents()
	{
		var targets = [
				options.show.target[0],
				options.hide.target[0],
				self.rendered && elements.tooltip[0],
				options.position.container[0],
				options.position.viewport[0],
				window,
				document
			];

		// Check if tooltip is rendered
		if(self.rendered) {
			$([]).pushStack( $.grep(targets, function(i){ return typeof i === 'object'; }) ).unbind(namespace);
		}

		// Tooltip isn't yet rendered, remove render event
		else { options.show.target.unbind(namespace+'-create'); }
	}

	// Setup builtin .set() option checks
	self.checks.builtin = {
		// Core checks
		'^id$': function(obj, o, v) {
			var id = v === TRUE ? QTIP.nextid : v,
				tooltipID = uitooltip + '-' + id;

			if(id !== FALSE && id.length > 0 && !$('#'+tooltipID).length) {
				tooltip[0].id = tooltipID;
				elements.content[0].id = tooltipID + '-content';
				elements.title[0].id = tooltipID + '-title';
			}
		},

		// Content checks
		'^content.text$': function(obj, o, v){ updateContent(v); },
		'^content.title.text$': function(obj, o, v) {
			// Remove title if content is null
			if(!v) { return removeTitle(); }

			// If title isn't already created, create it now and update
			if(!elements.title && v) { createTitle(); }
			updateTitle(v);
		},
		'^content.title.button$': function(obj, o, v){ updateButton(v); },

		// Position checks
		'^position.(my|at)$': function(obj, o, v){
			// Parse new corner value into Corner objecct
			if('string' === typeof v) {
				obj[o] = new PLUGINS.Corner(v);
			}
		},
		'^position.container$': function(obj, o, v){
			if(self.rendered) { tooltip.appendTo(v); }
		},

		// Show checks
		'^show.ready$': function() {
			if(!self.rendered) { self.render(1); }
			else { self.toggle(TRUE); }
		},

		// Style checks
		'^style.classes$': function(obj, o, v) { 
			tooltip.attr('class', uitooltip + ' qtip ui-helper-reset ' + v);
		},
		'^style.widget|content.title': setWidget,

		// Events check
		'^events.(render|show|move|hide|focus|blur)$': function(obj, o, v) {
			tooltip[($.isFunction(v) ? '' : 'un') + 'bind']('tooltip'+o, v);
		},

		// Properties which require event reassignment
		'^(show|hide|position).(event|target|fixed|inactive|leave|distance|viewport|adjust)': function() {
			var posOptions = options.position;

			// Set tracking flag
			tooltip.attr('tracking', posOptions.target === 'mouse' && posOptions.adjust.mouse);

			// Reassign events
			unassignEvents(); assignEvents();
		}
	};

	/*
	* Public API methods
	*/
	$.extend(self, {
		render: function(show)
		{
			if(self.rendered) { return self; } // If tooltip has already been rendered, exit

			var title = options.content.title.text,
				posOptions = options.position,
				callback = $.Event('tooltiprender');

			// Add ARIA attributes to target
			$.attr(target[0], 'aria-describedby', tooltipID);

			// Create tooltip element
			tooltip = elements.tooltip = $('<div/>', {
					'id': tooltipID,
					'class': uitooltip + ' qtip ui-helper-reset ' + defaultClass + ' ' + options.style.classes,
					'width': options.style.width || '',
					'tracking': posOptions.target === 'mouse' && posOptions.adjust.mouse,

					/* ARIA specific attributes */
					'role': 'alert',
					'aria-live': 'polite',
					'aria-atomic': FALSE,
					'aria-describedby': tooltipID + '-content',
					'aria-hidden': TRUE
				})
				.toggleClass(disabled, cache.disabled)
				.data('qtip', self)
				.appendTo(options.position.container)
				.append(
					// Create content element
					elements.content = $('<div />', {
						'class': uitooltip + '-content',
						'id': tooltipID + '-content',
						'aria-atomic': TRUE
					})
				);

			// Set rendered flag and prevent redundant redraw calls for npw
			self.rendered = -1;
			isDrawing = 1;

			// Update title
			if(title) { 
				createTitle();
				updateTitle(title);
			}

			// Set proper rendered flag and update content
			updateContent(options.content.text, FALSE);
			self.rendered = TRUE;

			// Setup widget classes
			setWidget();

			// Assign passed event callbacks (before plugins!)
			$.each(options.events, function(name, callback) {
				if($.isFunction(callback)) {
					tooltip.bind(name === 'toggle' ? 'tooltipshow tooltiphide' : 'tooltip'+name, callback);
				}
			});

			// Initialize 'render' plugins
			$.each(PLUGINS, function() {
				if(this.initialize === 'render') { this(self); }
			});

			// Assign events
			assignEvents();

			/* Queue this part of the render process in our fx queue so we can
			 * load images before the tooltip renders fully.
			 *
			 * See: updateContent method
			*/
			tooltip.queue('fx', function(next) {
				// Trigger tooltiprender event and pass original triggering event as original
				callback.originalEvent = cache.event;
				tooltip.trigger(callback, [self]);

				// Redraw the tooltip manually now we're fully rendered
				isDrawing = 0; self.redraw();

				// Update tooltip position and show tooltip if needed
				if(options.show.ready || show) {
					self.toggle(TRUE, cache.event);
				}

				next(); // Move on to next method in queue
			});

			return self;
		},

		get: function(notation)
		{
			var result, o;

			switch(notation.toLowerCase())
			{
				case 'dimensions':
					result = {
						height: tooltip.outerHeight(), width: tooltip.outerWidth()
					};
				break;

				case 'offset':
					result = PLUGINS.offset(tooltip, options.position.container);
				break;

				default:
					o = convertNotation(notation.toLowerCase());
					result = o[0][ o[1] ];
					result = result.precedance ? result.string() : result;
				break;
			}

			return result;
		},

		set: function(option, value)
		{
			var rmove = /^position\.(my|at|adjust|target|container)|style|content|show\.ready/i,
				rdraw = /^content\.(title|attr)|style/i,
				reposition = FALSE,
				redraw = FALSE,
				checks = self.checks,
				name;

			function callback(notation, args) {
				var category, rule, match;

				for(category in checks) {
					for(rule in checks[category]) {
						if(match = (new RegExp(rule, 'i')).exec(notation)) {
							args.push(match);
							checks[category][rule].apply(self, args);
						}
					}
				}
			}

			// Convert singular option/value pair into object form
			if('string' === typeof option) {
				name = option; option = {}; option[name] = value;
			}
			else { option = $.extend(TRUE, {}, option); }

			// Set all of the defined options to their new values
			$.each(option, function(notation, value) {
				var obj = convertNotation( notation.toLowerCase() ), previous;

				// Set new obj value
				previous = obj[0][ obj[1] ];
				obj[0][ obj[1] ] = 'object' === typeof value && value.nodeType ? $(value) : value;

				// Set the new params for the callback
				option[notation] = [obj[0], obj[1], value, previous];

				// Also check if we need to reposition / redraw
				reposition = rmove.test(notation) || reposition;
				redraw = rdraw.test(notation) || redraw;
			});

			// Re-sanitize options
			sanitizeOptions(options);

			/*
			 * Execute any valid callbacks for the set options
			 * Also set isPositioning/isDrawing so we don't get loads of redundant repositioning
			 * and redraw calls.
			 */
			isPositioning = isDrawing = 1; $.each(option, callback); isPositioning = isDrawing = 0;

			// Update position / redraw if needed
			if(tooltip.is(':visible') && self.rendered) {
				if(reposition) {
					self.reposition( options.position.target === 'mouse' ? NULL : cache.event );
				}
				if(redraw) { self.redraw(); }
			}

			return self;
		},

		toggle: function(state, event)
		{
			// Make sure tooltip is rendered
			if(!self.rendered) {
				if(state) { self.render(1); } // Render the tooltip if showing and it isn't already
				else { return self; }
			}

			var type = state ? 'show' : 'hide',
				opts = options[type],
				visible = tooltip.is(':visible'),
				sameTarget = !event || options[type].target.length < 2 || cache.target[0] === event.target,
				posOptions = options.position,
				contentOptions = options.content,
				delay,
				callback;

			// Detect state if valid one isn't provided
			if((typeof state).search('boolean|number')) { state = !visible; }

			// Return if element is already in correct state
			if(!tooltip.is(':animated') && visible === state && sameTarget) { return self; }

			// Try to prevent flickering when tooltip overlaps show element
			if(event) {
				if((/over|enter/).test(event.type) && (/out|leave/).test(cache.event.type) &&
					event.target === options.show.target[0] && tooltip.has(event.relatedTarget).length) {
					return self;
				}

				// Cache event
				cache.event = $.extend({}, event);
			}

			// Call API methods
			callback = $.Event('tooltip'+type);
			callback.originalEvent = event ? cache.event : NULL;
			tooltip.trigger(callback, [self, 90]);
			if(callback.isDefaultPrevented()){ return self; }

			// Set ARIA hidden status attribute
			$.attr(tooltip[0], 'aria-hidden', !!!state);

			// Execute state specific properties
			if(state) {
				// Store show origin coordinates
				cache.origin = $.extend({}, MOUSE);

				// Focus the tooltip
				self.focus(event);

				// Update tooltip content & title if it's a dynamic function
				if($.isFunction(contentOptions.text)) { updateContent(contentOptions.text, FALSE); }
				if($.isFunction(contentOptions.title.text)) { updateTitle(contentOptions.title.text, FALSE); }

				// Cache mousemove events for positioning purposes (if not already tracking)
				if(!trackingBound && posOptions.target === 'mouse' && posOptions.adjust.mouse) {
					$(document).bind('mousemove.qtip', function(event) {
						MOUSE = { pageX: event.pageX, pageY: event.pageY, type: 'mousemove' };
					});
					trackingBound = TRUE;
				}

				// Update the tooltip position
				self.reposition(event);

				// Hide other tooltips if tooltip is solo, using it as the context
				if(opts.solo) { $(selector, opts.solo).not(tooltip).qtip('hide', callback); }
			}
			else {
				// Clear show timer if we're hiding 
				clearTimeout(self.timers.show);

				// Remove cached origin on hide
				delete cache.origin;

				// Remove mouse tracking event if not needed (all tracking qTips are hidden)
				if(trackingBound && !$(selector+'[tracking="true"]:visible', opts.solo).not(tooltip).length) {
					$(document).unbind('mousemove.qtip');
					trackingBound = FALSE;
				}
				
				// Blur the tooltip
				self.blur(event);
			}

			// Define post-animation state specific properties
			function after() {
				if(!state) {
					// Reset CSS states
					tooltip.css({
						display: '',
						visibility: '',
						opacity: '',
						left: '',
						top: ''
					});
				}
				else {
					// Prevent antialias from disappearing in IE by removing filter
					if($.browser.msie) { tooltip[0].style.removeAttribute('filter'); }

					// Remove overflow setting to prevent tip bugs
					tooltip.css('overflow', '');
				}
			}

			// Clear animation queue if same target
			if(sameTarget) { tooltip.stop(0, 1); }

			// If no effect type is supplied, use a simple toggle
			if(opts.effect === FALSE) {
				tooltip[ type ]();
				after.call(tooltip);
			}

			// Use custom function if provided
			else if($.isFunction(opts.effect)) {
				opts.effect.call(tooltip, self);
				tooltip.queue('fx', function(n){ after(); n(); });
			}

			// Use basic fade function by default
			else { tooltip.fadeTo(90, state ? 1 : 0, after); }

			// If inactive hide method is set, active it
			if(state) { opts.target.trigger('qtip-'+id+'-inactive'); }

			return self;
		},

		show: function(event){ return self.toggle(TRUE, event); },

		hide: function(event){ return self.toggle(FALSE, event); },

		focus: function(event)
		{
			if(!self.rendered) { return self; }

			var qtips = $(selector),
				curIndex = parseInt(tooltip[0].style.zIndex, 10),
				newIndex = QTIP.zindex + qtips.length,
				cachedEvent = $.extend({}, event),
				focusedElem, callback;

			// Only update the z-index if it has changed and tooltip is not already focused
			if(!tooltip.hasClass(focusClass))
			{
				// Call API method
				callback = $.Event('tooltipfocus');
				callback.originalEvent = cachedEvent;
				tooltip.trigger(callback, [self, newIndex]);

				// If default action wasn't prevented...
				if(!callback.isDefaultPrevented()) {
					// Only update z-index's if they've changed
					if(curIndex !== newIndex) {
						// Reduce our z-index's and keep them properly ordered
						qtips.each(function() {
							if(this.style.zIndex > curIndex) {
								this.style.zIndex = this.style.zIndex - 1;
							}
						});
						
						// Fire blur event for focused tooltip
						qtips.filter('.' + focusClass).qtip('blur', cachedEvent);
					}

					// Set the new z-index
					tooltip.addClass(focusClass)[0].style.zIndex = newIndex;
				}
			}

			return self;
		},

		blur: function(event) {
			var cachedEvent = $.extend({}, event),
				callback;

			// Set focused status to FALSE
			tooltip.removeClass(focusClass);

			// Trigger blur event
			callback = $.Event('tooltipblur');
			callback.originalEvent = cachedEvent;
			tooltip.trigger(callback, [self]);

			return self;
		},

		reposition: function(event, effect)
		{
			if(!self.rendered || isPositioning) { return self; }

			// Set positioning flag
			isPositioning = 1;
	
			var target = options.position.target,
				posOptions = options.position,
				my = posOptions.my, 
				at = posOptions.at,
				adjust = posOptions.adjust,
				method = adjust.method.split(' '),
				elemWidth = tooltip.outerWidth(),
				elemHeight = tooltip.outerHeight(),
				targetWidth = 0,
				targetHeight = 0,
				callback = $.Event('tooltipmove'),
				fixed = tooltip.css('position') === 'fixed',
				viewport = posOptions.viewport,
				position = { left: 0, top: 0 },
				tip = self.plugins.tip,
				readjust = {
					// Repositioning method and axis detection
					horizontal: method[0],
					vertical: method[1] || method[0],

					// Reposition methods
					left: function(posLeft) {
						var isShift = readjust.horizontal === 'shift',
							viewportScroll = viewport.offset.left + viewport.scrollLeft,
							myWidth = my.x === 'left' ? elemWidth : my.x === 'right' ? -elemWidth : -elemWidth / 2,
							atWidth = at.x === 'left' ? targetWidth : at.x === 'right' ? -targetWidth : -targetWidth / 2,
							tipWidth = tip && tip.size ? tip.size.width || 0 : 0,
							tipAdjust = tip && tip.corner && tip.corner.precedance === 'x' && !isShift ? tipWidth : 0,
							overflowLeft = viewportScroll - posLeft + tipAdjust,
							overflowRight = posLeft + elemWidth - viewport.width - viewportScroll + tipAdjust,
							offset = myWidth - (my.precedance === 'x' || my.x === my.y ? atWidth : 0),
							isCenter = my.x === 'center';

						// Optional 'shift' style repositioning
						if(isShift) {
							tipAdjust = tip && tip.corner && tip.corner.precedance === 'y' ? tipWidth : 0;
							offset = (my.x === 'left' ? 1 : -1) * myWidth - tipAdjust;

							// Adjust position but keep it within viewport dimensions
							position.left += overflowLeft > 0 ? overflowLeft : overflowRight > 0 ? -overflowRight : 0;
							position.left = Math.max(
								viewport.offset.left + (tipAdjust && tip.corner.x === 'center' ? tip.offset : 0),
								posLeft - offset,
								Math.min(
									Math.max(viewport.offset.left + viewport.width, posLeft + offset),
									position.left
								)
							);
						}

						// Default 'flip' repositioning
						else {
							if(overflowLeft > 0 && (my.x !== 'left' || overflowRight > 0)) {
								position.left -= offset + (isCenter ? 0 : 2 * adjust.x);
							}
							else if(overflowRight > 0 && (my.x !== 'right' || overflowLeft > 0)  ) {
								position.left -= isCenter ? -offset : offset + (2 * adjust.x);
							}
							if(position.left !== posLeft && isCenter) { position.left -= adjust.x; }
							
							// Make sure we haven't made things worse with the adjustment and return the adjusted difference
							if(position.left < viewportScroll && -position.left > overflowRight) { position.left = posLeft; }
						}

						return position.left - posLeft;
					},
					top: function(posTop) {
						var isShift = readjust.vertical === 'shift',
							viewportScroll = viewport.offset.top + viewport.scrollTop,
							myHeight = my.y === 'top' ? elemHeight : my.y === 'bottom' ? -elemHeight : -elemHeight / 2,
							atHeight = at.y === 'top' ? targetHeight : at.y === 'bottom' ? -targetHeight : -targetHeight / 2,
							tipHeight = tip && tip.size ? tip.size.height || 0 : 0,
							tipAdjust = tip && tip.corner && tip.corner.precedance === 'y' && !isShift ? tipHeight : 0,
							overflowTop = viewportScroll - posTop + tipAdjust,
							overflowBottom = posTop + elemHeight - viewport.height - viewportScroll + tipAdjust,
							offset = myHeight - (my.precedance === 'y' || my.x === my.y ? atHeight : 0),
							isCenter = my.y === 'center';
							
						// Optional 'shift' style repositioning
						if(isShift) {
							tipAdjust = tip && tip.corner && tip.corner.precedance === 'x' ? tipHeight : 0;
							offset = (my.y === 'top' ? 1 : -1) * myHeight - tipAdjust;

							// Adjust position but keep it within viewport dimensions
							position.top += overflowTop > 0 ? overflowTop : overflowBottom > 0 ? -overflowBottom : 0;
							position.top = Math.max(
								viewport.offset.top + (tipAdjust && tip.corner.x === 'center' ? tip.offset : 0),
								posTop - offset,
								Math.min(
									Math.max(viewport.offset.top + viewport.height, posTop + offset),
									position.top
								)
							);
						}

						// Default 'flip' repositioning
						else {
							if(overflowTop > 0 && (my.y !== 'top' || overflowBottom > 0)) {
								position.top -= offset + (isCenter ? 0 : 2 * adjust.y);
							}
							else if(overflowBottom > 0 && (my.y !== 'bottom' || overflowTop > 0)  ) {
								position.top -= isCenter ? -offset : offset + (2 * adjust.y);
							}
							if(position.top !== posTop && isCenter) { position.top -= adjust.y; }

							// Make sure we haven't made things worse with the adjustment and return the adjusted difference
							if(position.top < 0 && -position.top > overflowBottom) { position.top = posTop; }
						}

						return position.top - posTop;
					}
				};

			// Check if absolute position was passed
			if($.isArray(target) && target.length === 2) {
				// Force left top and set position
				at = { x: 'left', y: 'top' };
				position = { left: target[0], top: target[1] };
			}

			// Check if mouse was the target
			else if(target === 'mouse' && ((event && event.pageX) || cache.event.pageX)) {
				// Force left top to allow flipping
				at = { x: 'left', y: 'top' };

				// Use cached event if one isn't available for positioning
				event = event && (event.type === 'resize' || event.type === 'scroll') ? cache.event :
					event && event.pageX && event.type === 'mousemove' ? event :
					MOUSE && (adjust.mouse || !event || !event.pageX) ? { pageX: MOUSE.pageX, pageY: MOUSE.pageY } :
					!adjust.mouse && cache.origin ? cache.origin :
					event;

				// Use event coordinates for position
				position = { top: event.pageY, left: event.pageX };
			}

			// Target wasn't mouse or absolute...
			else {
				// Check if event targetting is being used
				if(target === 'event') {
					if(event && event.target && event.type !== 'scroll' && event.type !== 'resize') {
						target = cache.target = $(event.target);
					}
					else {
						target = cache.target;
					}
				}
				else { cache.target = $(target); }

				// Parse the target into a jQuery object and make sure there's an element present
				target = $(target).eq(0);
				if(target.length === 0) { return self; }

				// Check if window or document is the target
				else if(target[0] === document || target[0] === window) {
					targetWidth = PLUGINS.iOS ? window.innerWidth : target.width();
					targetHeight = PLUGINS.iOS ? window.innerHeight : target.height();

					if(target[0] === window) {
						position = {
							top: !fixed || PLUGINS.iOS ? (viewport || target).scrollTop() : 0,
							left: !fixed || PLUGINS.iOS ? (viewport || target).scrollLeft() : 0
						};
					}
				}

				// Use Imagemap/SVG plugins if needed
				else if(target.is('area') && PLUGINS.imagemap) {
					position = PLUGINS.imagemap(target, at);
				}
				else if(target[0].namespaceURI === 'http://www.w3.org/2000/svg' && PLUGINS.svg) {
					position = PLUGINS.svg(target, at);
				}

				else {
					targetWidth = target.outerWidth();
					targetHeight = target.outerHeight();

					position = PLUGINS.offset(target, posOptions.container, fixed);
				}

				// Parse returned plugin values into proper variables
				if(position.offset) {
					targetWidth = position.width;
					targetHeight = position.height;
					position = position.offset;
				}

				// Adjust position relative to target
				position.left += at.x === 'right' ? targetWidth : at.x === 'center' ? targetWidth / 2 : 0;
				position.top += at.y === 'bottom' ? targetHeight : at.y === 'center' ? targetHeight / 2 : 0;
			}

			// Adjust position relative to tooltip
			position.left += adjust.x + (my.x === 'right' ? -elemWidth : my.x === 'center' ? -elemWidth / 2 : 0);
			position.top += adjust.y + (my.y === 'bottom' ? -elemHeight : my.y === 'center' ? -elemHeight / 2 : 0);

			// Calculate collision offset values if viewport positioning is enabled
			if(viewport.jquery && target[0] !== window && target[0] !== docBody &&
				readjust.vertical+readjust.horizontal !== 'nonenone')
			{
				// Cache our viewport details
				viewport = {
					elem: viewport,
					height: viewport[ (viewport[0] === window ? 'h' : 'outerH') + 'eight' ](),
					width: viewport[ (viewport[0] === window ? 'w' : 'outerW') + 'idth' ](),
					scrollLeft: fixed ? 0 : viewport.scrollLeft(),
					scrollTop: fixed ? 0 : viewport.scrollTop(),
					offset: viewport.offset() || { left: 0, top: 0 }
				};

				// Adjust position based onviewport and adjustment options
				position.adjusted = {
					left: readjust.horizontal !== 'none' ? readjust.left(position.left) : 0,
					top: readjust.vertical !== 'none' ? readjust.top(position.top) : 0
				};
			}

			//Viewport adjustment is disabled, set values to zero
			else { position.adjusted = { left: 0, top: 0 }; }

			// Set tooltip position class
			tooltip.attr('class', function(i, val) {
				return $.attr(this, 'class').replace(/ui-tooltip-pos-\w+/i, '');
			})
			.addClass(uitooltip + '-pos-' + my.abbreviation());

			// Call API method
			callback.originalEvent = $.extend({}, event);
			tooltip.trigger(callback, [self, position, viewport.elem || viewport]);
			if(callback.isDefaultPrevented()){ return self; }
			delete position.adjusted;

			// If effect is disabled, target it mouse, no animation is defined or positioning gives NaN out, set CSS directly
			if(effect === FALSE || isNaN(position.left) || isNaN(position.top) || target === 'mouse' || !$.isFunction(posOptions.effect)) {
				tooltip.css(position);
			}
			
			// Use custom function if provided
			else if($.isFunction(posOptions.effect)) {
				posOptions.effect.call(tooltip, self, $.extend({}, position));
				tooltip.queue(function(next) {
					// Reset attributes to avoid cross-browser rendering bugs
					$(this).css({ opacity: '', height: '' });
					if($.browser.msie) { this.style.removeAttribute('filter'); }

					next();
				});
			}

			// Set positioning flag
			isPositioning = 0;

			return self;
		},

		// Max/min width simulator function for all browsers.. yeaaah!
		redraw: function()
		{
			if(self.rendered < 1 || isDrawing) { return self; }

			var container = options.position.container,
				perc, width, max, min;

			// Set drawing flag
			isDrawing = 1;

			// If tooltip has a set width, just set it... like a boss!
			if(options.style.width) { tooltip.css('width', options.style.width); }

			// Otherwise simualte max/min width...
			else {
				// Reset width and add fluid class
				tooltip.css('width', '').addClass(fluidClass);

				// Grab our tooltip width (add 1 so we don't get wrapping problems.. huzzah!)
				width = tooltip.width() + 1;

				// Grab our max/min properties
				max = tooltip.css('max-width') || '';
				min = tooltip.css('min-width') || '';

				// Parse into proper pixel values
				perc = (max + min).indexOf('%') > -1 ? container.width() / 100 : 0;
				max = ((max.indexOf('%') > -1 ? perc : 1) * parseInt(max, 10)) || width;
				min = ((min.indexOf('%') > -1 ? perc : 1) * parseInt(min, 10)) || 0;

				// Determine new dimension size based on max/min/current values
				width = max + min ? Math.min(Math.max(width, min), max) : width;

				// Set the newly calculated width and remvoe fluid class
				tooltip.css('width', Math.round(width)).removeClass(fluidClass);
			}

			// Set drawing flag
			isDrawing = 0;

			return self;
		},

		disable: function(state)
		{
			var c = disabled;
			
			if('boolean' !== typeof state) {
				state = !(tooltip.hasClass(c) || cache.disabled);
			}
			 
			if(self.rendered) {
				tooltip.toggleClass(c, state);
				$.attr(tooltip[0], 'aria-disabled', state);
			}
			else {
				cache.disabled = !!state;
			}

			return self;
		},
		
		enable: function() { return self.disable(FALSE); },

		destroy: function()
		{
			var t = target[0],
				title = $.attr(t, oldtitle);

			// Destroy tooltip and  any associated plugins if rendered
			if(self.rendered) {
				tooltip.remove();
				
				$.each(self.plugins, function() {
					if(this.destroy) { this.destroy(); }
				});
			}

			// Clear timers and remove bound events
			clearTimeout(self.timers.show);
			clearTimeout(self.timers.hide);
			unassignEvents();

			// Remove api object
			$.removeData(t, 'qtip');

			// Reset old title attribute if removed 
			if(title) {
				$.attr(t, 'title', title);
				target.removeAttr(oldtitle);
			}

			// Remove ARIA attributes and bound qtip events
			target.removeAttr('aria-describedby').unbind('.qtip');

			// Remove ID from sued id object
			delete usedIDs[self.id];

			return target;
		}
	});
}

// Initialization method
function init(id, opts)
{
	var obj, posOptions, attr, config,

	// Setup element references
	elem = $(this),
	docBody = $(document.body),

	// Use document body instead of document element if needed
	newTarget = this === document ? docBody : elem,

	// Grab metadata from element if plugin is present
	metadata = (elem.metadata) ? elem.metadata(opts.metadata) : NULL,

	// If metadata type if HTML5, grab 'name' from the object instead, or use the regular data object otherwise
	metadata5 = opts.metadata.type === 'html5' && metadata ? metadata[opts.metadata.name] : NULL,

	// Grab data from metadata.name (or data-qtipopts as fallback) using .data() method,
	html5 = elem.data(opts.metadata.name || 'qtipopts');

	// If we don't get an object returned attempt to parse it manualyl without parseJSON
	try { html5 = typeof html5 === 'string' ? (new Function("return " + html5))() : html5; }
	catch(e) { log('Unable to parse HTML5 attribute data: ' + html5); }

	// Merge in and sanitize metadata
	config = $.extend(TRUE, {}, QTIP.defaults, opts, 
		typeof html5 === 'object' ? sanitizeOptions(html5) : NULL,
		sanitizeOptions(metadata5 || metadata));

	// Re-grab our positioning options now we've merged our metadata and set id to passed value
	posOptions = config.position;
	config.id = id;
	
	// Setup missing content if none is detected
	if('boolean' === typeof config.content.text) {
		attr = elem.attr(config.content.attr);

		// Grab from supplied attribute if available
		if(config.content.attr !== FALSE && attr) { config.content.text = attr; }

		// No valid content was found, abort render
		else {
			log('Unable to locate content for tooltip! Aborting render of tooltip on element: ', elem);
			return FALSE;
		}
	}

	// Setup target options
	if(posOptions.container === FALSE) { posOptions.container = docBody; }
	if(posOptions.target === FALSE) { posOptions.target = newTarget; }
	if(config.show.target === FALSE) { config.show.target = newTarget; }
	if(config.show.solo === TRUE) { config.show.solo = docBody; }
	if(config.hide.target === FALSE) { config.hide.target = newTarget; }
	if(config.position.viewport === TRUE) { config.position.viewport = posOptions.container; }

	// Convert position corner values into x and y strings
	posOptions.at = new PLUGINS.Corner(posOptions.at);
	posOptions.my = new PLUGINS.Corner(posOptions.my);

	// Destroy previous tooltip if overwrite is enabled, or skip element if not
	if($.data(this, 'qtip')) {
		if(config.overwrite) {
			elem.qtip('destroy');
		}
		else if(config.overwrite === FALSE) {
			return FALSE;
		}
	}

	// Remove title attribute and store it if present
	if($.attr(this, 'title')) {
		$.attr(this, oldtitle, $.attr(this, 'title'));
		this.removeAttribute('title');
	}

	// Initialize the tooltip and add API reference
	obj = new QTip(elem, config, id, !!attr);
	$.data(this, 'qtip', obj);

	// Catch remove events on target element to destroy redundant tooltip
	elem.bind('remove.qtip', function(){ obj.destroy(); });

	return obj;
}

// jQuery $.fn extension method
QTIP = $.fn.qtip = function(options, notation, newValue)
{
	var command = ('' + options).toLowerCase(), // Parse command
		returned = NULL,
		args = command === 'disable' ? [TRUE] : $.makeArray(arguments).slice(1),
		event = args[args.length - 1],
		opts = this[0] ? $.data(this[0], 'qtip') : NULL;

	// Check for API request
	if((!arguments.length && opts) || command === 'api') {
		return opts;
	}

	// Execute API command if present
	else if('string' === typeof options)
	{
		this.each(function()
		{
			var api = $.data(this, 'qtip');
			if(!api) { return TRUE; }

			// Cache the event if possible
			if(event && event.timeStamp) { api.cache.event = event; }

			// Check for specific API commands
			if((command === 'option' || command === 'options') && notation) {
				if($.isPlainObject(notation) || newValue !== undefined) {
					api.set(notation, newValue);
				}
				else {
					returned = api.get(notation);
					return FALSE;
				}
			}

			// Execute API command
			else if(api[command]) {
				api[command].apply(api[command], args);
			}
		});

		return returned !== NULL ? returned : this;
	}

	// No API commands. validate provided options and setup qTips
	else if('object' === typeof options || !arguments.length)
	{
		opts = sanitizeOptions($.extend(TRUE, {}, options));

		// Bind the qTips
		return QTIP.bind.call(this, opts, event);
	}
};

// $.fn.qtip Bind method
QTIP.bind = function(opts, event)
{
	return this.each(function(i) {
		var options, targets, events, namespace, api, id;

		// Find next available ID, or use custom ID if provided
		id = $.isArray(opts.id) ? opts.id[i] : opts.id;
		id = !id || id === FALSE || id.length < 1 || usedIDs[id] ? QTIP.nextid++ : (usedIDs[id] = id);

		// Setup events namespace
		namespace = '.qtip-'+id+'-create';

		// Initialize the qTip and re-grab newly sanitized options
		api = init.call(this, id, opts);
		if(api === FALSE) { return TRUE; }
		options = api.options;

		// Initialize plugins
		$.each(PLUGINS, function() {
			if(this.initialize === 'initialize') { this(api); }
		});

		// Determine hide and show targets
		targets = { show: options.show.target, hide: options.hide.target };
		events = {
			show: $.trim('' + options.show.event).replace(/ /g, namespace+' ') + namespace,
			hide: $.trim('' + options.hide.event).replace(/ /g, namespace+' ') + namespace
		};

		/*
		 * Make sure hoverIntent functions properly by using mouseleave as a hide event if
		 * mouseenter/mouseout is used for show.event, even if it isn't in the users options.
		 */
		if(/mouse(over|enter)/i.test(events.show) && !/mouse(out|leave)/i.test(events.hide)) {
			events.hide += ' mouseleave' + namespace;
		}

		// Define hoverIntent function
		function hoverIntent(event) {
			function render() {
				// Cache mouse coords,render and render the tooltip
				api.render(typeof event === 'object' || options.show.ready);

				// Unbind show and hide events
				targets.show.add(targets.hide).unbind(namespace);
			}

			// Only continue if tooltip isn't disabled
			if(api.cache.disabled) { return FALSE; }

			// Cache the event data
			api.cache.event = $.extend({}, event);
			api.cache.target = event ? $(event.target) : [undefined];

			// Start the event sequence
			if(options.show.delay > 0) {
				clearTimeout(api.timers.show);
				api.timers.show = setTimeout(render, options.show.delay);
				if(events.show !== events.hide) {
					targets.hide.bind(events.hide, function() { clearTimeout(api.timers.show); });
				}
			}
			else { render(); }
		}

		// Bind show events to target
		targets.show.bind(events.show, hoverIntent);

		// Prerendering is enabled, create tooltip now
		if(options.show.ready || options.prerender) { hoverIntent(event); }
	});
};

// Setup base plugins
PLUGINS = QTIP.plugins = {
	// Corner object parser
	Corner: function(corner) {
		corner = ('' + corner).replace(/([A-Z])/, ' $1').replace(/middle/gi, 'center').toLowerCase();
		this.x = (corner.match(/left|right/i) || corner.match(/center/) || ['inherit'])[0].toLowerCase();
		this.y = (corner.match(/top|bottom|center/i) || ['inherit'])[0].toLowerCase();

		this.precedance = (corner.charAt(0).search(/^(t|b)/) > -1) ? 'y' : 'x';
		this.string = function() { return this.precedance === 'y' ? this.y+this.x : this.x+this.y; };
		this.abbreviation = function() { 
			var x = this.x.substr(0,1), y = this.y.substr(0,1);
			return x === y ? x : (x === 'c' || (x !== 'c' && y !== 'c')) ? y + x : x + y;
		};
	},

	// Custom (more correct for qTip!) offset calculator
	offset: function(elem, container, fixed) {
		var pos = elem.offset(),
			parent = container,
			deep = 0,
			docBody = document.body,
			coffset;

		function scroll(e, i) {
			pos.left += i * e.scrollLeft();
			pos.top += i * e.scrollTop();
		}

		if(parent) {
			// Compensate for non-static containers offset
			do {
				if(parent.css('position') !== 'static') {
					coffset = parent[0] === docBody ?
						{ left: parseInt(parent.css('left'), 10) || 0, top: parseInt(parent.css('top'), 10) || 0 } :
						parent.position();

					pos.left -= coffset.left + (parseInt(parent.css('borderLeftWidth'), 10) || 0);
					pos.top -= coffset.top + (parseInt(parent.css('borderTopWidth'), 10) || 0);

					deep++;
				}
				if(parent[0] === docBody) { break; }
			}
			while(parent = parent.offsetParent());

			// Compensate for containers scroll if it also has an offsetParent
			if(container[0] !== docBody && deep > 1) { scroll( container, 1 ); }

			// Adjust for position.fixed tooltips (and also iOS scroll bug in v3.2 - v4.0)
			if((PLUGINS.iOS < 4.1 && PLUGINS.iOS > 3.1) || (!PLUGINS.iOS && fixed)) { scroll( $(window), -1 ); }
		}

		return pos;
	},
	
	/*
	 * iOS 3.2 - 4.0 scroll fix detection used in offset() function.
	 */
	iOS: parseFloat(
		('' + (/CPU.*OS ([0-9_]{1,3})|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent) || [0,''])[1])
			.replace('undefined', '3_2').replace('_','.')
	) || FALSE,
	
	/*
	 * jQuery-secpfic $.fn overrides 
	 */
	fn: {
		/* Allow other plugins to successfully retrieve the title of an element with a qTip applied */
		attr: function(attr, val) {
			if(!this.length) { return; }
			
			var self = this[0],
			title = 'title',
			api = $.data(self, 'qtip');
			
			if(attr === title) {
				if(arguments.length < 2) {
					return $.attr(self, oldtitle);
				}
				else if(typeof api === 'object') {
					// If qTip is rendered and title was originally used as content, update it
					if(api && api.rendered && api.options.content.attr === title && api.cache.attr) {
						api.set('content.text', val);
					}
					
					// Use the regular attr method to set, then cache the result
					$.fn['attr'+replaceSuffix].apply(this, arguments);
					$.attr(self, oldtitle, $.attr(self, title));
					return this.removeAttr(title);
				}
			}
		},
		
		/* Allow clone to correctly retrieve cached title attributes */
		clone: function(keepData) {
			var titles = $([]), title = 'title', elem;

			// Clone our element using the real clone method
			elem = $.fn['clone'+replaceSuffix].apply(this, arguments)
			
			// Grab all elements with an oldtitle set, and change it to regular title attribute
			.filter('[oldtitle]').each(function() {
				$.attr(this, title, $.attr(this, oldtitle));
				this.removeAttribute(oldtitle);
			})
			.end();

			return elem;
		},
		
		/* 
		 * Taken directly from jQuery 1.8.2 widget source code
		 * Trigger 'remove' event on all elements on removal if jQuery UI isn't present 
		 */
		remove: $.ui ? NULL : function( selector, keepData ) {
			$(this).each(function() {
				if (!keepData) {
					if (!selector || $.filter( selector, [ this ] ).length) {
						$('*', this).add(this).each(function() {
							$(this).triggerHandler('remove');
						});
					}
				}
			});
		}
	}
};

// Apply the fn overrides above
$.each(PLUGINS.fn, function(name, func) {
	if(!func) { return TRUE; }
	
	var old = $.fn[name+replaceSuffix] = $.fn[name];
	$.fn[name] = function() {
		return func.apply(this, arguments) || old.apply(this, arguments);
	};
});

// Set global qTip properties
QTIP.version = 'nightly';
QTIP.nextid = 0;
QTIP.inactiveEvents = 'click dblclick mousedown mouseup mousemove mouseleave mouseenter'.split(' ');
QTIP.zindex = 15000;

// Define configuration defaults
QTIP.defaults = {
	prerender: FALSE,
	id: FALSE,
	overwrite: TRUE,
	content: {
		text: TRUE,
		attr: 'title',
		title: {
			text: FALSE,
			button: FALSE
		}
	},
	position: {
		my: 'top left',
		at: 'bottom right',
		target: FALSE,
		container: FALSE,
		viewport: FALSE,
		adjust: {
			x: 0, y: 0,
			mouse: TRUE,
			resize: TRUE,
			method: 'flip flip'
		},
		effect: function(api, pos, viewport) {
			$(this).animate(pos, {
				duration: 200,
				queue: FALSE
			});
		}
	},
	show: {
		target: FALSE,
		event: 'mouseenter',
		effect: TRUE,
		delay: 90,
		solo: FALSE,
		ready: FALSE
	},
	hide: {
		target: FALSE,
		event: 'mouseleave',
		effect: TRUE,
		delay: 0,
		fixed: FALSE,
		inactive: FALSE,
		leave: 'window',
		distance: FALSE
	},
	style: {
		classes: '',
		widget: FALSE,
		width: FALSE
	},
	events: {
		render: NULL,
		move: NULL,
		show: NULL,
		hide: NULL,
		toggle: NULL,
		focus: NULL,
		blur: NULL
	}
};

function Ajax(api)
{
	var self = this,
		tooltip = api.elements.tooltip,
		opts = api.options.content.ajax,
		namespace = '.qtip-ajax',
		rscript = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,
		first = TRUE;

	api.checks.ajax = {
		'^content.ajax': function(obj, name, v) {
			// If content.ajax object was reset, set our local var
			if(name === 'ajax') { opts = v; }

			if(name === 'once') {
				self.init();
			}
			else if(opts && opts.url) {
				self.load();
			}
			else {
				tooltip.unbind(namespace);
			}
		}
	};

	$.extend(self, {
		init: function()
		{
			// Make sure ajax options are enabled and bind event
			if(opts && opts.url) {
				tooltip.unbind(namespace)[ opts.once ? 'one' : 'bind' ]('tooltipshow'+namespace, self.load);
			}

			return self;
		},

		load: function(event, first)
		{
			// Make sure default event hasn't been prevented
			if(event && event.isDefaultPrevented()) { return self; }
			
			var hasSelector = opts.url.indexOf(' '), 
				url = opts.url,
				selector,
				hideFirst = opts.once && !opts.loading && first;

			// If loading option is disabled, hide the tooltip until content is retrieved (first time only)
			if(hideFirst) { tooltip.css('visibility', 'hidden'); }

			// Check if user delcared a content selector like in .load()
			if(hasSelector > -1) {
				selector = url.substr(hasSelector);
				url = url.substr(0, hasSelector);
			}

			// Define common after callback for both success/error handlers
			function after() {
				// Re-display tip if loading and first time, and reset first flag
				if(hideFirst) { tooltip.css('visibility', ''); first = FALSE; }
			}

			// Define success handler
			function successHandler(content) {
				if(selector) {
					// Create a dummy div to hold the results and grab the selector element
					content = $('<div/>')
						// inject the contents of the document in, removing the scripts
						// to avoid any 'Permission Denied' errors in IE
						.append(content.replace(rscript, ""))
						
						// Locate the specified elements
						.find(selector);
				}

				// Set the content
				api.set('content.text', content);

				after(); // Call common callback
			}

			// Error handler
			function errorHandler(xh, status, error){ api.set('content.text', status + ': ' + error); after(); }

			// Setup $.ajax option object and process the request
			$.ajax( $.extend({ success: successHandler, error: errorHandler, context: api }, opts, { url: url }) );
			
			return self;
		}
	});

	self.init();
}


PLUGINS.ajax = function(api)
{
	var self = api.plugins.ajax;
	
	return 'object' === typeof self ? self : (api.plugins.ajax = new Ajax(api));
};

PLUGINS.ajax.initialize = 'render';

// Setup plugin sanitization
PLUGINS.ajax.sanitize = function(options)
{
	var content = options.content, opts;
	if(content && 'ajax' in content) {
		opts = content.ajax;
		if(typeof opts !== 'object') { opts = options.content.ajax = { url: opts }; }
		if('boolean' !== typeof opts.once && opts.once) { opts.once = !!opts.once; }
	}
};

// Extend original api defaults
$.extend(TRUE, QTIP.defaults, {
	content: {
		ajax: {
			loading: TRUE,
			once: TRUE
		}
	}
});

PLUGINS.imagemap = function(area, corner)
{
	if(!area.jquery) { area = $(area); }

	var shape = area.attr('shape').toLowerCase(),
		baseCoords = area.attr('coords').split(','),
		coords = [],
		image = $('img[usemap="#'+area.parent('map').attr('name')+'"]'),
		imageOffset = image.offset(),
		result = {
			width: 0, height: 0,
			offset: { top: 1e10, right: 0, bottom: 0, left: 1e10 }
		},
		i = 0, next = 0;

	// POLY area coordinate calculator
	//	Special thanks to Ed Cradock for helping out with this.
	//	Uses a binary search algorithm to find suitable coordinates.
	function polyCoordinates(result, coords)
	{
		var i = 0,
			compareX = 1, compareY = 1,
			realX = 0, realY = 0,
			newWidth = result.width,
			newHeight = result.height;

		// Use a binary search algorithm to locate most suitable coordinate (hopefully)
		while(newWidth > 0 && newHeight > 0 && compareX > 0 && compareY > 0)
		{
			newWidth = Math.floor(newWidth / 2);
			newHeight = Math.floor(newHeight / 2);

			if(corner.x === 'left'){ compareX = newWidth; }
			else if(corner.x === 'right'){ compareX = result.width - newWidth; }
			else{ compareX += Math.floor(newWidth / 2); }

			if(corner.y === 'top'){ compareY = newHeight; }
			else if(corner.y === 'bottom'){ compareY = result.height - newHeight; }
			else{ compareY += Math.floor(newHeight / 2); }

			i = coords.length; while(i--)
			{
				if(coords.length < 2){ break; }

				realX = coords[i][0] - result.offset.left;
				realY = coords[i][1] - result.offset.top;

				if((corner.x === 'left' && realX >= compareX) ||
				(corner.x === 'right' && realX <= compareX) ||
				(corner.x === 'center' && (realX < compareX || realX > (result.width - compareX))) ||
				(corner.y === 'top' && realY >= compareY) ||
				(corner.y === 'bottom' && realY <= compareY) ||
				(corner.y === 'center' && (realY < compareY || realY > (result.height - compareY)))) {
					coords.splice(i, 1);
				}
			}
		}

		return { left: coords[0][0], top: coords[0][1] };
	}

	// Make sure we account for padding and borders on the image
	imageOffset.left += Math.ceil((image.outerWidth() - image.width()) / 2);
	imageOffset.top += Math.ceil((image.outerHeight() - image.height()) / 2);

	// Parse coordinates into proper array
	if(shape === 'poly') {
		i = baseCoords.length; while(i--)
		{
			next = [ parseInt(baseCoords[--i], 10), parseInt(baseCoords[i+1], 10) ];

			if(next[0] > result.offset.right){ result.offset.right = next[0]; }
			if(next[0] < result.offset.left){ result.offset.left = next[0]; }
			if(next[1] > result.offset.bottom){ result.offset.bottom = next[1]; }
			if(next[1] < result.offset.top){ result.offset.top = next[1]; }

			coords.push(next);
		}
	}
	else {
		coords = $.map(baseCoords, function(coord){ return parseInt(coord, 10); });
	}

	// Calculate details
	switch(shape)
	{
		case 'rect':
			result = {
				width: Math.abs(coords[2] - coords[0]),
				height: Math.abs(coords[3] - coords[1]),
				offset: { left: coords[0], top: coords[1] }
			};
		break;

		case 'circle':
			result = {
				width: coords[2] + 2,
				height: coords[2] + 2,
				offset: { left: coords[0], top: coords[1] }
			};
		break;

		case 'poly':
			$.extend(result, {
				width: Math.abs(result.offset.right - result.offset.left),
				height: Math.abs(result.offset.bottom - result.offset.top)
			});

			if(corner.string() === 'centercenter') {
				result.offset = {
					left: result.offset.left + (result.width / 2),
					top: result.offset.top + (result.height / 2)
				};
			}
			else {
				result.offset = polyCoordinates(result, coords.slice());
			}

			result.width = result.height = 0;
		break;
	}

	// Add image position to offset coordinates
	result.offset.left += imageOffset.left;
	result.offset.top += imageOffset.top;

	return result;
};

// Tip coordinates calculator
function calculateTip(corner, width, height)
{	
	var width2 = Math.ceil(width / 2), height2 = Math.ceil(height / 2),

	// Define tip coordinates in terms of height and width values
	tips = {
		bottomright:	[[0,0],				[width,height],		[width,0]],
		bottomleft:		[[0,0],				[width,0],				[0,height]],
		topright:		[[0,height],		[width,0],				[width,height]],
		topleft:			[[0,0],				[0,height],				[width,height]],
		topcenter:		[[0,height],		[width2,0],				[width,height]],
		bottomcenter:	[[0,0],				[width,0],				[width2,height]],
		rightcenter:	[[0,0],				[width,height2],		[0,height]],
		leftcenter:		[[width,0],			[width,height],		[0,height2]]
	};

	// Set common side shapes
	tips.lefttop = tips.bottomright; tips.righttop = tips.bottomleft;
	tips.leftbottom = tips.topright; tips.rightbottom = tips.topleft;

	return tips[ corner.string() ];
}


function Tip(qTip, command)
{
	var self = this,
		opts = qTip.options.style.tip,
		elems = qTip.elements,
		tooltip = elems.tooltip,
		cache = { 
			top: 0, 
			left: 0, 
			corner: ''
		},
		size = {
			width: opts.width,
			height: opts.height
		},
		color = { },
		border = opts.border || 0,
		namespace = '.qtip-tip',
		hasCanvas = !!($('<canvas />')[0] || {}).getContext;

	self.corner = NULL;
	self.mimic = NULL;
	self.border = border;
	self.offset = opts.offset;
	self.size = size;

	// Add new option checks for the plugin
	qTip.checks.tip = {
		'^position.my|style.tip.(corner|mimic|border)$': function() {
			// Make sure a tip can be drawn
			if(!self.init()) {
				self.destroy();
			}

			// Reposition the tooltip
			qTip.reposition();
		},
		'^style.tip.(height|width)$': function() {
			// Re-set dimensions and redraw the tip
			size = {
				width: opts.width,
				height: opts.height
			};
			self.create();
			self.update();

			// Reposition the tooltip
			qTip.reposition();
		},
		'^content.title.text|style.(classes|widget)$': function() {
			if(elems.tip) {
				self.update();
			}
		}
	};

	function reposition(event, api, pos, viewport) {
		if(!elems.tip) { return; }

		var newCorner = $.extend({}, self.corner),
			adjust = pos.adjusted,
			method = qTip.options.position.adjust.method.split(' '),
			horizontal = method[0],
			vertical = method[1] || method[0],
			shift = { left: FALSE, top: FALSE, x: 0, y: 0 },
			offset, css = {}, props;

		// Make sure our tip position isn't fixed e.g. doesn't adjust with viewport
		if(self.corner.fixed !== TRUE) {
			// Horizontal - Shift or flip method
			if(horizontal === 'shift' && newCorner.precedance === 'x' && adjust.left && newCorner.y !== 'center') {
				newCorner.precedance = newCorner.precedance === 'x' ? 'y' : 'x';
			}
			else if(horizontal === 'flip' && adjust.left){
				newCorner.x = newCorner.x === 'center' ? (adjust.left > 0 ? 'left' : 'right') : (newCorner.x === 'left' ? 'right' : 'left');
			}

			// Vertical - Shift or flip method
			if(vertical === 'shift' && newCorner.precedance === 'y' && adjust.top && newCorner.x !== 'center') {
				newCorner.precedance = newCorner.precedance === 'y' ? 'x' : 'y';
			}
			else if(vertical === 'flip' && adjust.top) {
				newCorner.y = newCorner.y === 'center' ? (adjust.top > 0 ? 'top' : 'bottom') : (newCorner.y === 'top' ? 'bottom' : 'top');
			}

			// Update and redraw the tip if needed (check cached details of last drawn tip)
			if(newCorner.string() !== cache.corner && (cache.top !== adjust.top || cache.left !== adjust.left)) {
				self.update(newCorner, FALSE);
			}
		}

		// Setup tip offset properties
		offset = self.position(newCorner, adjust);
		if(offset.right !== undefined) { offset.left = -offset.right; }
		if(offset.bottom !== undefined) { offset.top = -offset.bottom; }
		offset.user = Math.max(0, opts.offset);

		// Viewport "shift" specific adjustments
		if(shift.left = (horizontal === 'shift' && !!adjust.left)) {
			if(newCorner.x === 'center') {
				css['margin-left'] = shift.x = offset['margin-left'] - adjust.left;
			}
			else {
				props = offset.right !== undefined ?
					[ adjust.left, -offset.left ] : [ -adjust.left, offset.left ];

				if( (shift.x = Math.max(props[0], props[1])) > props[0] ) {
					pos.left -= adjust.left;
					shift.left = FALSE;
				}
				
				css[ offset.right !== undefined ? 'right' : 'left' ] = shift.x;
			}
		}
		if(shift.top = (vertical === 'shift' && !!adjust.top)) {
			if(newCorner.y === 'center') {
				css['margin-top'] = shift.y = offset['margin-top'] - adjust.top;
			}
			else {
				props = offset.bottom !== undefined ?
					[ adjust.top, -offset.top ] : [ -adjust.top, offset.top ];

				if( (shift.y = Math.max(props[0], props[1])) > props[0] ) {
					pos.top -= adjust.top;
					shift.top = FALSE;
				}

				css[ offset.bottom !== undefined ? 'bottom' : 'top' ] = shift.y;
			}
		}

		/*
		 * If the tip is adjusted in both dimensions, or in a
		 * direction that would cause it to be anywhere but the
		 * outer border, hide it!
		 */
		elems.tip.css(css).toggle(
			!((shift.x && shift.y) || (newCorner.x === 'center' && shift.y) || (newCorner.y === 'center' && shift.x))
		);

		// Adjust position to accomodate tip dimensions
		pos.left -= offset.left.charAt ? offset.user : horizontal !== 'shift' || shift.top || !shift.left && !shift.top ? offset.left : 0;
		pos.top -= offset.top.charAt ? offset.user : vertical !== 'shift' || shift.left || !shift.left && !shift.top ? offset.top : 0;

		// Cache details
		cache.left = adjust.left; cache.top = adjust.top;
		cache.corner = newCorner.string();
	}

	/* border width calculator */
	function borderWidth(corner, side, backup) {
		side = !side ? corner[corner.precedance] : side;
		
		var isFluid = tooltip.hasClass(fluidClass),
			isTitleTop = elems.titlebar && corner.y === 'top',
			elem = isTitleTop ? elems.titlebar : elems.content,
			css = 'border-' + side + '-width',
			val;

		// Grab the border-width value (add fluid class if needed)
		tooltip.addClass(fluidClass);
		val = parseInt(elem.css(css), 10);
		val = (backup ? val || parseInt(tooltip.css(css), 10) : val) || 0;
		tooltip.toggleClass(fluidClass, isFluid);

		return val;
	}

	function borderRadius(corner) {
		var isTitleTop = elems.titlebar && corner.y === 'top',
			elem = isTitleTop ? elems.titlebar : elems.content,
			moz = $.browser.mozilla,
			prefix = moz ? '-moz-' : $.browser.webkit ? '-webkit-' : '',
			side = corner.y + (moz ? '' : '-') + corner.x,
			css = prefix + (moz ? 'border-radius-' + side : 'border-' + side + '-radius');

		return parseInt(elem.css(css), 10) || parseInt(tooltip.css(css), 10) || 0;
	}

	function calculateSize(corner) {
		var y = corner.precedance === 'y',
			width = size [ y ? 'width' : 'height' ],
			height = size [ y ? 'height' : 'width' ],
			isCenter = corner.string().indexOf('center') > -1,
			base = width * (isCenter ? 0.5 : 1),
			pow = Math.pow,
			round = Math.round,
			bigHyp, ratio, result,

		smallHyp = Math.sqrt( pow(base, 2) + pow(height, 2) ),
		
		hyp = [
			(border / base) * smallHyp, (border / height) * smallHyp
		];
		hyp[2] = Math.sqrt( pow(hyp[0], 2) - pow(border, 2) );
		hyp[3] = Math.sqrt( pow(hyp[1], 2) - pow(border, 2) );

		bigHyp = smallHyp + hyp[2] + hyp[3] + (isCenter ? 0 : hyp[0]);
		ratio = bigHyp / smallHyp;

		result = [ round(ratio * height), round(ratio * width) ];
		return { height: result[ y ? 0 : 1 ], width: result[ y ? 1 : 0 ] };
	}

	$.extend(self, {
		init: function()
		{
			var enabled = self.detectCorner() && (hasCanvas || $.browser.msie);

			// Determine tip corner and type
			if(enabled) {
				// Create a new tip and draw it
				self.create();
				self.update();

				// Bind update events
				tooltip.unbind(namespace).bind('tooltipmove'+namespace, reposition);
			}
			
			return enabled;
		},

		detectCorner: function()
		{
			var corner = opts.corner,
				posOptions = qTip.options.position,
				at = posOptions.at,
				my = posOptions.my.string ? posOptions.my.string() : posOptions.my;

			// Detect corner and mimic properties
			if(corner === FALSE || (my === FALSE && at === FALSE)) {
				return FALSE;
			}
			else {
				if(corner === TRUE) {
					self.corner = new PLUGINS.Corner(my);
				}
				else if(!corner.string) {
					self.corner = new PLUGINS.Corner(corner);
					self.corner.fixed = TRUE;
				}
			}

			return self.corner.string() !== 'centercenter';
		},

		detectColours: function() {
			var i, fill, border,
				tip = elems.tip.css({ backgroundColor: '', border: '' }),
				corner = self.corner,
				precedance = corner[ corner.precedance ],

				borderSide = 'border-' + precedance + '-color',
				borderSideCamel = 'border' + precedance.charAt(0) + precedance.substr(1) + 'Color',

				invalid = /rgba?\(0, 0, 0(, 0)?\)|transparent/i,
				backgroundColor = 'background-color',
				transparent = 'transparent',

				bodyBorder = $(document.body).css('color'),
				contentColour = qTip.elements.content.css('color'),

				useTitle = elems.titlebar && (corner.y === 'top' || (corner.y === 'center' && tip.position().top + (size.height / 2) + opts.offset < elems.titlebar.outerHeight(1))),
				colorElem = useTitle ? elems.titlebar : elems.content;

			// Apply the fluid class so we can see our CSS values properly
			tooltip.addClass(fluidClass);

			// Detect tip colours from CSS styles
			color.fill = fill = tip.css(backgroundColor);
			color.border = border = tip[0].style[ borderSideCamel ] || tooltip.css(borderSide);

			// Make sure colours are valid
			if(!fill || invalid.test(fill)) {
				color.fill = colorElem.css(backgroundColor) || transparent;
				if(invalid.test(color.fill)) {
					color.fill = tooltip.css(backgroundColor) || fill;
				}
			}
			if(!border || invalid.test(border) || border === bodyBorder) {
				color.border = colorElem.css(borderSide) || transparent;
				if(invalid.test(color.border) || color.border === contentColour) {
					color.border = border;
				}
			}

			// Reset background and border colours
			$('*', tip).add(tip).css(backgroundColor, transparent).css('border', '');

			// Remove fluid class
			tooltip.removeClass(fluidClass);
		},

		create: function()
		{
			var width = size.width,
				height = size.height,
				vml;

			// Remove previous tip element if present
			if(elems.tip) { elems.tip.remove(); }

			// Create tip element and prepend to the tooltip
			elems.tip = $('<div />', { 'class': 'ui-tooltip-tip' }).css({ width: width, height: height }).prependTo(tooltip);

			// Create tip drawing element(s)
			if(hasCanvas) {
				// save() as soon as we create the canvas element so FF2 doesn't bork on our first restore()!
				$('<canvas />').appendTo(elems.tip)[0].getContext('2d').save();
			}
			else {
				vml = '<vml:shape coordorigin="0,0" style="display:inline-block; position:absolute; behavior:url(#default#VML);"></vml:shape>';
				elems.tip.html(vml + vml);
			}
		},

		update: function(corner, position)
		{
			var tip = elems.tip,
				inner = tip.children(),
				width = size.width,
				height = size.height,
				regular = 'px solid ',
				transparent = 'px dashed transparent', // Dashed IE6 border-transparency hack. Awesome!
				mimic = opts.mimic,
				round = Math.round,
				precedance, context, coords, translate, newSize;

			// Re-determine tip if not already set
			if(!corner) { corner = self.corner; }

			// Use corner property if we detect an invalid mimic value
			if(mimic === FALSE) { mimic = corner; }

			// Otherwise inherit mimic properties from the corner object as necessary
			else {
				mimic = new PLUGINS.Corner(mimic);
				mimic.precedance = corner.precedance;

				if(mimic.x === 'inherit') { mimic.x = corner.x; }
				else if(mimic.y === 'inherit') { mimic.y = corner.y; }
				else if(mimic.x === mimic.y) {
					mimic[ corner.precedance ] = corner[ corner.precedance ];
				}
			}
			precedance = mimic.precedance;

			// Update our colours
			self.detectColours();

			// Detect border width, taking into account colours
			if(color.border !== 'transparent' && color.border !== '#123456') {
				// Grab border width
				border = borderWidth(corner, NULL, TRUE);

				// If border width isn't zero, use border color as fill (1.0 style tips)
				if(opts.border === 0 && border > 0) { color.fill = color.border; }

				// Set border width (use detected border width if opts.border is true)
				self.border = border = opts.border !== TRUE ? opts.border : border;
			}

			// Border colour was invalid, set border to zero
			else { self.border = border = 0; }

			// Calculate coordinates
			coords = calculateTip(mimic, width , height);

			// Determine tip size
			self.size = newSize = calculateSize(corner);
			tip.css(newSize);

			// Calculate tip translation
			if(corner.precedance === 'y') {
				translate = [
					round(mimic.x === 'left' ? border : mimic.x === 'right' ? newSize.width - width - border : (newSize.width - width) / 2),
					round(mimic.y === 'top' ?  newSize.height - height : 0)
				];
			}
			else {
				translate = [
					round(mimic.x === 'left' ? newSize.width - width : 0),
					round(mimic.y === 'top' ? border : mimic.y === 'bottom' ? newSize.height - height - border : (newSize.height - height) / 2)
				];
			}

			// Canvas drawing implementation
			if(hasCanvas) {
				// Set the canvas size using calculated size
				inner.attr(newSize);
				
				// Grab canvas context and clear/save it
				context = inner[0].getContext('2d');
				context.restore(); context.save();
				context.clearRect(0,0,3000,3000);
				
				// Translate origin
				context.translate(translate[0], translate[1]);
				
				// Draw the tip
				context.beginPath();
				context.moveTo(coords[0][0], coords[0][1]);
				context.lineTo(coords[1][0], coords[1][1]);
				context.lineTo(coords[2][0], coords[2][1]);
				context.closePath();
				context.fillStyle = color.fill;
				context.strokeStyle = color.border;
				context.lineWidth = border * 2;
				context.lineJoin = 'miter';
				context.miterLimit = 100;
				if(border) { context.stroke(); }
				context.fill();
			}

			// VML (IE Proprietary implementation)
			else {
				// Setup coordinates string
				coords = 'm' + coords[0][0] + ',' + coords[0][1] + ' l' + coords[1][0] +
					',' + coords[1][1] + ' ' + coords[2][0] + ',' + coords[2][1] + ' xe';

				// Setup VML-specific offset for pixel-perfection
				translate[2] = border && /^(r|b)/i.test(corner.string()) ?
					parseFloat($.browser.version, 10) === 8 ? 2 : 1 : 0;

				// Set initial CSS
				inner.css({
					antialias: ''+(mimic.string().indexOf('center') > -1),
					left: translate[0] - (translate[2] * Number(precedance === 'x')),
					top: translate[1] - (translate[2] * Number(precedance === 'y')),
					width: width + border,
					height: height + border
				})
				.each(function(i) {
					var $this = $(this);

					// Set shape specific attributes
					$this[ $this.prop ? 'prop' : 'attr' ]({
						coordsize: (width+border) + ' ' + (height+border),
						path: coords,
						fillcolor: color.fill,
						filled: !!i,
						stroked: !!!i
					})
					.css({ display: border || i ? 'block' : 'none' });

					// Check if border is enabled and add stroke element
					if(!i && $this.html() === '') {
						$this.html(
							'<vml:stroke weight="'+(border*2)+'px" color="'+color.border+'" miterlimit="1000" joinstyle="miter" ' +
							' style="behavior:url(#default#VML); display:inline-block;" />'
						);
					}
				});
			}

			// Position if needed
			if(position !== FALSE) { self.position(corner); }
		},

		// Tip positioning method
		position: function(corner)
		{
			var tip = elems.tip,
				position = {},
				userOffset = Math.max(0, opts.offset),
				precedance, dimensions, corners;

			// Return if tips are disabled or tip is not yet rendered
			if(opts.corner === FALSE || !tip) { return FALSE; }

			// Inherit corner if not provided
			corner = corner || self.corner;
			precedance = corner.precedance;

			// Determine which tip dimension to use for adjustment
			dimensions = calculateSize(corner);

			// Setup corners and offset array
			corners = [ corner.x, corner.y ];
			if(precedance === 'x') { corners.reverse(); }

			// Calculate tip position
			$.each(corners, function(i, side) {
				var b, br;

				if(side === 'center') {
					b = precedance === 'y' ? 'left' : 'top';
					position[ b ] = '50%';
					position['margin-' + b] = -Math.round(dimensions[ precedance === 'y' ? 'width' : 'height' ] / 2) + userOffset;
				}
				else {
					b = borderWidth(corner, side, TRUE);
					br = borderRadius(corner);
					
					position[ side ] = i ?
						border ? borderWidth(corner, side) : 0 : 
						userOffset + (br > b ? br : 0);
				}
			});

			// Adjust for tip dimensions
			position[ corner[precedance] ] -= dimensions[ precedance === 'x' ? 'width' : 'height' ];

			// Set and return new position
			tip.css({ top: '', bottom: '', left: '', right: '', margin: '' }).css(position);
			return position;
		},
		
		destroy: function()
		{
			// Remov tip and bound events
			if(elems.tip) { elems.tip.remove(); }
			tooltip.unbind(namespace);
		}
	});
	
	self.init();
}

PLUGINS.tip = function(api)
{
	var self = api.plugins.tip;
	
	return 'object' === typeof self ? self : (api.plugins.tip = new Tip(api));
};

// Initialize tip on render
PLUGINS.tip.initialize = 'render';

// Setup plugin sanitization options
PLUGINS.tip.sanitize = function(options)
{
	var style = options.style, opts;
	if(style && 'tip' in style) {
		opts = options.style.tip;
		if(typeof opts !== 'object'){ options.style.tip = { corner: opts }; }
		if(!(/string|boolean/i).test(typeof opts.corner)) { opts.corner = TRUE; }
		if(typeof opts.width !== 'number'){ delete opts.width; }
		if(typeof opts.height !== 'number'){ delete opts.height; }
		if(typeof opts.border !== 'number' && opts.border !== TRUE){ delete opts.border; }
		if(typeof opts.offset !== 'number'){ delete opts.offset; }
	}
};

// Extend original qTip defaults
$.extend(TRUE, QTIP.defaults, {
	style: {
		tip: {
			corner: TRUE,
			mimic: FALSE,
			width: 6,
			height: 6,
			border: TRUE,
			offset: 0
		}
	}
});

PLUGINS.svg = function(svg, corner)
{
	var doc = $(document),
		elem = svg[0],
		result = {
			width: 0, height: 0,
			offset: { top: 1e10, left: 1e10 }
		},
		box, mtx, root, point, tPoint;

	if (elem.getBBox && elem.parentNode) {
		box = elem.getBBox();
		mtx = elem.getScreenCTM();
		root = elem.farthestViewportElement || elem;

		// Return if no method is found
		if(!root.createSVGPoint) { return result; }

		// Create our point var
		point = root.createSVGPoint();

		// Adjust top and left
		point.x = box.x;
		point.y = box.y;
		tPoint = point.matrixTransform(mtx);
		result.offset.left = tPoint.x;
		result.offset.top = tPoint.y;

		// Adjust width and height
		point.x += box.width;
		point.y += box.height;
		tPoint = point.matrixTransform(mtx);
		result.width = tPoint.x - result.offset.left;
		result.height = tPoint.y - result.offset.top;

		// Adjust by scroll offset
		result.offset.left += doc.scrollLeft();
		result.offset.top += doc.scrollTop();
	}

	return result;
};

function Modal(api)
{
	var self = this,
		options = api.options.show.modal,
		elems = api.elements,
		tooltip = elems.tooltip,
		overlaySelector = '#qtip-overlay',
		globalNamespace = '.qtipmodal',
		namespace = globalNamespace + api.id,
		attr = 'is-modal-qtip',
		docBody = $(document.body),
		overlay;

	// Setup option set checks
	api.checks.modal = {
		'^show.modal.(on|blur)$': function() {
			// Initialise
			self.init();
			
			// Show the modal if not visible already and tooltip is visible
			elems.overlay.toggle( tooltip.is(':visible') );
		}
	};

	$.extend(self, {
		init: function()
		{
			// If modal is disabled... return
			if(!options.on) { return self; }

			// Create the overlay if needed
			overlay = self.create();

			// Add unique attribute so we can grab modal tooltips easily via a selector
			tooltip.attr(attr, TRUE)

			// Remove previous bound events in globalNamespace
			.unbind(globalNamespace).unbind(namespace)

			// Apply our show/hide/focus modal events
			.bind('tooltipshow'+globalNamespace+' tooltiphide'+globalNamespace, function(event, api, duration) {
				var oEvent = event.originalEvent;
				
				// Make sure mouseout doesn't trigger a hide when showing the modal and mousing onto backdrop
				if(oEvent && event.type === 'tooltiphide' && /mouse(leave|enter)/.test(oEvent.type) && $(oEvent.relatedTarget).closest(overlay[0]).length) {
					event.preventDefault();
				}
				else {
					self[ event.type.replace('tooltip', '') ](event, duration);
				}
			})

			// Adjust modal z-index on tooltip focus
			.bind('tooltipfocus'+globalNamespace, function(event, api, zIndex) {
				overlay[0].style.zIndex = zIndex;
			})

			// Focus any other visible modals when this one blurs
			.bind('tooltipblur'+globalNamespace, function(event) {
				$('[' + attr + ']:visible').not(tooltip).last().qtip('focus', event);
			});

			// Apply keyboard "Escape key" close handler
			if(options.escape) {
				$(window).unbind(namespace).bind('keydown'+namespace, function(event) {
					if(event.keyCode === 27 && tooltip.hasClass(focusClass)) {
						api.hide(event);
					}
				});
			}

			// Apply click handler for blur option
			if(options.blur) {
				elems.overlay.unbind(namespace).bind('click'+namespace, function(event) {
					if(tooltip.hasClass(focusClass)) { api.hide(event); }
				});
			}

			return self;
		},

		create: function()
		{
			var elem = $(overlaySelector);

			// Return if overlay is already rendered
			if(elem.length) { elems.overlay = elem; return elem; }

			// Create document overlay
			overlay = elems.overlay = $('<div />', {
				id: overlaySelector.substr(1),
				html: '<div></div>',
				mousedown: function() { return FALSE; }
			})
			.insertBefore( $(selector).last() );

			// Update position on window resize or scroll
			$(window).unbind(globalNamespace).bind('resize'+globalNamespace, function() {
				overlay.css({
					height: $(window).height(),
					width: $(window).width()
				});
			})
			.triggerHandler('resize');

			return overlay;
		},

		toggle: function(event, state, duration)
		{
			// Make sure default event hasn't been prevented
			if(event && event.isDefaultPrevented()) { return self; }

			var effect = options.effect,
				type = state ? 'show': 'hide',
				visible = overlay.is(':visible'),
				modals = $('[' + attr + ']:visible').not(tooltip),
				zindex;

			// Create our overlay if it isn't present already
			if(!overlay) { overlay = self.create(); }

			// Prevent modal from conflicting with show.solo, and don't hide backdrop is other modals are visible
			if((overlay.is(':animated') && visible === state) || (!state && modals.length)) { return self; }

			// State specific...
			if(state) {
				// Set position
				overlay.css({ left: 0, top: 0 });

				// Toggle backdrop cursor style on show
				overlay.toggleClass('blurs', options.blur);

				// Make sure we can't focus anything outside the tooltip
				docBody.delegate('*', 'focusin'+namespace, function(event) {
					if($(event.target).closest(selector)[0] !== tooltip[0]) {
						$('a, :input, img', tooltip).add(tooltip).focus();
					}
				});
			}
			else {
				// Undelegate focus handler
				docBody.undelegate('*', 'focusin'+namespace);
			}

			// Stop all animations
			overlay.stop(TRUE, FALSE);

			// Use custom function if provided
			if($.isFunction(effect)) {
				effect.call(overlay, state);
			}

			// If no effect type is supplied, use a simple toggle
			else if(effect === FALSE) {
				overlay[ type ]();
			}

			// Use basic fade function
			else {
				overlay.fadeTo( parseInt(duration, 10) || 90, state ? 1 : 0, function() {
					if(!state) { $(this).hide(); }
				});
			}

			// Reset position on hide
			if(!state) {
				overlay.queue(function(next) {
					overlay.css({ left: '', top: '' });
					next();
				});
			}

			return self;
		},

		show: function(event, duration) { return self.toggle(event, TRUE, duration); },
		hide: function(event, duration) { return self.toggle(event, FALSE, duration); },

		destroy: function()
		{
			var delBlanket = overlay;

			if(delBlanket) {
				// Check if any other modal tooltips are present
				delBlanket = $('[' + attr + ']').not(tooltip).length < 1;

				// Remove overlay if needed
				if(delBlanket) {
					elems.overlay.remove();
					$(window).unbind(globalNamespace);
				}
				else {
					elems.overlay.unbind(globalNamespace+api.id);
				}

				// Undelegate focus handler
				docBody.undelegate('*', 'focusin'+namespace);
			}

			// Remove bound events
			return tooltip.removeAttr(attr).unbind(globalNamespace);
		}
	});

	self.init();
}

PLUGINS.modal = function(api)
{
	var self = api.plugins.modal;

	return 'object' === typeof self ? self : (api.plugins.modal = new Modal(api));
};

// Plugin needs to be initialized on render
PLUGINS.modal.initialize = 'render';

// Setup sanitiztion rules
PLUGINS.modal.sanitize = function(opts) {
	if(opts.show) { 
		if(typeof opts.show.modal !== 'object') { opts.show.modal = { on: !!opts.show.modal }; }
		else if(typeof opts.show.modal.on === 'undefined') { opts.show.modal.on = TRUE; }
	}
};

// Extend original api defaults
$.extend(TRUE, QTIP.defaults, {
	show: {
		modal: {
			on: FALSE,
			effect: TRUE,
			blur: TRUE,
			escape: TRUE
		}
	}
});

/* 
 * BGIFrame adaption (http://plugins.jquery.com/project/bgiframe)
 * Special thanks to Brandon Aaron
 */
function BGIFrame(api)
{
	var self = this,
		elems = api.elements,
		tooltip = elems.tooltip,
		namespace = '.bgiframe-' + api.id;

	$.extend(self, {
		init: function()
		{
			// Create the BGIFrame element
			elems.bgiframe = $('<iframe class="ui-tooltip-bgiframe" frameborder="0" tabindex="-1" src="javascript:\'\';" ' +
				' style="display:block; position:absolute; z-index:-1; filter:alpha(opacity=0); ' +
					'-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";"></iframe>');

			// Append the new element to the tooltip
			elems.bgiframe.appendTo(tooltip);

			// Update BGIFrame on tooltip move
			tooltip.bind('tooltipmove'+namespace, self.adjust);
		},

		adjust: function()
		{
			var dimensions = api.get('dimensions'), // Determine current tooltip dimensions
				plugin = api.plugins.tip,
				tip = elems.tip,
				tipAdjust, offset;

			// Adjust border offset
			offset = parseInt(tooltip.css('border-left-width'), 10) || 0;
			offset = { left: -offset, top: -offset };

			// Adjust for tips plugin
			if(plugin && tip) {
				tipAdjust = (plugin.corner.precedance === 'x') ? ['width', 'left'] : ['height', 'top'];
				offset[ tipAdjust[1] ] -= tip[ tipAdjust[0] ]();
			}

			// Update bgiframe
			elems.bgiframe.css(offset).css(dimensions);
		},

		destroy: function()
		{
			// Remove iframe
			elems.bgiframe.remove();

			// Remove bound events
			tooltip.unbind(namespace);
		}
	});

	self.init();
}

PLUGINS.bgiframe = function(api)
{
	var browser = $.browser,
		self = api.plugins.bgiframe;
	
		// Proceed only if the browser is IE6 and offending elements are present
		if($('select, object').length < 1 || !(browser.msie && browser.version.charAt(0) === '6')) {
		return FALSE;
	}

	return 'object' === typeof self ? self : (api.plugins.bgiframe = new BGIFrame(api));
};

// Plugin needs to be initialized on render
PLUGINS.bgiframe.initialize = 'render';


}(jQuery, window));
/**
 * jQuery.ScrollTo
 * Copyright (c) 2007-2009 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com
 * Dual licensed under MIT and GPL.
 * Date: 3/9/2009
 *
 * @projectDescription Easy element scrolling using jQuery.
 * http://flesler.blogspot.com/2007/10/jqueryscrollto.html
 * Works with jQuery +1.2.6. Tested on FF 2/3, IE 6/7/8, Opera 9.5/6, Safari 3, Chrome 1 on WinXP.
 *
 * @author Ariel Flesler
 * @version 1.4.1
 *
 * @id jQuery.scrollTo
 * @id jQuery.fn.scrollTo
 * @param {String, Number, DOMElement, jQuery, Object} target Where to scroll the matched elements.
 *	  The different options for target are:
 *		- A number position (will be applied to all axes).
 *		- A string position ('44', '100px', '+=90', etc ) will be applied to all axes
 *		- A jQuery/DOM element ( logically, child of the element to scroll )
 *		- A string selector, that will be relative to the element to scroll ( 'li:eq(2)', etc )
 *		- A hash { top:x, left:y }, x and y can be any kind of number/string like above.
 *		- The string 'max' for go-to-end. 
 * @param {Number} duration The OVERALL length of the animation, this argument can be the settings object instead.
 * @param {Object,Function} settings Optional set of settings or the onAfter callback.
 *	 @option {String} axis Which axis must be scrolled, use 'x', 'y', 'xy' or 'yx'.
 *	 @option {Number} duration The OVERALL length of the animation.
 *	 @option {String} easing The easing method for the animation.
 *	 @option {Boolean} margin If true, the margin of the target element will be deducted from the final position.
 *	 @option {Object, Number} offset Add/deduct from the end position. One number for both axes or { top:x, left:y }.
 *	 @option {Object, Number} over Add/deduct the height/width multiplied by 'over', can be { top:x, left:y } when using both axes.
 *	 @option {Boolean} queue If true, and both axis are given, the 2nd axis will only be animated after the first one ends.
 *	 @option {Function} onAfter Function to be called after the scrolling ends. 
 *	 @option {Function} onAfterFirst If queuing is activated, this function will be called after the first scrolling ends.
 * @return {jQuery} Returns the same jQuery object, for chaining.
 *
 * @desc Scroll to a fixed position
 * @example $('div').scrollTo( 340 );
 *
 * @desc Scroll relatively to the actual position
 * @example $('div').scrollTo( '+=340px', { axis:'y' } );
 *
 * @dec Scroll using a selector (relative to the scrolled element)
 * @example $('div').scrollTo( 'p.paragraph:eq(2)', 500, { easing:'swing', queue:true, axis:'xy' } );
 *
 * @ Scroll to a DOM element (same for jQuery object)
 * @example var second_child = document.getElementById('container').firstChild.nextSibling;
 *			$('#container').scrollTo( second_child, { duration:500, axis:'x', onAfter:function(){
 *				alert('scrolled!!');																   
 *			}});
 *
 * @desc Scroll on both axes, to different values
 * @example $('div').scrollTo( { top: 300, left:'+=200' }, { axis:'xy', offset:-20 } );
 */
;(function( $ ){
	
	var $scrollTo = $.scrollTo = function( target, duration, settings ){
		$(window).scrollTo( target, duration, settings );
	};

	$scrollTo.defaults = {
		axis:'xy',
		duration: parseFloat($.fn.jquery) >= 1.3 ? 0 : 1
	};

	// Returns the element that needs to be animated to scroll the window.
	// Kept for backwards compatibility (specially for localScroll & serialScroll)
	$scrollTo.window = function( scope ){
		return $(window).scrollable();
	};

	// Hack, hack, hack... stay away!
	// Returns the real elements to scroll (supports window/iframes, documents and regular nodes)
	$.fn.scrollable = function(){
		return this.map(function(){
			var elem = this,
				isWin = !elem.nodeName || $.inArray( elem.nodeName.toLowerCase(), ['iframe','#document','html','body'] ) != -1;

				if( !isWin )
					return elem;

			var doc = (elem.contentWindow || elem).document || elem.ownerDocument || elem;
			
			return $.browser.safari || doc.compatMode == 'BackCompat' ?
				doc.body : 
				doc.documentElement;
		});
	};

	$.fn.scrollTo = function( target, duration, settings ){
		if( typeof duration == 'object' ){
			settings = duration;
			duration = 0;
		}
		if( typeof settings == 'function' )
			settings = { onAfter:settings };
			
		if( target == 'max' )
			target = 9e9;
			
		settings = $.extend( {}, $scrollTo.defaults, settings );
		// Speed is still recognized for backwards compatibility
		duration = duration || settings.speed || settings.duration;
		// Make sure the settings are given right
		settings.queue = settings.queue && settings.axis.length > 1;
		
		if( settings.queue )
			// Let's keep the overall duration
			duration /= 2;
		settings.offset = both( settings.offset );
		settings.over = both( settings.over );

		return this.scrollable().each(function(){
			var elem = this,
				$elem = $(elem),
				targ = target, toff, attr = {},
				win = $elem.is('html,body');

			switch( typeof targ ){
				// A number will pass the regex
				case 'number':
				case 'string':
					if( /^([+-]=)?\d+(\.\d+)?(px)?$/.test(targ) ){
						targ = both( targ );
						// We are done
						break;
					}
					// Relative selector, no break!
					targ = $(targ,this);
				case 'object':
					// DOMElement / jQuery
					if( targ.is || targ.style )
						// Get the real position of the target 
						toff = (targ = $(targ)).offset();
			}
			$.each( settings.axis.split(''), function( i, axis ){
				var Pos	= axis == 'x' ? 'Left' : 'Top',
					pos = Pos.toLowerCase(),
					key = 'scroll' + Pos,
					old = elem[key],
					Dim = axis == 'x' ? 'Width' : 'Height';

				if( toff ){// jQuery / DOMElement
					attr[key] = toff[pos] + ( win ? 0 : old - $elem.offset()[pos] );

					// If it's a dom element, reduce the margin
					if( settings.margin ){
						attr[key] -= parseInt(targ.css('margin'+Pos)) || 0;
						attr[key] -= parseInt(targ.css('border'+Pos+'Width')) || 0;
					}
					
					attr[key] += settings.offset[pos] || 0;
					
					if( settings.over[pos] )
						// Scroll to a fraction of its width/height
						attr[key] += targ[Dim.toLowerCase()]() * settings.over[pos];
				}else
					attr[key] = targ[pos];

				// Number or 'number'
				if( /^\d+$/.test(attr[key]) )
					// Check the limits
					attr[key] = attr[key] <= 0 ? 0 : Math.min( attr[key], max(Dim) );

				// Queueing axes
				if( !i && settings.queue ){
					// Don't waste time animating, if there's no need.
					if( old != attr[key] )
						// Intermediate animation
						animate( settings.onAfterFirst );
					// Don't animate this axis again in the next iteration.
					delete attr[key];
				}
			});

			animate( settings.onAfter );			

			function animate( callback ){
				$elem.animate( attr, duration, settings.easing, callback && function(){
					callback.call(this, target, settings);
				});
			};

			// Max scrolling position, works on quirks mode
			// It only fails (not too badly) on IE, quirks mode.
			function max( Dim ){
				var scroll = 'scroll'+Dim;
				
				if( !win )
					return elem[scroll];
				
				var size = 'client' + Dim,
					html = elem.ownerDocument.documentElement,
					body = elem.ownerDocument.body;

				return Math.max( html[scroll], body[scroll] ) 
					 - Math.min( html[size]  , body[size]   );
					
			};

		}).end();
	};

	function both( val ){
		return typeof val == 'object' ? val : { top:val, left:val };
	};

})( jQuery );


/*!
 * jQuery.SerialScroll
 * Copyright (c) 2007-2008 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com
 * Dual licensed under MIT and GPL.
 * Date: 06/14/2009
 *
 * @projectDescription Animated scrolling of series.
 * @author Ariel Flesler
 * @version 1.2.2
 *
 * @id jQuery.serialScroll
 * @id jQuery.fn.serialScroll
 * @param {Object} settings Hash of settings, it is passed in to jQuery.ScrollTo, none is required.
 * @return {jQuery} Returns the same jQuery object, for chaining.
 *
 * @link {http://flesler.blogspot.com/2008/02/jqueryserialscroll.html Homepage}
 *
 * Notes:
 *	- The plugin requires jQuery.ScrollTo.
 *	- The hash of settings, is passed to jQuery.ScrollTo, so its settings can be used as well.
 */
;(function( $ ){

	var $serialScroll = $.serialScroll = function( settings ){
		return $(window).serialScroll( settings );
	};

	// Many of these defaults, belong to jQuery.ScrollTo, check it's demo for an example of each option.
	// @link {http://demos.flesler.com/jquery/scrollTo/ ScrollTo's Demo}
	$serialScroll.defaults = {// the defaults are public and can be overriden.
		duration:1000, // how long to animate.
		axis:'x', // which of top and left should be scrolled
		event:'click', // on which event to react.
		start:0, // first element (zero-based index)
		step:1, // how many elements to scroll on each action
		lock:true,// ignore events if already animating
		cycle:true, // cycle endlessly ( constant velocity )
		constant:true // use contant speed ?
		/*
		navigation:null,// if specified, it's a selector a collection of items to navigate the container
		target:window, // if specified, it's a selector to the element to be scrolled.
		interval:0, // it's the number of milliseconds to automatically go to the next
		lazy:false,// go find the elements each time (allows AJAX or JS content, or reordering)
		stop:false, // stop any previous animations to avoid queueing
		force:false,// force the scroll to the first element on start ?
		jump: false,// if true, when the event is triggered on an element, the pane scrolls to it
		items:null, // selector to the items (relative to the matched elements)
		prev:null, // selector to the 'prev' button
		next:null, // selector to the 'next' button
		onBefore: function(){}, // function called before scrolling, if it returns false, the event is ignored
		exclude:0 // exclude the last x elements, so we cannot scroll past the end
		*/
	};

	$.fn.serialScroll = function( options ){

		return this.each(function(){
			var 
				settings = $.extend( {}, $serialScroll.defaults, options ),
				event = settings.event, // this one is just to get shorter code when compressed
				step = settings.step, // ditto
				lazy = settings.lazy, // ditto
				context = settings.target ? this : document, // if a target is specified, then everything's relative to 'this'.
				$pane = $(settings.target || this, context),// the element to be scrolled (will carry all the events)
				pane = $pane[0], // will be reused, save it into a variable
				items = settings.items, // will hold a lazy list of elements
				active = settings.start, // active index
				auto = settings.interval, // boolean, do auto or not
				nav = settings.navigation, // save it now to make the code shorter
				timer; // holds the interval id

			if( !lazy )// if not lazy, save the items now
				items = getItems();

			if( settings.force )
				jump( {}, active );// generate an initial call

			// Button binding, optional
			$(settings.prev||[], context).bind( event, -step, move );
			$(settings.next||[], context).bind( event, step, move );

			// Custom events bound to the container
			if( !pane.ssbound )// don't bind more than once
				$pane
					.bind('prev.serialScroll', -step, move ) // you can trigger with just 'prev'
					.bind('next.serialScroll', step, move ) // f.e: $(container).trigger('next');
					.bind('goto.serialScroll', jump ); // f.e: $(container).trigger('goto', 4 );

			if( auto )
				$pane
					.bind('start.serialScroll', function(e){
						if( !auto ){
							clear();
							auto = true;
							next();
						}
					 })
					.bind('stop.serialScroll', function(){// stop a current animation
						clear();
						auto = false;
					});

			$pane.bind('notify.serialScroll', function(e, elem){// let serialScroll know that the index changed externally
				var i = index(elem);
				if( i > -1 )
					active = i;
			});

			pane.ssbound = true;// avoid many bindings

			if( settings.jump )// can't use jump if using lazy items and a non-bubbling event
				(lazy ? $pane : getItems()).bind( event, function( e ){
					jump( e, index(e.target) );
				});

			if( nav )
				nav = $(nav, context).bind(event, function( e ){
					e.data = Math.round(getItems().length / nav.length) * nav.index(this);
					jump( e, this );
				});

			function move( e ){
				e.data += active;
				jump( e, this );
			};
			function jump( e, button ){
				if( !isNaN(button) ){// initial or special call from the outside $(container).trigger('goto',[index]);
					e.data = button;
					button = pane;
				}

				var
					pos = e.data, n,
					real = e.type, // is a real event triggering ?
					$items = settings.exclude ? getItems().slice(0,-settings.exclude) : getItems(),// handle a possible exclude
					limit = $items.length,
					elem = $items[pos],
					duration = settings.duration;

				if( real )// real event object
					e.preventDefault();

				if( auto ){
					clear();// clear any possible automatic scrolling.
					timer = setTimeout( next, settings.interval ); 
				}

				if( !elem ){ // exceeded the limits
					n = pos < 0 ? 0 : limit - 1;
					if( active != n )// we exceeded for the first time
						pos = n;
					else if( !settings.cycle )// this is a bad case
						return;
					else
						pos = limit - n - 1;// invert, go to the other side
					elem = $items[pos];
				}

				if( !elem || settings.lock && $pane.is(':animated') || // no animations while busy
					real && settings.onBefore &&
					settings.onBefore(e, elem, $pane, getItems(), pos) === false ) return;

				if( settings.stop )
					$pane.queue('fx',[]).stop();// remove all its animations

				if( settings.constant )
					duration = Math.abs(duration/step * (active - pos ));// keep constant velocity

				$pane
					.scrollTo( elem, duration, settings )// do scroll
					.trigger('notify.serialScroll',[pos]);// in case serialScroll was called on this elem more than once.
			};

			function next(){// I'll use the namespace to avoid conflicts
				$pane.trigger('next.serialScroll');
			};

			function clear(){
				clearTimeout(timer);
			};

			function getItems(){
				return $( items, pane );
			};

			function index( elem ){
				if( !isNaN(elem) ) return elem;// number
				var $items = getItems(), i;
				while(( i = $items.index(elem)) == -1 && elem != pane )// see if it matches or one of its ancestors
					elem = elem.parentNode;
				return i;
			};
		});
	};

})( jQuery );
/**
 * Isotope v1.4.110721
 * An exquisite jQuery plugin for magical layouts
 * http://isotope.metafizzy.co
 *
 * Commercial use requires one-time license fee
 * http://metafizzy.co/#licenses
 *
 * Copyright 2011 David DeSandro / Metafizzy
 */

/*jshint curly: true, eqeqeq: true, forin: false, immed: false, newcap: true, noempty: true, undef: true */
/*global Modernizr: true */

(function( window, $, undefined ){

  // helper function
  function capitalize(str) {
    return str.charAt(0).toUpperCase() + str.slice(1);
  }

  // ========================= getStyleProperty by kangax ===============================
  // http://perfectionkills.com/feature-testing-css-properties/

  var prefixes = 'Moz Webkit Khtml O Ms'.split(' ');

  function getStyleProperty( propName ) {
    var style = document.documentElement.style,
        prefixed;

    // test standard property first
    if ( typeof style[propName] === 'string' ) {
      return propName;
    }

    // capitalize
    propName = capitalize( propName );

    // test vendor specific properties
    for ( var i=0, len = prefixes.length; i < len; i++ ) {
      prefixed = prefixes[i] + propName;
      if ( typeof style[ prefixed ] === 'string' ) {
        return prefixed;
      }
    }
  }

  var transformProp = getStyleProperty('transform');

  // ========================= miniModernizr ===============================
  // <3<3<3 and thanks to Faruk and Paul for doing the heavy lifting

  /*!
   * Modernizr v1.6ish: miniModernizr for Isotope
   * http://www.modernizr.com
   *
   * Developed by: 
   * - Faruk Ates  http://farukat.es/
   * - Paul Irish  http://paulirish.com/
   *
   * Copyright (c) 2009-2010
   * Dual-licensed under the BSD or MIT licenses.
   * http://www.modernizr.com/license/
   */

  /*
   * This version whittles down the script just to check support for
   * CSS transitions, transforms, and 3D transforms.
  */
  
  var tests = {
    csstransforms: function() {
      return !!transformProp;
    },

    csstransforms3d: function() {
      var test = !!getStyleProperty('perspective');
      // double check for Chrome's false positive
      if ( test ) {
        var vendorCSSPrefixes = ' -o- -moz- -ms- -webkit- -khtml- '.split(' '),
            mediaQuery = '@media (' + vendorCSSPrefixes.join('transform-3d),(') + 'modernizr)',
            $style = $('<style>' + mediaQuery + '{#modernizr{height:3px}}' + '</style>')
                        .appendTo('head'),
            $div = $('<div id="modernizr" />').appendTo('html');

        test = $div.height() === 3;

        $div.remove();
        $style.remove();
      }
      return test;
    },

    csstransitions: function() {
      return !!getStyleProperty('transitionProperty');
    }
  };

  if ( window.Modernizr ) {
    // if there's a previous Modernzir, check if there are necessary tests
    for ( var testName in tests) {
      if ( !Modernizr.hasOwnProperty( testName ) ) {
        // if test hasn't been run, use addTest to run it
        Modernizr.addTest( testName, tests[ testName ] );
      }
    }
  } else {
    // or create new mini Modernizr that just has the 3 tests
    window.Modernizr = (function(){

      var miniModernizr = {
            _version : '1.6ish: miniModernizr for Isotope'
          },
          classes = ' ',
          result, testName;

      // Run through tests
      for ( testName in tests) {
        result = tests[ testName ]();
        miniModernizr[ testName ] = result;
        classes += ' ' + ( result ?  '' : 'no-' ) + testName;
      }

      // Add the new classes to the <html> element.
      $('html').addClass( classes );

      return miniModernizr;
    })();
  }



  // ========================= isoTransform ===============================

  /**
   *  provides hooks for .css({ scale: value, translate: [x, y] })
   *  Progressively enhanced CSS transforms
   *  Uses hardware accelerated 3D transforms for Safari
   *  or falls back to 2D transforms.
   */
  
  if ( Modernizr.csstransforms ) {
    
        // i.e. transformFnNotations.scale(0.5) >> 'scale3d( 0.5, 0.5, 1)'
    var transformFnNotations = Modernizr.csstransforms3d ? 
      { // 3D transform functions
        translate : function ( position ) {
          return 'translate3d(' + position[0] + 'px, ' + position[1] + 'px, 0) ';
        },
        scale : function ( scale ) {
          return 'scale3d(' + scale + ', ' + scale + ', 1) ';
        }
      } :
      { // 2D transform functions
        translate : function ( position ) {
          return 'translate(' + position[0] + 'px, ' + position[1] + 'px) ';
        },
        scale : function ( scale ) {
          return 'scale(' + scale + ') ';
        }
      }
    ;

    var setIsoTransform = function ( elem, name, value ) {
          // unpack current transform data
      var data =  $.data( elem, 'isoTransform' ) || {},
          newData = {},
          fnName,
          transformObj = {},
          transformValue;

      // i.e. newData.scale = 0.5
      newData[ name ] = value;
      // extend new value over current data
      $.extend( data, newData );

      for ( fnName in data ) {
        transformValue = data[ fnName ];
        transformObj[ fnName ] = transformFnNotations[ fnName ]( transformValue );
      }

      // get proper order
      // ideally, we could loop through this give an array, but since we only have
      // a couple transforms we're keeping track of, we'll do it like so
      var translateFn = transformObj.translate || '',
          scaleFn = transformObj.scale || '',
          // sorting so translate always comes first
          valueFns = translateFn + scaleFn;

      // set data back in elem
      $.data( elem, 'isoTransform', data );

      // set name to vendor specific property
      elem.style[ transformProp ] = valueFns;
    };
   
    // ==================== scale ===================
  
    $.cssNumber.scale = true;
  
    $.cssHooks.scale = {
      set: function( elem, value ) {
        // uncomment this bit if you want to properly parse strings
        // if ( typeof value === 'string' ) {
        //   value = parseFloat( value );
        // }
        setIsoTransform( elem, 'scale', value );
      },
      get: function( elem, computed ) {
        var transform = $.data( elem, 'isoTransform' );
        return transform && transform.scale ? transform.scale : 1;
      }
    };

    $.fx.step.scale = function( fx ) {
      $.cssHooks.scale.set( fx.elem, fx.now+fx.unit );
    };
  
  
    // ==================== translate ===================
    
    $.cssNumber.translate = true;
  
    $.cssHooks.translate = {
      set: function( elem, value ) {

        // uncomment this bit if you want to properly parse strings
        // if ( typeof value === 'string' ) {
        //   value = value.split(' ');
        // }
        // 
        // var i, val;
        // for ( i = 0; i < 2; i++ ) {
        //   val = value[i];
        //   if ( typeof val === 'string' ) {
        //     val = parseInt( val );
        //   }
        // }

        setIsoTransform( elem, 'translate', value );
      },
    
      get: function( elem, computed ) {
        var transform = $.data( elem, 'isoTransform' );
        return transform && transform.translate ? transform.translate : [ 0, 0 ];
      }
    };

  }



  /*
   * smartresize: debounced resize event for jQuery
   *
   * latest version and complete README available on Github:
   * https://github.com/louisremi/jquery.smartresize.js
   *
   * Copyright 2011 @louis_remi
   * Licensed under the MIT license.
   */

  var $event = $.event,
      resizeTimeout;

  $event.special.smartresize = {
    setup: function() {
      $(this).bind( "resize", $event.special.smartresize.handler );
    },
    teardown: function() {
      $(this).unbind( "resize", $event.special.smartresize.handler );
    },
    handler: function( event, execAsap ) {
      // Save the context
      var context = this,
          args = arguments;

      // set correct event type
      event.type = "smartresize";

      if ( resizeTimeout ) { clearTimeout( resizeTimeout ); }
      resizeTimeout = setTimeout(function() {
        jQuery.event.handle.apply( context, args );
      }, execAsap === "execAsap"? 0 : 100 );
    }
  };

  $.fn.smartresize = function( fn ) {
    return fn ? this.bind( "smartresize", fn ) : this.trigger( "smartresize", ["execAsap"] );
  };



// ========================= Isotope ===============================


  // our "Widget" object constructor
  $.Isotope = function( options, element ){
    this.element = $( element );

    this._create( options );
    this._init();
  };
  
  // styles of container element we want to keep track of
  var isoContainerStyles = [ 'overflow', 'position', 'width', 'height' ];
  
  $.Isotope.settings = {
    resizable: true,
    layoutMode : 'masonry',
    containerClass : 'isotope',
    itemClass : 'isotope-item',
    hiddenClass : 'isotope-hidden',
    hiddenStyle : Modernizr.csstransforms && !$.browser.opera ? 
      { opacity : 0, scale : 0.001 } : // browsers support CSS transforms, not Opera
      { opacity : 0 }, // other browsers, including Opera
    visibleStyle : Modernizr.csstransforms && !$.browser.opera ? 
      { opacity : 1, scale : 1 } : // browsers support CSS transforms, not Opera
      { opacity : 1 },  // other browsers, including Opera
    animationEngine : $.browser.opera ? 'jquery' : 'best-available',
    animationOptions: {
      queue: false,
      duration: 800
    },
    sortBy : 'original-order',
    sortAscending : true,
    resizesContainer : true,
    transformsEnabled : true,
    itemPositionDataEnabled: false
  };

  $.Isotope.prototype = {

    // sets up widget
    _create : function( options ) {
      
      this.options = $.extend( {}, $.Isotope.settings, options );
      
      this.styleQueue = [];
      this.elemCount = 0;

      // get original styles in case we re-apply them in .destroy()
      var elemStyle = this.element[0].style;
      this.originalStyle = {};
      for ( var i=0, len = isoContainerStyles.length; i < len; i++ ) {
        var prop = isoContainerStyles[i];
        this.originalStyle[ prop ] = elemStyle[ prop ] || null;
      }
      
      this.element.css({
        overflow : 'hidden',
        position : 'relative'
      });
      
      this._updateAnimationEngine();
      this._updateUsingTransforms();
      
      // sorting
      var originalOrderSorter = {
        'original-order' : function( $elem, instance ) {
          return instance.elemCount;
        },
        random : function() {
          return Math.random();
        }
      };

      this.options.getSortData = $.extend( this.options.getSortData, originalOrderSorter );

      // need to get atoms
      this.reloadItems();
      
      // get top left position of where the bricks should be
      var $cursor = $( document.createElement('div') ).prependTo( this.element );
      this.offset = $cursor.position();
      $cursor.remove();

      // add isotope class first time around
      var instance = this;
      setTimeout( function() {
        instance.element.addClass( instance.options.containerClass );
      }, 0 );
      
      // bind resize method
      if ( this.options.resizable ) {
        $(window).bind( 'smartresize.isotope', function() { 
          instance.resize();
        });
      }
      
    },
    
    _getAtoms : function( $elems ) {
      var selector = this.options.itemSelector,
          // filter & find 
          $atoms = selector ? $elems.filter( selector ).add( $elems.find( selector ) ) : $elems,
          // base style for atoms
          atomStyle = { position: 'absolute' };
          
      if ( this.usingTransforms ) {
        atomStyle.left = 0;
        atomStyle.top = 0;
      }

      $atoms.css( atomStyle ).addClass( this.options.itemClass );

      this.updateSortData( $atoms, true );
      
      return $atoms;
    },
  
    // _init fires when your instance is first created
    // (from the constructor above), and when you
    // attempt to initialize the widget again (by the bridge)
    // after it has already been initialized.
    _init : function( callback ) {
      
      this.$filteredAtoms = this._filter( this.$allAtoms );
      this._sort();
      
      this.reLayout( callback );

    },

    option : function( opts ){
      // change options AFTER initialization:
      // signature: $('#foo').bar({ cool:false });
      if ( $.isPlainObject( opts ) ){
        this.options = $.extend( true, this.options, opts );

        // trigger _updateOptionName if it exists
        var updateOptionFn;
        for ( var optionName in opts ) {
          updateOptionFn = '_update' + capitalize( optionName );
          if ( this[ updateOptionFn ] ) {
            this[ updateOptionFn ]();
          }
        }
      }
    },
    
    // ====================== updaters ====================== //
    // kind of like setters
    
    _updateAnimationEngine : function() {
      var animationEngine = this.options.animationEngine.toLowerCase().replace( /[ _\-]/g, '');
      // set applyStyleFnName
      switch ( animationEngine ) {
        case 'css' :
        case 'none' :
          this.isUsingJQueryAnimation = false;
          break;
        case 'jquery' :
          this.isUsingJQueryAnimation = true;
          break;
        default : // best available
          this.isUsingJQueryAnimation = !Modernizr.csstransitions;
      }
      
      this._updateUsingTransforms();
    },
    
    _updateTransformsEnabled : function() {
      this._updateUsingTransforms();
    },
    
    _updateUsingTransforms : function() {
      this.usingTransforms = this.options.transformsEnabled && Modernizr.csstransforms && Modernizr.csstransitions && !this.isUsingJQueryAnimation;

      this.getPositionStyles = this.usingTransforms ? this._translate : this._positionAbs;
    },

    
    // ====================== Filtering ======================

    _filter : function( $atoms ) {
      var filter = this.options.filter === '' ? '*' : this.options.filter;

      if ( !filter ) {
        return $atoms;
      }

      var hiddenClass    = this.options.hiddenClass,
          hiddenSelector = '.' + hiddenClass,
          $hiddenAtoms   = $atoms.filter( hiddenSelector ),
          $atomsToShow   = $hiddenAtoms;

      if ( filter !== '*' ) {
        $atomsToShow = $hiddenAtoms.filter( filter );
        var $atomsToHide = $atoms.not( hiddenSelector ).not( filter ).addClass( hiddenClass );
        this.styleQueue.push({ $el: $atomsToHide, style: this.options.hiddenStyle });
      }

      this.styleQueue.push({ $el: $atomsToShow, style: this.options.visibleStyle });
      $atomsToShow.removeClass( hiddenClass );

      return $atoms.filter( filter );
    },
    
    // ====================== Sorting ======================
    
    updateSortData : function( $atoms, isIncrementingElemCount ) {
      var instance = this,
          getSortData = this.options.getSortData,
          $this, sortData;
      $atoms.each(function(){
        $this = $(this);
        sortData = {};
        // get value for sort data based on fn( $elem ) passed in
        for ( var key in getSortData ) {
          sortData[ key ] = getSortData[ key ]( $this, instance );
        }
        // apply sort data to element
        $.data( this, 'isotope-sort-data', sortData );
        if ( isIncrementingElemCount ) {
          instance.elemCount ++;
        }
      });
    },
    
    // used on all the filtered atoms
    _sort : function() {
      
      var sortBy = this.options.sortBy,
          getSorter = this._getSorter,
          sortDir = this.options.sortAscending ? 1 : -1,
          sortFn = function( alpha, beta ) {
            var a = getSorter( alpha, sortBy ),
                b = getSorter( beta, sortBy );
            // fall back to original order if data matches
            if ( a === b && sortBy !== 'original-order') {
              a = getSorter( alpha, 'original-order' );
              b = getSorter( beta, 'original-order' );
            }
            return ( ( a > b ) ? 1 : ( a < b ) ? -1 : 0 ) * sortDir;
          };
      
      this.$filteredAtoms.sort( sortFn );
    },

    _getSorter : function( elem, sortBy ) {
      return $.data( elem, 'isotope-sort-data' )[ sortBy ];
    },

    // ====================== Layout Helpers ======================

    _translate : function( x, y ) {
      return { translate : [ x, y ] };
    },
    
    _positionAbs : function( x, y ) {
      return { left: x, top: y };
    },

    _pushPosition : function( $elem, x, y ) {
      x += this.offset.left;
      y += this.offset.top;
      var position = this.getPositionStyles( x, y );
      this.styleQueue.push({ $el: $elem, style: position });
      if ( this.options.itemPositionDataEnabled ) {
        $elem.data('isotope-item-position', {x: x, y: y} );
      }
    },


    // ====================== General Layout ======================

    // used on collection of atoms (should be filtered, and sorted before )
    // accepts atoms-to-be-laid-out to start with
    layout : function( $elems, callback ) {

      var layoutMode = this.options.layoutMode;

      // layout logic
      this[ '_' +  layoutMode + 'Layout' ]( $elems );
      
      // set the size of the container
      if ( this.options.resizesContainer ) {
        var containerStyle = this[ '_' +  layoutMode + 'GetContainerSize' ]();
        this.styleQueue.push({ $el: this.element, style: containerStyle });
      }

      this._processStyleQueue();

      // provide $elems as context for the callback
      if ( callback ) {
        callback.call( $elems );
      }
      
      this.isLaidOut = true;
    },
    
    _processStyleQueue : function() {
      // are we animating the layout arrangement?
      // use plugin-ish syntax for css or animate
      var styleFn = !this.isLaidOut ? 'css' : (
            this.isUsingJQueryAnimation ? 'animate' : 'css'
          ),
          animOpts = this.options.animationOptions,
          _isInsertingAnimated = this._isInserting && this.isUsingJQueryAnimation,
          objStyleFn;
      
      // process styleQueue
      $.each( this.styleQueue, function( i, obj ) {
        objStyleFn = _isInsertingAnimated && obj.$el.hasClass('no-transition') ? 'css' : styleFn;
        obj.$el[ objStyleFn ]( obj.style, animOpts );
      });

      // clear out queue for next time
      this.styleQueue = [];
    },
    
    
    resize : function() {
      if ( this[ '_' + this.options.layoutMode + 'ResizeChanged' ]() ) {
        this.reLayout();
      }
    },
    
    
    reLayout : function( callback ) {
      
      this[ '_' +  this.options.layoutMode + 'Reset' ]();
      this.layout( this.$filteredAtoms, callback );
      
    },
    
    // ====================== Convenience methods ======================
    
    // ====================== Adding items ======================
    
    // adds a jQuery object of items to a isotope container
    addItems : function( $content, callback ) {
      var $newAtoms = this._getAtoms( $content );
      // add new atoms to atoms pools
      // FIXME : this breaks shuffle order and returns to original order
      this.$allAtoms = this.$allAtoms.add( $newAtoms );

      if ( callback ) {
        callback( $newAtoms );
      }
    },
    
    // convienence method for adding elements properly to any layout
    // positions items, hides them, then animates them back in <--- very sezzy
    insert : function( $content, callback ) {
      // position items
      this.element.append( $content );
      
      var instance = this;
      this.addItems( $content, function( $newAtoms ) {
        var $newFilteredAtoms = instance._filter( $newAtoms, true );
        instance._addHideAppended( $newFilteredAtoms );
        instance._sort();
        instance.reLayout();
        instance._revealAppended( $newFilteredAtoms, callback );
      });
      
    },
    
    // convienence method for working with Infinite Scroll
    appended : function( $content, callback ) {
      var instance = this;
      this.addItems( $content, function( $newAtoms ) {
        instance._addHideAppended( $newAtoms );
        instance.layout( $newAtoms );
        instance._revealAppended( $newAtoms, callback );
      });
    },
    
    // adds new atoms, then hides them before positioning
    _addHideAppended : function( $newAtoms ) {
      this.$filteredAtoms = this.$filteredAtoms.add( $newAtoms );
      $newAtoms.addClass('no-transition');
      
      this._isInserting = true;
      
      // apply hidden styles
      this.styleQueue.push({ $el: $newAtoms, style: this.options.hiddenStyle });
    },
    
    // sets visible style on new atoms
    _revealAppended : function( $newAtoms, callback ) {
      var instance = this;
      // apply visible style after a sec
      setTimeout( function() {
        // enable animation
        $newAtoms.removeClass('no-transition');
        // reveal newly inserted filtered elements
        instance.styleQueue.push({ $el: $newAtoms, style: instance.options.visibleStyle });
        instance._processStyleQueue();
        delete instance._isInserting;
        if ( callback ) {
          callback( $newAtoms );
        }
      }, 10 );
    },
    
    // gathers all atoms
    reloadItems : function() {
      this.$allAtoms = this._getAtoms( this.element.children() );
    },
    
    // removes elements from Isotope widget
    remove : function( $content ) {

      this.$allAtoms = this.$allAtoms.not( $content );
      this.$filteredAtoms = this.$filteredAtoms.not( $content );

      $content.remove();
      
    },
    
    shuffle : function() {
      this.updateSortData( this.$allAtoms );
      this.options.sortBy = 'random';
      this._sort();
      this.reLayout();
    },
    
    // destroys widget, returns elements and container back (close) to original style
    destroy : function() {

      var usingTransforms = this.usingTransforms;

      this.$allAtoms
        .removeClass( this.options.hiddenClass + ' ' + this.options.itemClass )
        .each(function(){
          this.style.position = null;
          this.style.top = null;
          this.style.left = null;
          this.style.opacity = null;
          if ( usingTransforms ) {
            this.style[ transformProp ] = null;
          }
        });
      
      // re-apply saved container styles
      var elemStyle = this.element[0].style;
      for ( var i=0, len = isoContainerStyles.length; i < len; i++ ) {
        var prop = isoContainerStyles[i];
        elemStyle[ prop ] = this.originalStyle[ prop ];
      }
      
      this.element
        .unbind('.isotope')
        .removeClass( this.options.containerClass )
        .removeData('isotope');
      
      $(window).unbind('.isotope');

    },
    
    
    // ====================== LAYOUTS ======================
    
    // calculates number of rows or columns
    // requires columnWidth or rowHeight to be set on namespaced object
    // i.e. this.masonry.columnWidth = 200
    _getSegments : function( isRows ) {
      var namespace = this.options.layoutMode,
          measure  = isRows ? 'rowHeight' : 'columnWidth',
          size     = isRows ? 'height' : 'width',
          segmentsName = isRows ? 'rows' : 'cols',
          containerSize = this.element[ size ](),
          segments,
                    // i.e. options.masonry && options.masonry.columnWidth
          segmentSize = this.options[ namespace ] && this.options[ namespace ][ measure ] ||
                    // or use the size of the first item, i.e. outerWidth
                    this.$filteredAtoms[ 'outer' + capitalize(size) ](true) ||
                    // if there's no items, use size of container
                    containerSize;
      
      segments = Math.floor( containerSize / segmentSize );
      segments = Math.max( segments, 1 );

      // i.e. this.masonry.cols = ....
      this[ namespace ][ segmentsName ] = segments;
      // i.e. this.masonry.columnWidth = ...
      this[ namespace ][ measure ] = segmentSize;
      
    },
    
    _checkIfSegmentsChanged : function( isRows ) {
      var namespace = this.options.layoutMode,
          segmentsName = isRows ? 'rows' : 'cols',
          prevSegments = this[ namespace ][ segmentsName ];
      // update cols/rows
      this._getSegments( isRows );
      // return if updated cols/rows is not equal to previous
      return ( this[ namespace ][ segmentsName ] !== prevSegments );
    },

    // ====================== Masonry ======================
  
    _masonryReset : function() {
      // layout-specific props
      this.masonry = {};
      // FIXME shouldn't have to call this again
      this._getSegments();
      var i = this.masonry.cols;
      this.masonry.colYs = [];
      while (i--) {
        this.masonry.colYs.push( 0 );
      }
    },
  
    _masonryLayout : function( $elems ) {
      var instance = this,
          props = instance.masonry;
      $elems.each(function(){
        var $this  = $(this),
            //how many columns does this brick span
            colSpan = Math.ceil( $this.outerWidth(true) / props.columnWidth );
        colSpan = Math.min( colSpan, props.cols );

        if ( colSpan === 1 ) {
          // if brick spans only one column, just like singleMode
          instance._masonryPlaceBrick( $this, props.colYs );
        } else {
          // brick spans more than one column
          // how many different places could this brick fit horizontally
          var groupCount = props.cols + 1 - colSpan,
              groupY = [],
              groupColY,
              i;

          // for each group potential horizontal position
          for ( i=0; i < groupCount; i++ ) {
            // make an array of colY values for that one group
            groupColY = props.colYs.slice( i, i+colSpan );
            // and get the max value of the array
            groupY[i] = Math.max.apply( Math, groupColY );
          }
        
          instance._masonryPlaceBrick( $this, groupY );
        }
      });
    },
    
    // worker method that places brick in the columnSet
    //   with the the minY
    _masonryPlaceBrick : function( $brick, setY ) {
      // get the minimum Y value from the columns
      var minimumY = Math.min.apply( Math, setY ),
          shortCol = 0;

      // Find index of short column, the first from the left
      for (var i=0, len = setY.length; i < len; i++) {
        if ( setY[i] === minimumY ) {
          shortCol = i;
          break;
        }
      }
    
      // position the brick
      var x = this.masonry.columnWidth * shortCol,
          y = minimumY;
      this._pushPosition( $brick, x, y );

      // apply setHeight to necessary columns
      var setHeight = minimumY + $brick.outerHeight(true),
          setSpan = this.masonry.cols + 1 - len;
      for ( i=0; i < setSpan; i++ ) {
        this.masonry.colYs[ shortCol + i ] = setHeight;
      }

    },
    
    _masonryGetContainerSize : function() {
      var containerHeight = Math.max.apply( Math, this.masonry.colYs );
      return { height: containerHeight };
    },
  
    _masonryResizeChanged : function() {
      return this._checkIfSegmentsChanged();
    },
  
    // ====================== fitRows ======================
    
    _fitRowsReset : function() {
      this.fitRows = {
        x : 0,
        y : 0,
        height : 0
      };
    },
  
    _fitRowsLayout : function( $elems ) {
      var instance = this,
          containerWidth = this.element.width(),
          props = this.fitRows;
      
      $elems.each( function() {
        var $this = $(this),
            atomW = $this.outerWidth(true),
            atomH = $this.outerHeight(true);
      
        if ( props.x !== 0 && atomW + props.x > containerWidth ) {
          // if this element cannot fit in the current row
          props.x = 0;
          props.y = props.height;
        } 
      
        // position the atom
        instance._pushPosition( $this, props.x, props.y );
  
        props.height = Math.max( props.y + atomH, props.height );
        props.x += atomW;
  
      });
    },
  
    _fitRowsGetContainerSize : function () {
      return { height : this.fitRows.height };
    },
  
    _fitRowsResizeChanged : function() {
      return true;
    },
  

    // ====================== cellsByRow ======================
  
    _cellsByRowReset : function() {
      this.cellsByRow = {
        index : 0
      };
      // get this.cellsByRow.columnWidth
      this._getSegments();
      // get this.cellsByRow.rowHeight
      this._getSegments(true);
    },

    _cellsByRowLayout : function( $elems ) {
      var instance = this,
          props = this.cellsByRow;
      $elems.each( function(){
        var $this = $(this),
            col = props.index % props.cols,
            row = ~~( props.index / props.cols ),
            x = ( col + 0.5 ) * props.columnWidth - $this.outerWidth(true) / 2,
            y = ( row + 0.5 ) * props.rowHeight - $this.outerHeight(true) / 2;
        instance._pushPosition( $this, x, y );
        props.index ++;
      });
    },

    _cellsByRowGetContainerSize : function() {
      return { height : Math.ceil( this.$filteredAtoms.length / this.cellsByRow.cols ) * this.cellsByRow.rowHeight + this.offset.top };
    },

    _cellsByRowResizeChanged : function() {
      return this._checkIfSegmentsChanged();
    },
  
  
    // ====================== straightDown ======================
  
    _straightDownReset : function() {
      this.straightDown = {
        y : 0
      };
    },

    _straightDownLayout : function( $elems ) {
      var instance = this;
      $elems.each( function( i ){
        var $this = $(this);
        instance._pushPosition( $this, 0, instance.straightDown.y );
        instance.straightDown.y += $this.outerHeight(true);
      });
    },

    _straightDownGetContainerSize : function() {
      return { height : this.straightDown.y };
    },

    _straightDownResizeChanged : function() {
      return true;
    },


    // ====================== masonryHorizontal ======================
    
    _masonryHorizontalReset : function() {
      // layout-specific props
      this.masonryHorizontal = {};
      // FIXME shouldn't have to call this again
      this._getSegments( true );
      var i = this.masonryHorizontal.rows;
      this.masonryHorizontal.rowXs = [];
      while (i--) {
        this.masonryHorizontal.rowXs.push( 0 );
      }
    },
  
    _masonryHorizontalLayout : function( $elems ) {
      var instance = this,
          props = instance.masonryHorizontal;
      $elems.each(function(){
        var $this  = $(this),
            //how many rows does this brick span
            rowSpan = Math.ceil( $this.outerHeight(true) / props.rowHeight );
        rowSpan = Math.min( rowSpan, props.rows );

        if ( rowSpan === 1 ) {
          // if brick spans only one column, just like singleMode
          instance._masonryHorizontalPlaceBrick( $this, props.rowXs );
        } else {
          // brick spans more than one row
          // how many different places could this brick fit horizontally
          var groupCount = props.rows + 1 - rowSpan,
              groupX = [],
              groupRowX, i;

          // for each group potential horizontal position
          for ( i=0; i < groupCount; i++ ) {
            // make an array of colY values for that one group
            groupRowX = props.rowXs.slice( i, i+rowSpan );
            // and get the max value of the array
            groupX[i] = Math.max.apply( Math, groupRowX );
          }

          instance._masonryHorizontalPlaceBrick( $this, groupX );
        }
      });
    },
    
    _masonryHorizontalPlaceBrick : function( $brick, setX ) {
      // get the minimum Y value from the columns
      var minimumX  = Math.min.apply( Math, setX ),
          smallRow  = 0;
      // Find index of smallest row, the first from the top
      for (var i=0, len = setX.length; i < len; i++) {
        if ( setX[i] === minimumX ) {
          smallRow = i;
          break;
        }
      }

      // position the brick
      var x = minimumX,
          y = this.masonryHorizontal.rowHeight * smallRow;
      this._pushPosition( $brick, x, y );

      // apply setHeight to necessary columns
      var setWidth = minimumX + $brick.outerWidth(true),
          setSpan = this.masonryHorizontal.rows + 1 - len;
      for ( i=0; i < setSpan; i++ ) {
        this.masonryHorizontal.rowXs[ smallRow + i ] = setWidth;
      }
    },

    _masonryHorizontalGetContainerSize : function() {
      var containerWidth = Math.max.apply( Math, this.masonryHorizontal.rowXs );
      return { width: containerWidth };
    },
    
    _masonryHorizontalResizeChanged : function() {
      return this._checkIfSegmentsChanged(true);
    },


    // ====================== fitColumns ======================
  
    _fitColumnsReset : function() {
      this.fitColumns = {
        x : 0,
        y : 0,
        width : 0
      };
    },
    
    _fitColumnsLayout : function( $elems ) {
      var instance = this,
          containerHeight = this.element.height(),
          props = this.fitColumns;
      $elems.each( function() {
        var $this = $(this),
            atomW = $this.outerWidth(true),
            atomH = $this.outerHeight(true);

        if ( props.y !== 0 && atomH + props.y > containerHeight ) {
          // if this element cannot fit in the current column
          props.x = props.width;
          props.y = 0;
        } 

        // position the atom
        instance._pushPosition( $this, props.x, props.y );

        props.width = Math.max( props.x + atomW, props.width );
        props.y += atomH;

      });
    },
    
    _fitColumnsGetContainerSize : function () {
      return { width : this.fitColumns.width };
    },
    
    _fitColumnsResizeChanged : function() {
      return true;
    },
    

  
    // ====================== cellsByColumn ======================
  
    _cellsByColumnReset : function() {
      this.cellsByColumn = {
        index : 0
      };
      // get this.cellsByColumn.columnWidth
      this._getSegments();
      // get this.cellsByColumn.rowHeight
      this._getSegments(true);
    },

    _cellsByColumnLayout : function( $elems ) {
      var instance = this,
          props = this.cellsByColumn;
      $elems.each( function(){
        var $this = $(this),
            col = ~~( props.index / props.rows ),
            row = props.index % props.rows,
            x = ( col + 0.5 )  * props.columnWidth - $this.outerWidth(true) / 2,
            y = ( row + 0.5 ) * props.rowHeight - $this.outerHeight(true) / 2;
        instance._pushPosition( $this, x, y );
        props.index ++;
      });
    },

    _cellsByColumnGetContainerSize : function() {
      return { width : Math.ceil( this.$filteredAtoms.length / this.cellsByColumn.rows ) * this.cellsByColumn.columnWidth };
    },

    _cellsByColumnResizeChanged : function() {
      return this._checkIfSegmentsChanged(true);
    },
    
    // ====================== straightAcross ======================

    _straightAcrossReset : function() {
      this.straightAcross = {
        x : 0
      };
    },

    _straightAcrossLayout : function( $elems ) {
      var instance = this;
      $elems.each( function( i ){
        var $this = $(this);
        instance._pushPosition( $this, instance.straightAcross.x, 0 );
        instance.straightAcross.x += $this.outerWidth(true);
      });
    },

    _straightAcrossGetContainerSize : function() {
      return { width : this.straightAcross.x };
    },

    _straightAcrossResizeChanged : function() {
      return true;
    }

  };
  
  
  // ======================= imagesLoaded Plugin  ===============================
  // https://gist.github.com/964345

  // $('img.photo',this).imagesLoaded(myFunction)
  // execute a callback when all images have loaded.
  // needed because .load() doesn't work on cached images

  // modified by yiannis chatzikonstantinou.

  // original:
  // mit license. paul irish. 2010.
  // webkit fix from Oren Solomianik. thx!

  // callback function is passed the last image to load
  //   as an argument, and the collection as `this`

  $.fn.imagesLoaded = function( callback ){
    var elems = this.find( 'img' ),
        elems_src = [],
        self = this,
        len = elems.length;

    if ( !elems.length ) {
      callback.call( this );
      return this;
    }

    elems.one('load error', function() {
      if ( --len === 0 ) {
        // Rinse and repeat.
        len = elems.length;
        elems.one( 'load error', function() {
          if ( --len === 0 ) {
            callback.call( self );
          }
        }).each(function() {
          this.src = elems_src.shift();
        });
      }
    }).each(function() {
      elems_src.push( this.src );
      // webkit hack from http://groups.google.com/group/jquery-dev/browse_thread/thread/eee6ab7b2da50e1f
      // data uri bypasses webkit log warning (thx doug jones)
      this.src = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==";
    });

    return this;
  };

  // helper function for logging errors
  // $.error breaks jQuery chaining
  var logError = function( message ) {
    if ( this.console ) {
      console.error( message );
    }
  };

  // =======================  Plugin bridge  ===============================
  // leverages data method to either create or return $.Isotope constructor
  // A bit from jQuery UI
  //   https://github.com/jquery/jquery-ui/blob/master/ui/jquery.ui.widget.js
  // A bit from jcarousel 
  //   https://github.com/jsor/jcarousel/blob/master/lib/jquery.jcarousel.js

  $.fn.isotope = function( options ) {
    if ( typeof options === 'string' ) {
      // call method
      var args = Array.prototype.slice.call( arguments, 1 );

      this.each(function(){
        var instance = $.data( this, 'isotope' );
        if ( !instance ) {
          logError( "cannot call methods on isotope prior to initialization; " +
              "attempted to call method '" + options + "'" );
          return;
        }
        if ( !$.isFunction( instance[options] ) || options.charAt(0) === "_" ) {
          logError( "no such method '" + options + "' for isotope instance" );
          return;
        }
        // apply method
        instance[ options ].apply( instance, args );
      });
    } else {
      this.each(function() {
        var instance = $.data( this, 'isotope' );
        if ( instance ) {
          // apply options & init
          instance.option( options );
          instance._init();
        } else {
          // initialize new instance
          $.data( this, 'isotope', new $.Isotope( options, this ) );
        }
      });
    }
    // return jQuery object
    // so plugin methods do not have to
    return this;
  };

})( window, jQuery );

// ----------------------------------------------------------------------------
// markItUp! Universal MarkUp Engine, JQuery plugin
// v 1.1.11
// Dual licensed under the MIT and GPL licenses.
// ----------------------------------------------------------------------------
// Copyright (C) 2007-2011 Jay Salvat
// http://markitup.jaysalvat.com/
// ----------------------------------------------------------------------------
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
// 
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
// 
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
// ----------------------------------------------------------------------------
(function($) {
	$.fn.markItUp = function(settings, extraSettings) {
		var options, ctrlKey, shiftKey, altKey;
		ctrlKey = shiftKey = altKey = false;
	
		options = {	id:						'',
					nameSpace:				'',
					root:					'',
					previewInWindow:		'', // 'width=800, height=600, resizable=yes, scrollbars=yes'
					previewAutoRefresh:		true,
					previewPosition:		'after',
					previewTemplatePath:	'~/templates/preview.html',
					previewParser:			false,
					previewParserPath:		'',
					previewParserVar:		'data',
					resizeHandle:			true,
					beforeInsert:			'',
					afterInsert:			'',
					onEnter:				{},
					onShiftEnter:			{},
					onCtrlEnter:			{},
					onTab:					{},
					markupSet:			[	{ /* set */ } ]
				};
		$.extend(options, settings, extraSettings);

		// compute markItUp! path
		if (!options.root) {
			$('script').each(function(a, tag) {
				miuScript = $(tag).get(0).src.match(/(.*)jquery\.markitup(\.pack)?\.js$/);
				if (miuScript !== null) {
					options.root = miuScript[1];
				}
			});
		}

		return this.each(function() {
			var $$, textarea, levels, scrollPosition, caretPosition, caretOffset,
				clicked, hash, header, footer, previewWindow, template, iFrame, abort;
			$$ = $(this);
			textarea = this;
			levels = [];
			abort = false;
			scrollPosition = caretPosition = 0;
			caretOffset = -1;

			options.previewParserPath = localize(options.previewParserPath);
			options.previewTemplatePath = localize(options.previewTemplatePath);

			// apply the computed path to ~/
			function localize(data, inText) {
				if (inText) {
					return 	data.replace(/("|')~\//g, "$1"+options.root);
				}
				return 	data.replace(/^~\//, options.root);
			}

			// init and build editor
			function init() {
				id = ''; nameSpace = '';
				if (options.id) {
					id = 'id="'+options.id+'"';
				} else if ($$.attr("id")) {
					id = 'id="markItUp'+($$.attr("id").substr(0, 1).toUpperCase())+($$.attr("id").substr(1))+'"';

				}
				if (options.nameSpace) {
					nameSpace = 'class="'+options.nameSpace+'"';
				}
				$$.wrap('<div '+nameSpace+'></div>');
				$$.wrap('<div '+id+' class="markItUp"></div>');
				$$.wrap('<div class="markItUpContainer"></div>');
				$$.addClass("markItUpEditor");

				// add the header before the textarea
				header = $('<div class="markItUpHeader"></div>').insertBefore($$);
				$(dropMenus(options.markupSet)).appendTo(header);

				// add the footer after the textarea
				footer = $('<div class="markItUpFooter"></div>').insertAfter($$);

				// add the resize handle after textarea
				if (options.resizeHandle === true && $.browser.safari !== true) {
					resizeHandle = $('<div class="markItUpResizeHandle"></div>')
						.insertAfter($$)
						.bind("mousedown", function(e) {
							var h = $$.height(), y = e.clientY, mouseMove, mouseUp;
							mouseMove = function(e) {
								$$.css("height", Math.max(20, e.clientY+h-y)+"px");
								return false;
							};
							mouseUp = function(e) {
								$("html").unbind("mousemove", mouseMove).unbind("mouseup", mouseUp);
								return false;
							};
							$("html").bind("mousemove", mouseMove).bind("mouseup", mouseUp);
					});
					footer.append(resizeHandle);
				}

				// listen key events
				$$.keydown(keyPressed).keyup(keyPressed);
				
				// bind an event to catch external calls
				$$.bind("insertion", function(e, settings) {
					if (settings.target !== false) {
						get();
					}
					if (textarea === $.markItUp.focused) {
						markup(settings);
					}
				});

				// remember the last focus
				$$.focus(function() {
					$.markItUp.focused = this;
				});
			}

			// recursively build header with dropMenus from markupset
			function dropMenus(markupSet) {
				var ul = $('<ul></ul>'), i = 0;
				$('li:hover > ul', ul).css('display', 'block');
				$.each(markupSet, function() {
					var button = this, t = '', title, li, j;
					title = (button.key) ? (button.name||'')+' [Ctrl+'+button.key+']' : (button.name||'');
					key   = (button.key) ? 'accesskey="'+button.key+'"' : '';
					if (button.separator) {
						li = $('<li class="markItUpSeparator">'+(button.separator||'')+'</li>').appendTo(ul);
					} else {
						i++;
						for (j = levels.length -1; j >= 0; j--) {
							t += levels[j]+"-";
						}
						li = $('<li class="markItUpButton markItUpButton'+t+(i)+' '+(button.className||'')+'"><a href="" '+key+' title="'+title+'">'+(button.name||'')+'</a></li>')
						.bind("contextmenu", function() { // prevent contextmenu on mac and allow ctrl+click
							return false;
						}).click(function() {
							return false;
						}).bind("focusin", function(){
                            $$.focus();
						}).mouseup(function() {
							if (button.call) {
								eval(button.call)();
							}
							setTimeout(function() { markup(button) },1);
							return false;
						}).hover(function() {
								$('> ul', this).show();
								$(document).one('click', function() { // close dropmenu if click outside
										$('ul ul', header).hide();
									}
								);
							}, function() {
								$('> ul', this).hide();
							}
						).appendTo(ul);
						if (button.dropMenu) {
							levels.push(i);
							$(li).addClass('markItUpDropMenu').append(dropMenus(button.dropMenu));
						}
					}
				}); 
				levels.pop();
				return ul;
			}

			// markItUp! markups
			function magicMarkups(string) {
				if (string) {
					string = string.toString();
					string = string.replace(/\(\!\(([\s\S]*?)\)\!\)/g,
						function(x, a) {
							var b = a.split('|!|');
							if (altKey === true) {
								return (b[1] !== undefined) ? b[1] : b[0];
							} else {
								return (b[1] === undefined) ? "" : b[0];
							}
						}
					);
					// [![prompt]!], [![prompt:!:value]!]
					string = string.replace(/\[\!\[([\s\S]*?)\]\!\]/g,
						function(x, a) {
							var b = a.split(':!:');
							if (abort === true) {
								return false;
							}
							value = prompt(b[0], (b[1]) ? b[1] : '');
							if (value === null) {
								abort = true;
							}
							return value;
						}
					);
					return string;
				}
				return "";
			}

			// prepare action
			function prepare(action) {
				if ($.isFunction(action)) {
					action = action(hash);
				}
				return magicMarkups(action);
			}

			// build block to insert
			function build(string) {
				var openWith 			= prepare(clicked.openWith);
				var placeHolder 		= prepare(clicked.placeHolder);
				var replaceWith 		= prepare(clicked.replaceWith);
				var closeWith 			= prepare(clicked.closeWith);
				var openBlockWith 		= prepare(clicked.openBlockWith);
				var closeBlockWith 		= prepare(clicked.closeBlockWith);
				var multiline 			= clicked.multiline;
				
				if (replaceWith !== "") {
					block = openWith + replaceWith + closeWith;
				} else if (selection === '' && placeHolder !== '') {
					block = openWith + placeHolder + closeWith;
				} else {
					string = string || selection;

					var lines = selection.split(/\r?\n/), blocks = [];
					for (var l=0; l < lines.length; l++) {
						line = lines[l];
						if ($.trim(line) == '') {
							continue;
						}
						if (line.match(/ +$/)) {
							blocks.push(openWith + line.replace(/ $/, '') + closeWith + ' ');
						} else {
							blocks.push(openWith + line + closeWith);
						}
					}
					
					block = blocks.join("\n");
				}

				block = openBlockWith + block + closeBlockWith;

				return {	block:block, 
							openWith:openWith, 
							replaceWith:replaceWith, 
							placeHolder:placeHolder,
							closeWith:closeWith
					};
			}

			// define markup to insert
			function markup(button) {
				var len, j, n, i;
				hash = clicked = button;
				get();
				$.extend(hash, {	line:"", 
						 			root:options.root,
									textarea:textarea, 
									selection:(selection||''), 
									caretPosition:caretPosition,
									ctrlKey:ctrlKey, 
									shiftKey:shiftKey, 
									altKey:altKey
								}
							);
				// callbacks before insertion
				prepare(options.beforeInsert);
				prepare(clicked.beforeInsert);
				if ((ctrlKey === true && shiftKey === true) || button.multiline === true) {
					prepare(clicked.beforeMultiInsert);
				}			
				$.extend(hash, { line:1 });

				if ((ctrlKey === true && shiftKey === true)) {
					lines = selection.split(/\r?\n/);
					for (j = 0, n = lines.length, i = 0; i < n; i++) {
						if ($.trim(lines[i]) !== '') {
							$.extend(hash, { line:++j, selection:lines[i] } );
							lines[i] = build(lines[i]).block;
						} else {
							lines[i] = "";
						}
					}
					string = { block:lines.join('\n')};
					start = caretPosition;
					len = string.block.length + (($.browser.opera) ? n-1 : 0);
				} else if (ctrlKey === true) {
					string = build(selection);
					start = caretPosition + string.openWith.length;
					len = string.block.length - string.openWith.length - string.closeWith.length;
					len = len - (string.block.match(/ $/) ? 1 : 0);
					len -= fixIeBug(string.block);
				} else if (shiftKey === true) {
					string = build(selection);
					start = caretPosition;
					len = string.block.length;
					len -= fixIeBug(string.block);
				} else {
					string = build(selection);
					start = caretPosition + string.block.length ;
					len = 0;
					start -= fixIeBug(string.block);
				}
				if ((selection === '' && string.replaceWith === '')) {
					caretOffset += fixOperaBug(string.block);
					
					start = caretPosition + string.openWith.length;
					len = string.block.length - string.openWith.length - string.closeWith.length;

					caretOffset = $$.val().substring(caretPosition,  $$.val().length).length;
					caretOffset -= fixOperaBug($$.val().substring(0, caretPosition));
				}
				$.extend(hash, { caretPosition:caretPosition, scrollPosition:scrollPosition } );

				if (string.block !== selection && abort === false) {
					insert(string.block);
					set(start, len);
				} else {
					caretOffset = -1;
				}
				get();

				$.extend(hash, { line:'', selection:selection });

				// callbacks after insertion
				if ((ctrlKey === true && shiftKey === true) || button.multiline === true) {
					prepare(clicked.afterMultiInsert);
				}
				prepare(clicked.afterInsert);
				prepare(options.afterInsert);

				// refresh preview if opened
				if (previewWindow && options.previewAutoRefresh) {
					refreshPreview(); 
				}
																									
				// reinit keyevent
				shiftKey = altKey = ctrlKey = abort = false;
			}

			// Substract linefeed in Opera
			function fixOperaBug(string) {
				if ($.browser.opera) {
					return string.length - string.replace(/\n*/g, '').length;
				}
				return 0;
			}
			// Substract linefeed in IE
			function fixIeBug(string) {
				if ($.browser.msie) {
					return string.length - string.replace(/\r*/g, '').length;
				}
				return 0;
			}
				
			// add markup
			function insert(block) {	
				if (document.selection) {
					var newSelection = document.selection.createRange();
					newSelection.text = block;
				} else {
					textarea.value =  textarea.value.substring(0, caretPosition)  + block + textarea.value.substring(caretPosition + selection.length, textarea.value.length);
				}
			}

			// set a selection
			function set(start, len) {
				if (textarea.createTextRange){
					// quick fix to make it work on Opera 9.5
					if ($.browser.opera && $.browser.version >= 9.5 && len == 0) {
						return false;
					}
					range = textarea.createTextRange();
					range.collapse(true);
					range.moveStart('character', start); 
					range.moveEnd('character', len); 
					range.select();
				} else if (textarea.setSelectionRange ){
					textarea.setSelectionRange(start, start + len);
				}
				textarea.scrollTop = scrollPosition;
				textarea.focus();
			}

			// get the selection
			function get() {
				textarea.focus();

				scrollPosition = textarea.scrollTop;
				if (document.selection) {
					selection = document.selection.createRange().text;
					if ($.browser.msie) { // ie
						var range = document.selection.createRange(), rangeCopy = range.duplicate();
						rangeCopy.moveToElementText(textarea);
						caretPosition = -1;
						while(rangeCopy.inRange(range)) {
							rangeCopy.moveStart('character');
							caretPosition ++;
						}
					} else { // opera
						caretPosition = textarea.selectionStart;
					}
				} else { // gecko & webkit
					caretPosition = textarea.selectionStart;

					selection = textarea.value.substring(caretPosition, textarea.selectionEnd);
				} 
				return selection;
			}

			// open preview window
			function preview() {
				if (!previewWindow || previewWindow.closed) {
					if (options.previewInWindow) {
						previewWindow = window.open('', 'preview', options.previewInWindow);
						$(window).unload(function() {
							previewWindow.close();
						});
					} else {
						iFrame = $('<iframe class="markItUpPreviewFrame"></iframe>');
						if (options.previewPosition == 'after') {
							iFrame.insertAfter(footer);
						} else {
							iFrame.insertBefore(header);
						}	
						previewWindow = iFrame[iFrame.length - 1].contentWindow || frame[iFrame.length - 1];
					}
				} else if (altKey === true) {
					if (iFrame) {
						iFrame.remove();
					} else {
						previewWindow.close();
					}
					previewWindow = iFrame = false;
				}
				if (!options.previewAutoRefresh) {
					refreshPreview(); 
				}
				if (options.previewInWindow) {
					previewWindow.focus();
				}
			}

			// refresh Preview window
			function refreshPreview() {
 				renderPreview();
			}

			function renderPreview() {		
				var phtml;
				if (options.previewParser && typeof options.previewParser === 'function') {
					var data = options.previewParser( $$.val() );
					writeInPreview( localize(data, 1) ); 
				} else if (options.previewParserPath !== '') {
					$.ajax({
						type: 'POST',
						dataType: 'text',
						global: false,
						url: options.previewParserPath,
						data: options.previewParserVar+'='+encodeURIComponent($$.val()),
						success: function(data) {
							writeInPreview( localize(data, 1) ); 
						}
					});
				} else {
					if (!template) {
						$.ajax({
							url: options.previewTemplatePath,
							dataType: 'text',
							global: false,
							success: function(data) {
								writeInPreview( localize(data, 1).replace(/<!-- content -->/g, $$.val()) );
							}
						});
					}
				}
				return false;
			}
			
			function writeInPreview(data) {
				if (previewWindow.document) {			
					try {
						sp = previewWindow.document.documentElement.scrollTop
					} catch(e) {
						sp = 0;
					}	
					previewWindow.document.open();
					previewWindow.document.write(data);
					previewWindow.document.close();
					previewWindow.document.documentElement.scrollTop = sp;
				}
			}
			
			// set keys pressed
			function keyPressed(e) { 
				shiftKey = e.shiftKey;
				altKey = e.altKey;
				ctrlKey = (!(e.altKey && e.ctrlKey)) ? (e.ctrlKey || e.metaKey) : false;

				if (e.type === 'keydown') {
					if (ctrlKey === true) {
						li = $('a[accesskey="'+String.fromCharCode(e.keyCode)+'"]', header).parent('li');
						if (li.length !== 0) {
							ctrlKey = false;
							setTimeout(function() {
								li.triggerHandler('mouseup');
							},1);
							return false;
						}
					}
					if (e.keyCode === 13 || e.keyCode === 10) { // Enter key
						if (ctrlKey === true) {  // Enter + Ctrl
							ctrlKey = false;
							markup(options.onCtrlEnter);
							return options.onCtrlEnter.keepDefault;
						} else if (shiftKey === true) { // Enter + Shift
							shiftKey = false;
							markup(options.onShiftEnter);
							return options.onShiftEnter.keepDefault;
						} else { // only Enter
							markup(options.onEnter);
							return options.onEnter.keepDefault;
						}
					}
					if (e.keyCode === 9) { // Tab key
						if (shiftKey == true || ctrlKey == true || altKey == true) {
							return false; 
						}
						if (caretOffset !== -1) {
							get();
							caretOffset = $$.val().length - caretOffset;
							set(caretOffset, 0);
							caretOffset = -1;
							return false;
						} else {
							markup(options.onTab);
							return options.onTab.keepDefault;
						}
					}
				}
			}

			init();
		});
	};

	$.fn.markItUpRemove = function() {
		return this.each(function() {
				var $$ = $(this).unbind().removeClass('markItUpEditor');
				$$.parent('div').parent('div.markItUp').parent('div').replaceWith($$);
			}
		);
	};

	$.markItUp = function(settings) {
		var options = { target:false };
		$.extend(options, settings);
		if (options.target) {
			return $(options.target).each(function() {
				$(this).focus();
				$(this).trigger('insertion', [options]);
			});
		} else {
			$('textarea').trigger('insertion', [options]);
		}
	};
})(jQuery);

// jquery.tweet.js - See http://tweet.seaofclouds.com/ or https://github.com/seaofclouds/tweet for more info
// Copyright (c) 2008-2011 Todd Matthews & Steve Purcell
(function($) {
  $.fn.tweet = function(o){
    var s = $.extend({
      username: null,                           // [string or array] required unless using the 'query' option; one or more twitter screen names (use 'list' option for multiple names, where possible)
      list: null,                               // [string]   optional name of list belonging to username
      favorites: false,                         // [boolean]  display the user's favorites instead of his tweets
      query: null,                              // [string]   optional search query (see also: http://search.twitter.com/operators)
      avatar_size: null,                        // [integer]  height and width of avatar if displayed (48px max)
      count: 3,                                 // [integer]  how many tweets to display?
      fetch: null,                              // [integer]  how many tweets to fetch via the API (set this higher than 'count' if using the 'filter' option)
      page: 1,                                  // [integer]  which page of results to fetch (if count != fetch, you'll get unexpected results)
      retweets: true,                           // [boolean]  whether to fetch (official) retweets (not supported in all display modes)
      intro_text: null,                         // [string]   do you want text BEFORE your your tweets?
      outro_text: null,                         // [string]   do you want text AFTER your tweets?
      join_text:  null,                         // [string]   optional text in between date and tweet, try setting to "auto"
      auto_join_text_default: "i said,",        // [string]   auto text for non verb: "i said" bullocks
      auto_join_text_ed: "i",                   // [string]   auto text for past tense: "i" surfed
      auto_join_text_ing: "i am",               // [string]   auto tense for present tense: "i was" surfing
      auto_join_text_reply: "i replied to",     // [string]   auto tense for replies: "i replied to" @someone "with"
      auto_join_text_url: "i was looking at",   // [string]   auto tense for urls: "i was looking at" http:...
      loading_text: null,                       // [string]   optional loading text, displayed while tweets load
      refresh_interval: null ,                  // [integer]  optional number of seconds after which to reload tweets
      twitter_url: "twitter.com",               // [string]   custom twitter url, if any (apigee, etc.)
      twitter_api_url: "api.twitter.com",       // [string]   custom twitter api url, if any (apigee, etc.)
      twitter_search_url: "search.twitter.com", // [string]   custom twitter search url, if any (apigee, etc.)
      template: "{avatar}{time}{join}{text}",   // [string or function] template used to construct each tweet <li> - see code for available vars
      comparator: function(tweet1, tweet2) {    // [function] comparator used to sort tweets (see Array.sort)
        return tweet2["tweet_time"] - tweet1["tweet_time"];
      },
      filter: function(tweet) {                 // [function] whether or not to include a particular tweet (be sure to also set 'fetch')
        return true;
      }
    }, o);

    // See http://daringfireball.net/2010/07/improved_regex_for_matching_urls
    var url_regexp = /\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/gi;

    // Expand values inside simple string templates with {placeholders}
    function t(template, info) {
      if (typeof template === "string") {
        var result = template;
        for(var key in info) {
          var val = info[key];
          result = result.replace(new RegExp('{'+key+'}','g'), val === null ? '' : val);
        }
        return result;
      } else return template(info);
    }
    // Export the t function for use when passing a function as the 'template' option
    $.extend({tweet: {t: t}});

    function replacer (regex, replacement) {
      return function() {
        var returning = [];
        this.each(function() {
          returning.push(this.replace(regex, replacement));
        });
        return $(returning);
      };
    }

    $.fn.extend({
      linkUrl: replacer(url_regexp, function(match) {
        var url = (/^[a-z]+:/i).test(match) ? match : "http://"+match;
        return "<a href=\""+url+"\">"+match+"</a>";
      }),
      linkUser: replacer(/@(\w+)/gi, "@<a href=\"http://"+s.twitter_url+"/$1\">$1</a>"),
      // Support various latin1 (\u00**) and arabic (\u06**) alphanumeric chars
      linkHash: replacer(/(?:^| )[\#]+([\w\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u00ff\u0600-\u06ff]+)/gi,
                         ' <a href="http://'+s.twitter_search_url+'/search?q=&tag=$1&lang=all'+((s.username && s.username.length == 1) ? '&from='+s.username.join("%2BOR%2B") : '')+'">#$1</a>'),
      capAwesome: replacer(/\b(awesome)\b/gi, '<span class="awesome">$1</span>'),
      capEpic: replacer(/\b(epic)\b/gi, '<span class="epic">$1</span>'),
      makeHeart: replacer(/(&lt;)+[3]/gi, "<tt class='heart'>&#x2665;</tt>")
    });

    function parse_date(date_str) {
      // The non-search twitter APIs return inconsistently-formatted dates, which Date.parse
      // cannot handle in IE. We therefore perform the following transformation:
      // "Wed Apr 29 08:53:31 +0000 2009" => "Wed, Apr 29 2009 08:53:31 +0000"
      return Date.parse(date_str.replace(/^([a-z]{3})( [a-z]{3} \d\d?)(.*)( \d{4})$/i, '$1,$2$4$3'));
    }

    function relative_time(date) {
      var relative_to = (arguments.length > 1) ? arguments[1] : new Date();
      var delta = parseInt((relative_to.getTime() - date) / 1000, 10);
      var r = '';
      if (delta < 60) {
        r = delta + ' seconds ago';
      } else if(delta < 120) {
        r = 'a minute ago';
      } else if(delta < (45*60)) {
        r = (parseInt(delta / 60, 10)).toString() + ' minutes ago';
      } else if(delta < (2*60*60)) {
        r = 'an hour ago';
      } else if(delta < (24*60*60)) {
        r = '' + (parseInt(delta / 3600, 10)).toString() + ' hours ago';
      } else if(delta < (48*60*60)) {
        r = 'a day ago';
      } else {
        r = (parseInt(delta / 86400, 10)).toString() + ' days ago';
      }
      return 'about ' + r;
    }

    function build_auto_join_text(text) {
      if (text.match(/^(@([A-Za-z0-9-_]+)) .*/i)) {
        return s.auto_join_text_reply;
      } else if (text.match(url_regexp)) {
        return s.auto_join_text_url;
      } else if (text.match(/^((\w+ed)|just) .*/im)) {
        return s.auto_join_text_ed;
      } else if (text.match(/^(\w*ing) .*/i)) {
        return s.auto_join_text_ing;
      } else {
        return s.auto_join_text_default;
      }
    }

    function build_api_url() {
      var proto = ('https:' == document.location.protocol ? 'https:' : 'http:');
      var count = (s.fetch === null) ? s.count : s.fetch;
      if (s.list) {
        return proto+"//"+s.twitter_api_url+"/1/"+s.username[0]+"/lists/"+s.list+"/statuses.json?page="+s.page+"&per_page="+count+"&callback=?";
      } else if (s.favorites) {
        return proto+"//"+s.twitter_api_url+"/favorites/"+s.username[0]+".json?page="+s.page+"&count="+count+"&callback=?";
      } else if (s.query === null && s.username.length == 1) {
        return proto+'//'+s.twitter_api_url+'/1/statuses/user_timeline.json?screen_name='+s.username[0]+'&count='+count+(s.retweets ? '&include_rts=1' : '')+'&page='+s.page+'&callback=?';
      } else {
        var query = (s.query || 'from:'+s.username.join(' OR from:'));
        return proto+'//'+s.twitter_search_url+'/search.json?&q='+encodeURIComponent(query)+'&rpp='+count+'&page='+s.page+'&callback=?';
      }
    }

    // Convert twitter API objects into data available for
    // constructing each tweet <li> using a template
    function extract_template_data(item){
      var o = {};
      o.item = item;
      o.source = item.source;
      o.screen_name = item.from_user || item.user.screen_name;
      o.avatar_size = s.avatar_size;
      o.avatar_url = item.profile_image_url || item.user.profile_image_url;
      o.retweet = typeof(item.retweeted_status) != 'undefined';
      o.tweet_time = parse_date(item.created_at);
      o.join_text = s.join_text == "auto" ? build_auto_join_text(item.text) : s.join_text;
      o.tweet_id = item.id_str;
      o.twitter_base = "http://"+s.twitter_url+"/";
      o.user_url = o.twitter_base+o.screen_name;
      o.tweet_url = o.user_url+"/status/"+o.tweet_id;
      o.reply_url = o.twitter_base+"intent/tweet?in_reply_to="+o.tweet_id;
      o.retweet_url = o.twitter_base+"intent/retweet?tweet_id="+o.tweet_id;
      o.favorite_url = o.twitter_base+"intent/favorite?tweet_id="+o.tweet_id;
      o.retweeted_screen_name = o.retweet && item.retweeted_status.user.screen_name;
      o.tweet_relative_time = relative_time(o.tweet_time);
      o.tweet_raw_text = o.retweet ? ('RT @'+o.retweeted_screen_name+' '+item.retweeted_status.text) : item.text; // avoid '...' in long retweets
      o.tweet_text = $([o.tweet_raw_text]).linkUrl().linkUser().linkHash()[0];
      o.tweet_text_fancy = $([o.tweet_text]).makeHeart().capAwesome().capEpic()[0];

      // Default spans, and pre-formatted blocks for common layouts
      o.user = t('<a class="tweet_user" href="{user_url}">{screen_name}</a>', o);
      o.join = s.join_text ? t(' <span class="tweet_join">{join_text}</span> ', o) : ' ';
      o.avatar = o.avatar_size ?
        t('<a class="tweet_avatar" href="{user_url}"><img src="{avatar_url}" height="{avatar_size}" width="{avatar_size}" alt="{screen_name}\'s avatar" title="{screen_name}\'s avatar" border="0"/></a>', o) : '';
      o.time = t('<span class="tweet_time"><a href="{tweet_url}" title="view tweet on twitter">{tweet_relative_time}</a></span>', o);
      o.text = t('<span class="tweet_text">{tweet_text_fancy}</span>', o);
      o.reply_action = t('<a class="tweet_action tweet_reply" href="{reply_url}">reply</a>', o);
      o.retweet_action = t('<a class="tweet_action tweet_retweet" href="{retweet_url}">retweet</a>', o);
      o.favorite_action = t('<a class="tweet_action tweet_favorite" href="{favorite_url}">favorite</a>', o);
      return o;
    }

    return this.each(function(i, widget){
      var list = $('<ul class="tweet_list">').appendTo(widget);
      var intro = '<p class="tweet_intro">'+s.intro_text+'</p>';
      var outro = '<p class="tweet_outro">'+s.outro_text+'</p>';
      var loading = $('<p class="loading">'+s.loading_text+'</p>');

      if(s.username && typeof(s.username) == "string"){
        s.username = [s.username];
      }

      if (s.loading_text) $(widget).append(loading);
      $(widget).bind("tweet:load", function(){
        $.getJSON(build_api_url(), function(data){
          if (s.loading_text) loading.remove();
          if (s.intro_text) list.before(intro);
          list.empty();

          var tweets = $.map(data.results || data, extract_template_data);
          tweets = $.grep(tweets, s.filter).sort(s.comparator).slice(0, s.count);
          list.append($.map(tweets, function(o) { return "<li>" + t(s.template, o) + "</li>"; }).join('')).
              children('li:first').addClass('tweet_first').end().
              children('li:odd').addClass('tweet_even').end().
              children('li:even').addClass('tweet_odd');

          if (s.outro_text) list.after(outro);
          $(widget).trigger("loaded").trigger((tweets.length === 0 ? "empty" : "full"));
          if (s.refresh_interval) {
            window.setTimeout(function() { $(widget).trigger("tweet:load"); }, 1000 * s.refresh_interval);
          }
        });
      }).trigger("tweet:load");
    });
  };
})(jQuery);

/* Modernizr 2.0.6 (Custom Build) | MIT & BSD
 * Contains: iepp | cssclasses | load
 */
;window.Modernizr=function(a,b,c){function x(a,b){return!!~(""+a).indexOf(b)}function w(a,b){return typeof a===b}function v(a,b){return u(prefixes.join(a+";")+(b||""))}function u(a){k.cssText=a}var d="2.0.6",e={},f=!0,g=b.documentElement,h=b.head||b.getElementsByTagName("head")[0],i="modernizr",j=b.createElement(i),k=j.style,l,m=Object.prototype.toString,n={},o={},p={},q=[],r,s={}.hasOwnProperty,t;!w(s,c)&&!w(s.call,c)?t=function(a,b){return s.call(a,b)}:t=function(a,b){return b in a&&w(a.constructor.prototype[b],c)};for(var y in n)t(n,y)&&(r=y.toLowerCase(),e[r]=n[y](),q.push((e[r]?"":"no-")+r));u(""),j=l=null,a.attachEvent&&function(){var a=b.createElement("div");a.innerHTML="<elem></elem>";return a.childNodes.length!==1}()&&function(a,b){function s(a){var b=-1;while(++b<g)a.createElement(f[b])}a.iepp=a.iepp||{};var d=a.iepp,e=d.html5elements||"abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",f=e.split("|"),g=f.length,h=new RegExp("(^|\\s)("+e+")","gi"),i=new RegExp("<(/*)("+e+")","gi"),j=/^\s*[\{\}]\s*$/,k=new RegExp("(^|[^\\n]*?\\s)("+e+")([^\\n]*)({[\\n\\w\\W]*?})","gi"),l=b.createDocumentFragment(),m=b.documentElement,n=m.firstChild,o=b.createElement("body"),p=b.createElement("style"),q=/print|all/,r;d.getCSS=function(a,b){if(a+""===c)return"";var e=-1,f=a.length,g,h=[];while(++e<f){g=a[e];if(g.disabled)continue;b=g.media||b,q.test(b)&&h.push(d.getCSS(g.imports,b),g.cssText),b="all"}return h.join("")},d.parseCSS=function(a){var b=[],c;while((c=k.exec(a))!=null)b.push(((j.exec(c[1])?"\n":c[1])+c[2]+c[3]).replace(h,"$1.iepp_$2")+c[4]);return b.join("\n")},d.writeHTML=function(){var a=-1;r=r||b.body;while(++a<g){var c=b.getElementsByTagName(f[a]),d=c.length,e=-1;while(++e<d)c[e].className.indexOf("iepp_")<0&&(c[e].className+=" iepp_"+f[a])}l.appendChild(r),m.appendChild(o),o.className=r.className,o.id=r.id,o.innerHTML=r.innerHTML.replace(i,"<$1font")},d._beforePrint=function(){p.styleSheet.cssText=d.parseCSS(d.getCSS(b.styleSheets,"all")),d.writeHTML()},d.restoreHTML=function(){o.innerHTML="",m.removeChild(o),m.appendChild(r)},d._afterPrint=function(){d.restoreHTML(),p.styleSheet.cssText=""},s(b),s(l);d.disablePP||(n.insertBefore(p,n.firstChild),p.media="print",p.className="iepp-printshim",a.attachEvent("onbeforeprint",d._beforePrint),a.attachEvent("onafterprint",d._afterPrint))}(a,b),e._version=d,g.className=g.className.replace(/\bno-js\b/,"")+(f?" js "+q.join(" "):"");return e}(this,this.document),function(a,b,c){function k(a){return!a||a=="loaded"||a=="complete"}function j(){var a=1,b=-1;while(p.length- ++b)if(p[b].s&&!(a=p[b].r))break;a&&g()}function i(a){var c=b.createElement("script"),d;c.src=a.s,c.onreadystatechange=c.onload=function(){!d&&k(c.readyState)&&(d=1,j(),c.onload=c.onreadystatechange=null)},m(function(){d||(d=1,j())},H.errorTimeout),a.e?c.onload():n.parentNode.insertBefore(c,n)}function h(a){var c=b.createElement("link"),d;c.href=a.s,c.rel="stylesheet",c.type="text/css";if(!a.e&&(w||r)){var e=function(a){m(function(){if(!d)try{a.sheet.cssRules.length?(d=1,j()):e(a)}catch(b){b.code==1e3||b.message=="security"||b.message=="denied"?(d=1,m(function(){j()},0)):e(a)}},0)};e(c)}else c.onload=function(){d||(d=1,m(function(){j()},0))},a.e&&c.onload();m(function(){d||(d=1,j())},H.errorTimeout),!a.e&&n.parentNode.insertBefore(c,n)}function g(){var a=p.shift();q=1,a?a.t?m(function(){a.t=="c"?h(a):i(a)},0):(a(),j()):q=0}function f(a,c,d,e,f,h){function i(){!o&&k(l.readyState)&&(r.r=o=1,!q&&j(),l.onload=l.onreadystatechange=null,m(function(){u.removeChild(l)},0))}var l=b.createElement(a),o=0,r={t:d,s:c,e:h};l.src=l.data=c,!s&&(l.style.display="none"),l.width=l.height="0",a!="object"&&(l.type=d),l.onload=l.onreadystatechange=i,a=="img"?l.onerror=i:a=="script"&&(l.onerror=function(){r.e=r.r=1,g()}),p.splice(e,0,r),u.insertBefore(l,s?null:n),m(function(){o||(u.removeChild(l),r.r=r.e=o=1,j())},H.errorTimeout)}function e(a,b,c){var d=b=="c"?z:y;q=0,b=b||"j",C(a)?f(d,a,b,this.i++,l,c):(p.splice(this.i++,0,a),p.length==1&&g());return this}function d(){var a=H;a.loader={load:e,i:0};return a}var l=b.documentElement,m=a.setTimeout,n=b.getElementsByTagName("script")[0],o={}.toString,p=[],q=0,r="MozAppearance"in l.style,s=r&&!!b.createRange().compareNode,t=r&&!s,u=s?l:n.parentNode,v=a.opera&&o.call(a.opera)=="[object Opera]",w="webkitAppearance"in l.style,x=w&&"async"in b.createElement("script"),y=r?"object":v||x?"img":"script",z=w?"img":y,A=Array.isArray||function(a){return o.call(a)=="[object Array]"},B=function(a){return Object(a)===a},C=function(a){return typeof a=="string"},D=function(a){return o.call(a)=="[object Function]"},E=[],F={},G,H;H=function(a){function f(a){var b=a.split("!"),c=E.length,d=b.pop(),e=b.length,f={url:d,origUrl:d,prefixes:b},g,h;for(h=0;h<e;h++)g=F[b[h]],g&&(f=g(f));for(h=0;h<c;h++)f=E[h](f);return f}function e(a,b,e,g,h){var i=f(a),j=i.autoCallback;if(!i.bypass){b&&(b=D(b)?b:b[a]||b[g]||b[a.split("/").pop().split("?")[0]]);if(i.instead)return i.instead(a,b,e,g,h);e.load(i.url,i.forceCSS||!i.forceJS&&/css$/.test(i.url)?"c":c,i.noexec),(D(b)||D(j))&&e.load(function(){d(),b&&b(i.origUrl,h,g),j&&j(i.origUrl,h,g)})}}function b(a,b){function c(a){if(C(a))e(a,h,b,0,d);else if(B(a))for(i in a)a.hasOwnProperty(i)&&e(a[i],h,b,i,d)}var d=!!a.test,f=d?a.yep:a.nope,g=a.load||a.both,h=a.callback,i;c(f),c(g),a.complete&&b.load(a.complete)}var g,h,i=this.yepnope.loader;if(C(a))e(a,0,i,0);else if(A(a))for(g=0;g<a.length;g++)h=a[g],C(h)?e(h,0,i,0):A(h)?H(h):B(h)&&b(h,i);else B(a)&&b(a,i)},H.addPrefix=function(a,b){F[a]=b},H.addFilter=function(a){E.push(a)},H.errorTimeout=1e4,b.readyState==null&&b.addEventListener&&(b.readyState="loading",b.addEventListener("DOMContentLoaded",G=function(){b.removeEventListener("DOMContentLoaded",G,0),b.readyState="complete"},0)),a.yepnope=d()}(this,this.document),Modernizr.load=function(){yepnope.apply(window,[].slice.call(arguments,0))};


//
// showdown.js -- A javascript port of Markdown.
//
// Copyright (c) 2007 John Fraser.
//
// Original Markdown Copyright (c) 2004-2005 John Gruber
//   <http://daringfireball.net/projects/markdown/>
//
// Redistributable under a BSD-style open source license.
// See license.txt for more information.
//
// The full source distribution is at:
//
//				A A L
//				T C A
//				T K B
//
//   <http://www.attacklab.net/>
//

//
// Wherever possible, Showdown is a straight, line-by-line port
// of the Perl version of Markdown.
//
// This is not a normal parser design; it's basically just a
// series of string substitutions.  It's hard to read and
// maintain this way,  but keeping Showdown close to the original
// design makes it easier to port new features.
//
// More importantly, Showdown behaves like markdown.pl in most
// edge cases.  So web applications can do client-side preview
// in Javascript, and then build identical HTML on the server.
//
// This port needs the new RegExp functionality of ECMA 262,
// 3rd Edition (i.e. Javascript 1.5).  Most modern web browsers
// should do fine.  Even with the new regular expression features,
// We do a lot of work to emulate Perl's regex functionality.
// The tricky changes in this file mostly have the "attacklab:"
// label.  Major or self-explanatory changes don't.
//
// Smart diff tools like Araxis Merge will be able to match up
// this file with markdown.pl in a useful way.  A little tweaking
// helps: in a copy of markdown.pl, replace "#" with "//" and
// replace "$text" with "text".  Be sure to ignore whitespace
// and line endings.
//


//
// Showdown usage:
//
//   var text = "Markdown *rocks*.";
//
//   var converter = new Showdown.converter();
//   var html = converter.makeHtml(text);
//
//   alert(html);
//
// Note: move the sample code to the bottom of this
// file before uncommenting it.
//


//
// Showdown namespace
//
var Showdown = {};

//
// converter
//
// Wraps all "globals" so that the only thing
// exposed is makeHtml().
//
Showdown.converter = function() {

//
// Globals:
//

// Global hashes, used by various utility routines
var g_urls;
var g_titles;
var g_html_blocks;

// Used to track when we're inside an ordered or unordered list
// (see _ProcessListItems() for details):
var g_list_level = 0;


this.makeHtml = function(text) {
//
// Main function. The order in which other subs are called here is
// essential. Link and image substitutions need to happen before
// _EscapeSpecialCharsWithinTagAttributes(), so that any *'s or _'s in the <a>
// and <img> tags get encoded.
//

	// Clear the global hashes. If we don't clear these, you get conflicts
	// from other articles when generating a page which contains more than
	// one article (e.g. an index page that shows the N most recent
	// articles):
	g_urls = new Array();
	g_titles = new Array();
	g_html_blocks = new Array();

	// attacklab: Replace ~ with ~T
	// This lets us use tilde as an escape char to avoid md5 hashes
	// The choice of character is arbitray; anything that isn't
    // magic in Markdown will work.
	text = text.replace(/~/g,"~T");

	// attacklab: Replace $ with ~D
	// RegExp interprets $ as a special character
	// when it's in a replacement string
	text = text.replace(/\$/g,"~D");

	// Standardize line endings
	text = text.replace(/\r\n/g,"\n"); // DOS to Unix
	text = text.replace(/\r/g,"\n"); // Mac to Unix

	// Make sure text begins and ends with a couple of newlines:
	text = "\n\n" + text + "\n\n";

	// Convert all tabs to spaces.
	text = _Detab(text);

	// Strip any lines consisting only of spaces and tabs.
	// This makes subsequent regexen easier to write, because we can
	// match consecutive blank lines with /\n+/ instead of something
	// contorted like /[ \t]*\n+/ .
	text = text.replace(/^[ \t]+$/mg,"");

	// Turn block-level HTML blocks into hash entries
	text = _HashHTMLBlocks(text);

	// Strip link definitions, store in hashes.
	text = _StripLinkDefinitions(text);

	text = _RunBlockGamut(text);

	text = _UnescapeSpecialChars(text);

	// attacklab: Restore dollar signs
	text = text.replace(/~D/g,"$$");

	// attacklab: Restore tildes
	text = text.replace(/~T/g,"~");

	return text;
}


var _StripLinkDefinitions = function(text) {
//
// Strips link definitions from text, stores the URLs and titles in
// hash references.
//

	// Link defs are in the form: ^[id]: url "optional title"

	/*
		var text = text.replace(/
				^[ ]{0,3}\[(.+)\]:  // id = $1  attacklab: g_tab_width - 1
				  [ \t]*
				  \n?				// maybe *one* newline
				  [ \t]*
				<?(\S+?)>?			// url = $2
				  [ \t]*
				  \n?				// maybe one newline
				  [ \t]*
				(?:
				  (\n*)				// any lines skipped = $3 attacklab: lookbehind removed
				  ["(]
				  (.+?)				// title = $4
				  [")]
				  [ \t]*
				)?					// title is optional
				(?:\n+|$)
			  /gm,
			  function(){...});
	*/
	var text = text.replace(/^[ ]{0,3}\[(.+)\]:[ \t]*\n?[ \t]*<?(\S+?)>?[ \t]*\n?[ \t]*(?:(\n*)["(](.+?)[")][ \t]*)?(?:\n+|\Z)/gm,
		function (wholeMatch,m1,m2,m3,m4) {
			m1 = m1.toLowerCase();
			g_urls[m1] = _EncodeAmpsAndAngles(m2);  // Link IDs are case-insensitive
			if (m3) {
				// Oops, found blank lines, so it's not a title.
				// Put back the parenthetical statement we stole.
				return m3+m4;
			} else if (m4) {
				g_titles[m1] = m4.replace(/"/g,"&quot;");
			}
			
			// Completely remove the definition from the text
			return "";
		}
	);

	return text;
}


var _HashHTMLBlocks = function(text) {
	// attacklab: Double up blank lines to reduce lookaround
	text = text.replace(/\n/g,"\n\n");

	// Hashify HTML blocks:
	// We only want to do this for block-level HTML tags, such as headers,
	// lists, and tables. That's because we still want to wrap <p>s around
	// "paragraphs" that are wrapped in non-block-level tags, such as anchors,
	// phrase emphasis, and spans. The list of tags we're looking for is
	// hard-coded:
	var block_tags_a = "p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|ins|del"
	var block_tags_b = "p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math"

	// First, look for nested blocks, e.g.:
	//   <div>
	//     <div>
	//     tags for inner block must be indented.
	//     </div>
	//   </div>
	//
	// The outermost tags must start at the left margin for this to match, and
	// the inner nested divs must be indented.
	// We need to do this before the next, more liberal match, because the next
	// match will start at the first `<div>` and stop at the first `</div>`.

	// attacklab: This regex can be expensive when it fails.
	/*
		var text = text.replace(/
		(						// save in $1
			^					// start of line  (with /m)
			<($block_tags_a)	// start tag = $2
			\b					// word break
								// attacklab: hack around khtml/pcre bug...
			[^\r]*?\n			// any number of lines, minimally matching
			</\2>				// the matching end tag
			[ \t]*				// trailing spaces/tabs
			(?=\n+)				// followed by a newline
		)						// attacklab: there are sentinel newlines at end of document
		/gm,function(){...}};
	*/
	text = text.replace(/^(<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|ins|del)\b[^\r]*?\n<\/\2>[ \t]*(?=\n+))/gm,hashElement);

	//
	// Now match more liberally, simply from `\n<tag>` to `</tag>\n`
	//

	/*
		var text = text.replace(/
		(						// save in $1
			^					// start of line  (with /m)
			<($block_tags_b)	// start tag = $2
			\b					// word break
								// attacklab: hack around khtml/pcre bug...
			[^\r]*?				// any number of lines, minimally matching
			.*</\2>				// the matching end tag
			[ \t]*				// trailing spaces/tabs
			(?=\n+)				// followed by a newline
		)						// attacklab: there are sentinel newlines at end of document
		/gm,function(){...}};
	*/
	text = text.replace(/^(<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math)\b[^\r]*?.*<\/\2>[ \t]*(?=\n+)\n)/gm,hashElement);

	// Special case just for <hr />. It was easier to make a special case than
	// to make the other regex more complicated.  

	/*
		text = text.replace(/
		(						// save in $1
			\n\n				// Starting after a blank line
			[ ]{0,3}
			(<(hr)				// start tag = $2
			\b					// word break
			([^<>])*?			// 
			\/?>)				// the matching end tag
			[ \t]*
			(?=\n{2,})			// followed by a blank line
		)
		/g,hashElement);
	*/
	text = text.replace(/(\n[ ]{0,3}(<(hr)\b([^<>])*?\/?>)[ \t]*(?=\n{2,}))/g,hashElement);

	// Special case for standalone HTML comments:

	/*
		text = text.replace(/
		(						// save in $1
			\n\n				// Starting after a blank line
			[ ]{0,3}			// attacklab: g_tab_width - 1
			<!
			(--[^\r]*?--\s*)+
			>
			[ \t]*
			(?=\n{2,})			// followed by a blank line
		)
		/g,hashElement);
	*/
	text = text.replace(/(\n\n[ ]{0,3}<!(--[^\r]*?--\s*)+>[ \t]*(?=\n{2,}))/g,hashElement);

	// PHP and ASP-style processor instructions (<?...?> and <%...%>)

	/*
		text = text.replace(/
		(?:
			\n\n				// Starting after a blank line
		)
		(						// save in $1
			[ ]{0,3}			// attacklab: g_tab_width - 1
			(?:
				<([?%])			// $2
				[^\r]*?
				\2>
			)
			[ \t]*
			(?=\n{2,})			// followed by a blank line
		)
		/g,hashElement);
	*/
	text = text.replace(/(?:\n\n)([ ]{0,3}(?:<([?%])[^\r]*?\2>)[ \t]*(?=\n{2,}))/g,hashElement);

	// attacklab: Undo double lines (see comment at top of this function)
	text = text.replace(/\n\n/g,"\n");
	return text;
}

var hashElement = function(wholeMatch,m1) {
	var blockText = m1;

	// Undo double lines
	blockText = blockText.replace(/\n\n/g,"\n");
	blockText = blockText.replace(/^\n/,"");
	
	// strip trailing blank lines
	blockText = blockText.replace(/\n+$/g,"");
	
	// Replace the element text with a marker ("~KxK" where x is its key)
	blockText = "\n\n~K" + (g_html_blocks.push(blockText)-1) + "K\n\n";
	
	return blockText;
};

var _RunBlockGamut = function(text) {
//
// These are all the transformations that form block-level
// tags like paragraphs, headers, and list items.
//
	text = _DoHeaders(text);

	// Do Horizontal Rules:
	var key = hashBlock("<hr />");
	text = text.replace(/^[ ]{0,2}([ ]?\*[ ]?){3,}[ \t]*$/gm,key);
	text = text.replace(/^[ ]{0,2}([ ]?\-[ ]?){3,}[ \t]*$/gm,key);
	text = text.replace(/^[ ]{0,2}([ ]?\_[ ]?){3,}[ \t]*$/gm,key);

	text = _DoLists(text);
	text = _DoCodeBlocks(text);
	text = _DoBlockQuotes(text);

	// We already ran _HashHTMLBlocks() before, in Markdown(), but that
	// was to escape raw HTML in the original Markdown source. This time,
	// we're escaping the markup we've just created, so that we don't wrap
	// <p> tags around block-level tags.
	text = _HashHTMLBlocks(text);
	text = _FormParagraphs(text);

	return text;
}


var _RunSpanGamut = function(text) {
//
// These are all the transformations that occur *within* block-level
// tags like paragraphs, headers, and list items.
//

	text = _DoCodeSpans(text);
	text = _EscapeSpecialCharsWithinTagAttributes(text);
	text = _EncodeBackslashEscapes(text);

	// Process anchor and image tags. Images must come first,
	// because ![foo][f] looks like an anchor.
	text = _DoImages(text);
	text = _DoAnchors(text);

	// Make links out of things like `<http://example.com/>`
	// Must come after _DoAnchors(), because you can use < and >
	// delimiters in inline links like [this](<url>).
	text = _DoAutoLinks(text);
	text = _EncodeAmpsAndAngles(text);
	text = _DoItalicsAndBold(text);

	// Do hard breaks:
	text = text.replace(/  +\n/g," <br />\n");

	return text;
}

var _EscapeSpecialCharsWithinTagAttributes = function(text) {
//
// Within tags -- meaning between < and > -- encode [\ ` * _] so they
// don't conflict with their use in Markdown for code, italics and strong.
//

	// Build a regex to find HTML tags and comments.  See Friedl's 
	// "Mastering Regular Expressions", 2nd Ed., pp. 200-201.
	var regex = /(<[a-z\/!$]("[^"]*"|'[^']*'|[^'">])*>|<!(--.*?--\s*)+>)/gi;

	text = text.replace(regex, function(wholeMatch) {
		var tag = wholeMatch.replace(/(.)<\/?code>(?=.)/g,"$1`");
		tag = escapeCharacters(tag,"\\`*_");
		return tag;
	});

	return text;
}

var _DoAnchors = function(text) {
//
// Turn Markdown link shortcuts into XHTML <a> tags.
//
	//
	// First, handle reference-style links: [link text] [id]
	//

	/*
		text = text.replace(/
		(							// wrap whole match in $1
			\[
			(
				(?:
					\[[^\]]*\]		// allow brackets nested one level
					|
					[^\[]			// or anything else
				)*
			)
			\]

			[ ]?					// one optional space
			(?:\n[ ]*)?				// one optional newline followed by spaces

			\[
			(.*?)					// id = $3
			\]
		)()()()()					// pad remaining backreferences
		/g,_DoAnchors_callback);
	*/
	text = text.replace(/(\[((?:\[[^\]]*\]|[^\[\]])*)\][ ]?(?:\n[ ]*)?\[(.*?)\])()()()()/g,writeAnchorTag);

	//
	// Next, inline-style links: [link text](url "optional title")
	//

	/*
		text = text.replace(/
			(						// wrap whole match in $1
				\[
				(
					(?:
						\[[^\]]*\]	// allow brackets nested one level
					|
					[^\[\]]			// or anything else
				)
			)
			\]
			\(						// literal paren
			[ \t]*
			()						// no id, so leave $3 empty
			<?(.*?)>?				// href = $4
			[ \t]*
			(						// $5
				(['"])				// quote char = $6
				(.*?)				// Title = $7
				\6					// matching quote
				[ \t]*				// ignore any spaces/tabs between closing quote and )
			)?						// title is optional
			\)
		)
		/g,writeAnchorTag);
	*/
	text = text.replace(/(\[((?:\[[^\]]*\]|[^\[\]])*)\]\([ \t]*()<?(.*?)>?[ \t]*((['"])(.*?)\6[ \t]*)?\))/g,writeAnchorTag);

	//
	// Last, handle reference-style shortcuts: [link text]
	// These must come last in case you've also got [link test][1]
	// or [link test](/foo)
	//

	/*
		text = text.replace(/
		(		 					// wrap whole match in $1
			\[
			([^\[\]]+)				// link text = $2; can't contain '[' or ']'
			\]
		)()()()()()					// pad rest of backreferences
		/g, writeAnchorTag);
	*/
	text = text.replace(/(\[([^\[\]]+)\])()()()()()/g, writeAnchorTag);

	return text;
}

var writeAnchorTag = function(wholeMatch,m1,m2,m3,m4,m5,m6,m7) {
	if (m7 == undefined) m7 = "";
	var whole_match = m1;
	var link_text   = m2;
	var link_id	 = m3.toLowerCase();
	var url		= m4;
	var title	= m7;
	
	if (url == "") {
		if (link_id == "") {
			// lower-case and turn embedded newlines into spaces
			link_id = link_text.toLowerCase().replace(/ ?\n/g," ");
		}
		url = "#"+link_id;
		
		if (g_urls[link_id] != undefined) {
			url = g_urls[link_id];
			if (g_titles[link_id] != undefined) {
				title = g_titles[link_id];
			}
		}
		else {
			if (whole_match.search(/\(\s*\)$/m)>-1) {
				// Special case for explicit empty url
				url = "";
			} else {
				return whole_match;
			}
		}
	}	
	
	url = escapeCharacters(url,"*_");
	var result = "<a href=\"" + url + "\"";
	
	if (title != "") {
		title = title.replace(/"/g,"&quot;");
		title = escapeCharacters(title,"*_");
		result +=  " title=\"" + title + "\"";
	}
	
	result += ">" + link_text + "</a>";
	
	return result;
}


var _DoImages = function(text) {
//
// Turn Markdown image shortcuts into <img> tags.
//

	//
	// First, handle reference-style labeled images: ![alt text][id]
	//

	/*
		text = text.replace(/
		(						// wrap whole match in $1
			!\[
			(.*?)				// alt text = $2
			\]

			[ ]?				// one optional space
			(?:\n[ ]*)?			// one optional newline followed by spaces

			\[
			(.*?)				// id = $3
			\]
		)()()()()				// pad rest of backreferences
		/g,writeImageTag);
	*/
	text = text.replace(/(!\[(.*?)\][ ]?(?:\n[ ]*)?\[(.*?)\])()()()()/g,writeImageTag);

	//
	// Next, handle inline images:  ![alt text](url "optional title")
	// Don't forget: encode * and _

	/*
		text = text.replace(/
		(						// wrap whole match in $1
			!\[
			(.*?)				// alt text = $2
			\]
			\s?					// One optional whitespace character
			\(					// literal paren
			[ \t]*
			()					// no id, so leave $3 empty
			<?(\S+?)>?			// src url = $4
			[ \t]*
			(					// $5
				(['"])			// quote char = $6
				(.*?)			// title = $7
				\6				// matching quote
				[ \t]*
			)?					// title is optional
		\)
		)
		/g,writeImageTag);
	*/
	text = text.replace(/(!\[(.*?)\]\s?\([ \t]*()<?(\S+?)>?[ \t]*((['"])(.*?)\6[ \t]*)?\))/g,writeImageTag);

	return text;
}

var writeImageTag = function(wholeMatch,m1,m2,m3,m4,m5,m6,m7) {
	var whole_match = m1;
	var alt_text   = m2;
	var link_id	 = m3.toLowerCase();
	var url		= m4;
	var title	= m7;

	if (!title) title = "";
	
	if (url == "") {
		if (link_id == "") {
			// lower-case and turn embedded newlines into spaces
			link_id = alt_text.toLowerCase().replace(/ ?\n/g," ");
		}
		url = "#"+link_id;
		
		if (g_urls[link_id] != undefined) {
			url = g_urls[link_id];
			if (g_titles[link_id] != undefined) {
				title = g_titles[link_id];
			}
		}
		else {
			return whole_match;
		}
	}	
	
	alt_text = alt_text.replace(/"/g,"&quot;");
	url = escapeCharacters(url,"*_");
	var result = "<img src=\"" + url + "\" alt=\"" + alt_text + "\"";

	// attacklab: Markdown.pl adds empty title attributes to images.
	// Replicate this bug.

	//if (title != "") {
		title = title.replace(/"/g,"&quot;");
		title = escapeCharacters(title,"*_");
		result +=  " title=\"" + title + "\"";
	//}
	
	result += " />";
	
	return result;
}


var _DoHeaders = function(text) {

	// Setext-style headers:
	//	Header 1
	//	========
	//  
	//	Header 2
	//	--------
	//
	text = text.replace(/^(.+)[ \t]*\n=+[ \t]*\n+/gm,
		function(wholeMatch,m1){return hashBlock('<h1 id="' + headerId(m1) + '">' + _RunSpanGamut(m1) + "</h1>");});

	text = text.replace(/^(.+)[ \t]*\n-+[ \t]*\n+/gm,
		function(matchFound,m1){return hashBlock('<h2 id="' + headerId(m1) + '">' + _RunSpanGamut(m1) + "</h2>");});

	// atx-style headers:
	//  # Header 1
	//  ## Header 2
	//  ## Header 2 with closing hashes ##
	//  ...
	//  ###### Header 6
	//

	/*
		text = text.replace(/
			^(\#{1,6})				// $1 = string of #'s
			[ \t]*
			(.+?)					// $2 = Header text
			[ \t]*
			\#*						// optional closing #'s (not counted)
			\n+
		/gm, function() {...});
	*/

	text = text.replace(/^(\#{1,6})[ \t]*(.+?)[ \t]*\#*\n+/gm,
		function(wholeMatch,m1,m2) {
			var h_level = m1.length;
			return hashBlock("<h" + h_level + ' id="' + headerId(m2) + '">' + _RunSpanGamut(m2) + "</h" + h_level + ">");
		});

	function headerId(m) {
		return m.replace(/[^\w]/g, '').toLowerCase();
	}
	return text;
}

// This declaration keeps Dojo compressor from outputting garbage:
var _ProcessListItems;

var _DoLists = function(text) {
//
// Form HTML ordered (numbered) and unordered (bulleted) lists.
//

	// attacklab: add sentinel to hack around khtml/safari bug:
	// http://bugs.webkit.org/show_bug.cgi?id=11231
	text += "~0";

	// Re-usable pattern to match any entirel ul or ol list:

	/*
		var whole_list = /
		(									// $1 = whole list
			(								// $2
				[ ]{0,3}					// attacklab: g_tab_width - 1
				([*+-]|\d+[.])				// $3 = first list item marker
				[ \t]+
			)
			[^\r]+?
			(								// $4
				~0							// sentinel for workaround; should be $
			|
				\n{2,}
				(?=\S)
				(?!							// Negative lookahead for another list item marker
					[ \t]*
					(?:[*+-]|\d+[.])[ \t]+
				)
			)
		)/g
	*/
	var whole_list = /^(([ ]{0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(~0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm;

	if (g_list_level) {
		text = text.replace(whole_list,function(wholeMatch,m1,m2) {
			var list = m1;
			var list_type = (m2.search(/[*+-]/g)>-1) ? "ul" : "ol";

			// Turn double returns into triple returns, so that we can make a
			// paragraph for the last item in a list, if necessary:
			list = list.replace(/\n{2,}/g,"\n\n\n");;
			var result = _ProcessListItems(list);
	
			// Trim any trailing whitespace, to put the closing `</$list_type>`
			// up on the preceding line, to get it past the current stupid
			// HTML block parser. This is a hack to work around the terrible
			// hack that is the HTML block parser.
			result = result.replace(/\s+$/,"");
			result = "<"+list_type+">" + result + "</"+list_type+">\n";
			return result;
		});
	} else {
		whole_list = /(\n\n|^\n?)(([ ]{0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(~0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/g;
		text = text.replace(whole_list,function(wholeMatch,m1,m2,m3) {
			var runup = m1;
			var list = m2;

			var list_type = (m3.search(/[*+-]/g)>-1) ? "ul" : "ol";
			// Turn double returns into triple returns, so that we can make a
			// paragraph for the last item in a list, if necessary:
			var list = list.replace(/\n{2,}/g,"\n\n\n");;
			var result = _ProcessListItems(list);
			result = runup + "<"+list_type+">\n" + result + "</"+list_type+">\n";	
			return result;
		});
	}

	// attacklab: strip sentinel
	text = text.replace(/~0/,"");

	return text;
}

_ProcessListItems = function(list_str) {
//
//  Process the contents of a single ordered or unordered list, splitting it
//  into individual list items.
//
	// The $g_list_level global keeps track of when we're inside a list.
	// Each time we enter a list, we increment it; when we leave a list,
	// we decrement. If it's zero, we're not in a list anymore.
	//
	// We do this because when we're not inside a list, we want to treat
	// something like this:
	//
	//    I recommend upgrading to version
	//    8. Oops, now this line is treated
	//    as a sub-list.
	//
	// As a single paragraph, despite the fact that the second line starts
	// with a digit-period-space sequence.
	//
	// Whereas when we're inside a list (or sub-list), that line will be
	// treated as the start of a sub-list. What a kludge, huh? This is
	// an aspect of Markdown's syntax that's hard to parse perfectly
	// without resorting to mind-reading. Perhaps the solution is to
	// change the syntax rules such that sub-lists must start with a
	// starting cardinal number; e.g. "1." or "a.".

	g_list_level++;

	// trim trailing blank lines:
	list_str = list_str.replace(/\n{2,}$/,"\n");

	// attacklab: add sentinel to emulate \z
	list_str += "~0";

	/*
		list_str = list_str.replace(/
			(\n)?							// leading line = $1
			(^[ \t]*)						// leading whitespace = $2
			([*+-]|\d+[.]) [ \t]+			// list marker = $3
			([^\r]+?						// list item text   = $4
			(\n{1,2}))
			(?= \n* (~0 | \2 ([*+-]|\d+[.]) [ \t]+))
		/gm, function(){...});
	*/
	list_str = list_str.replace(/(\n)?(^[ \t]*)([*+-]|\d+[.])[ \t]+([^\r]+?(\n{1,2}))(?=\n*(~0|\2([*+-]|\d+[.])[ \t]+))/gm,
		function(wholeMatch,m1,m2,m3,m4){
			var item = m4;
			var leading_line = m1;
			var leading_space = m2;

			if (leading_line || (item.search(/\n{2,}/)>-1)) {
				item = _RunBlockGamut(_Outdent(item));
			}
			else {
				// Recursion for sub-lists:
				item = _DoLists(_Outdent(item));
				item = item.replace(/\n$/,""); // chomp(item)
				item = _RunSpanGamut(item);
			}

			return  "<li>" + item + "</li>\n";
		}
	);

	// attacklab: strip sentinel
	list_str = list_str.replace(/~0/g,"");

	g_list_level--;
	return list_str;
}


var _DoCodeBlocks = function(text) {
//
//  Process Markdown `<pre><code>` blocks.
//  

	/*
		text = text.replace(text,
			/(?:\n\n|^)
			(								// $1 = the code block -- one or more lines, starting with a space/tab
				(?:
					(?:[ ]{4}|\t)			// Lines must start with a tab or a tab-width of spaces - attacklab: g_tab_width
					.*\n+
				)+
			)
			(\n*[ ]{0,3}[^ \t\n]|(?=~0))	// attacklab: g_tab_width
		/g,function(){...});
	*/

	// attacklab: sentinel workarounds for lack of \A and \Z, safari\khtml bug
	text += "~0";
	
	text = text.replace(/(?:\n\n|^)((?:(?:[ ]{4}|\t).*\n+)+)(\n*[ ]{0,3}[^ \t\n]|(?=~0))/g,
		function(wholeMatch,m1,m2) {
			var codeblock = m1;
			var nextChar = m2;
		
			codeblock = _EncodeCode( _Outdent(codeblock));
			codeblock = _Detab(codeblock);
			codeblock = codeblock.replace(/^\n+/g,""); // trim leading newlines
			codeblock = codeblock.replace(/\n+$/g,""); // trim trailing whitespace

			codeblock = "<pre><code>" + codeblock + "\n</code></pre>";

			return hashBlock(codeblock) + nextChar;
		}
	);

	// attacklab: strip sentinel
	text = text.replace(/~0/,"");

	return text;
}

var hashBlock = function(text) {
	text = text.replace(/(^\n+|\n+$)/g,"");
	return "\n\n~K" + (g_html_blocks.push(text)-1) + "K\n\n";
}


var _DoCodeSpans = function(text) {
//
//   *  Backtick quotes are used for <code></code> spans.
// 
//   *  You can use multiple backticks as the delimiters if you want to
//	 include literal backticks in the code span. So, this input:
//	 
//		 Just type ``foo `bar` baz`` at the prompt.
//	 
//	   Will translate to:
//	 
//		 <p>Just type <code>foo `bar` baz</code> at the prompt.</p>
//	 
//	There's no arbitrary limit to the number of backticks you
//	can use as delimters. If you need three consecutive backticks
//	in your code, use four for delimiters, etc.
//
//  *  You can use spaces to get literal backticks at the edges:
//	 
//		 ... type `` `bar` `` ...
//	 
//	   Turns to:
//	 
//		 ... type <code>`bar`</code> ...
//

	/*
		text = text.replace(/
			(^|[^\\])					// Character before opening ` can't be a backslash
			(`+)						// $2 = Opening run of `
			(							// $3 = The code block
				[^\r]*?
				[^`]					// attacklab: work around lack of lookbehind
			)
			\2							// Matching closer
			(?!`)
		/gm, function(){...});
	*/

	text = text.replace(/(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm,
		function(wholeMatch,m1,m2,m3,m4) {
			var c = m3;
			c = c.replace(/^([ \t]*)/g,"");	// leading whitespace
			c = c.replace(/[ \t]*$/g,"");	// trailing whitespace
			c = _EncodeCode(c);
			return m1+"<code>"+c+"</code>";
		});

	return text;
}


var _EncodeCode = function(text) {
//
// Encode/escape certain characters inside Markdown code runs.
// The point is that in code, these characters are literals,
// and lose their special Markdown meanings.
//
	// Encode all ampersands; HTML entities are not
	// entities within a Markdown code span.
	text = text.replace(/&/g,"&amp;");

	// Do the angle bracket song and dance:
	text = text.replace(/</g,"&lt;");
	text = text.replace(/>/g,"&gt;");

	// Now, escape characters that are magic in Markdown:
	text = escapeCharacters(text,"\*_{}[]\\",false);

// jj the line above breaks this:
//---

//* Item

//   1. Subitem

//            special char: *
//---

	return text;
}


var _DoItalicsAndBold = function(text) {

	// <strong> must go first:
	text = text.replace(/(\*\*|__)(?=\S)([^\r]*?\S[*_]*)\1/g,
		"<strong>$2</strong>");

	text = text.replace(/(\*|_)(?=\S)([^\r]*?\S)\1/g,
		"<em>$2</em>");

	return text;
}


var _DoBlockQuotes = function(text) {

	/*
		text = text.replace(/
		(								// Wrap whole match in $1
			(
				^[ \t]*>[ \t]?			// '>' at the start of a line
				.+\n					// rest of the first line
				(.+\n)*					// subsequent consecutive lines
				\n*						// blanks
			)+
		)
		/gm, function(){...});
	*/

	text = text.replace(/((^[ \t]*>[ \t]?.+\n(.+\n)*\n*)+)/gm,
		function(wholeMatch,m1) {
			var bq = m1;

			// attacklab: hack around Konqueror 3.5.4 bug:
			// "----------bug".replace(/^-/g,"") == "bug"

			bq = bq.replace(/^[ \t]*>[ \t]?/gm,"~0");	// trim one level of quoting

			// attacklab: clean up hack
			bq = bq.replace(/~0/g,"");

			bq = bq.replace(/^[ \t]+$/gm,"");		// trim whitespace-only lines
			bq = _RunBlockGamut(bq);				// recurse
			
			bq = bq.replace(/(^|\n)/g,"$1  ");
			// These leading spaces screw with <pre> content, so we need to fix that:
			bq = bq.replace(
					/(\s*<pre>[^\r]+?<\/pre>)/gm,
				function(wholeMatch,m1) {
					var pre = m1;
					// attacklab: hack around Konqueror 3.5.4 bug:
					pre = pre.replace(/^  /mg,"~0");
					pre = pre.replace(/~0/g,"");
					return pre;
				});
			
			return hashBlock("<blockquote>\n" + bq + "\n</blockquote>");
		});
	return text;
}


var _FormParagraphs = function(text) {
//
//  Params:
//    $text - string to process with html <p> tags
//

	// Strip leading and trailing lines:
	text = text.replace(/^\n+/g,"");
	text = text.replace(/\n+$/g,"");

	var grafs = text.split(/\n{2,}/g);
	var grafsOut = new Array();

	//
	// Wrap <p> tags.
	//
	var end = grafs.length;
	for (var i=0; i<end; i++) {
		var str = grafs[i];

		// if this is an HTML marker, copy it
		if (str.search(/~K(\d+)K/g) >= 0) {
			grafsOut.push(str);
		}
		else if (str.search(/\S/) >= 0) {
			str = _RunSpanGamut(str);
			str = str.replace(/^([ \t]*)/g,"<p>");
			str += "</p>"
			grafsOut.push(str);
		}

	}

	//
	// Unhashify HTML blocks
	//
	end = grafsOut.length;
	for (var i=0; i<end; i++) {
		// if this is a marker for an html block...
		while (grafsOut[i].search(/~K(\d+)K/) >= 0) {
			var blockText = g_html_blocks[RegExp.$1];
			blockText = blockText.replace(/\$/g,"$$$$"); // Escape any dollar signs
			grafsOut[i] = grafsOut[i].replace(/~K\d+K/,blockText);
		}
	}

	return grafsOut.join("\n\n");
}


var _EncodeAmpsAndAngles = function(text) {
// Smart processing for ampersands and angle brackets that need to be encoded.
	
	// Ampersand-encoding based entirely on Nat Irons's Amputator MT plugin:
	//   http://bumppo.net/projects/amputator/
	text = text.replace(/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w+);)/g,"&amp;");
	
	// Encode naked <'s
	text = text.replace(/<(?![a-z\/?\$!])/gi,"&lt;");
	
	return text;
}


var _EncodeBackslashEscapes = function(text) {
//
//   Parameter:  String.
//   Returns:	The string, with after processing the following backslash
//			   escape sequences.
//

	// attacklab: The polite way to do this is with the new
	// escapeCharacters() function:
	//
	// 	text = escapeCharacters(text,"\\",true);
	// 	text = escapeCharacters(text,"`*_{}[]()>#+-.!",true);
	//
	// ...but we're sidestepping its use of the (slow) RegExp constructor
	// as an optimization for Firefox.  This function gets called a LOT.

	text = text.replace(/\\(\\)/g,escapeCharacters_callback);
	text = text.replace(/\\([`*_{}\[\]()>#+-.!])/g,escapeCharacters_callback);
	return text;
}


var _DoAutoLinks = function(text) {

	text = text.replace(/<((https?|ftp|dict):[^'">\s]+)>/gi,"<a href=\"$1\">$1</a>");

	// Email addresses: <address@domain.foo>

	/*
		text = text.replace(/
			<
			(?:mailto:)?
			(
				[-.\w]+
				\@
				[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+
			)
			>
		/gi, _DoAutoLinks_callback());
	*/
	text = text.replace(/<(?:mailto:)?([-.\w]+\@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)>/gi,
		function(wholeMatch,m1) {
			return _EncodeEmailAddress( _UnescapeSpecialChars(m1) );
		}
	);

	return text;
}


var _EncodeEmailAddress = function(addr) {
//
//  Input: an email address, e.g. "foo@example.com"
//
//  Output: the email address as a mailto link, with each character
//	of the address encoded as either a decimal or hex entity, in
//	the hopes of foiling most address harvesting spam bots. E.g.:
//
//	<a href="&#x6D;&#97;&#105;&#108;&#x74;&#111;:&#102;&#111;&#111;&#64;&#101;
//	   x&#x61;&#109;&#x70;&#108;&#x65;&#x2E;&#99;&#111;&#109;">&#102;&#111;&#111;
//	   &#64;&#101;x&#x61;&#109;&#x70;&#108;&#x65;&#x2E;&#99;&#111;&#109;</a>
//
//  Based on a filter by Matthew Wickline, posted to the BBEdit-Talk
//  mailing list: <http://tinyurl.com/yu7ue>
//

	// attacklab: why can't javascript speak hex?
	function char2hex(ch) {
		var hexDigits = '0123456789ABCDEF';
		var dec = ch.charCodeAt(0);
		return(hexDigits.charAt(dec>>4) + hexDigits.charAt(dec&15));
	}

	var encode = [
		function(ch){return "&#"+ch.charCodeAt(0)+";";},
		function(ch){return "&#x"+char2hex(ch)+";";},
		function(ch){return ch;}
	];

	addr = "mailto:" + addr;

	addr = addr.replace(/./g, function(ch) {
		if (ch == "@") {
		   	// this *must* be encoded. I insist.
			ch = encode[Math.floor(Math.random()*2)](ch);
		} else if (ch !=":") {
			// leave ':' alone (to spot mailto: later)
			var r = Math.random();
			// roughly 10% raw, 45% hex, 45% dec
			ch =  (
					r > .9  ?	encode[2](ch)   :
					r > .45 ?	encode[1](ch)   :
								encode[0](ch)
				);
		}
		return ch;
	});

	addr = "<a href=\"" + addr + "\">" + addr + "</a>";
	addr = addr.replace(/">.+:/g,"\">"); // strip the mailto: from the visible part

	return addr;
}


var _UnescapeSpecialChars = function(text) {
//
// Swap back in all the special characters we've hidden.
//
	text = text.replace(/~E(\d+)E/g,
		function(wholeMatch,m1) {
			var charCodeToReplace = parseInt(m1);
			return String.fromCharCode(charCodeToReplace);
		}
	);
	return text;
}


var _Outdent = function(text) {
//
// Remove one level of line-leading tabs or spaces
//

	// attacklab: hack around Konqueror 3.5.4 bug:
	// "----------bug".replace(/^-/g,"") == "bug"

	text = text.replace(/^(\t|[ ]{1,4})/gm,"~0"); // attacklab: g_tab_width

	// attacklab: clean up hack
	text = text.replace(/~0/g,"")

	return text;
}

var _Detab = function(text) {
// attacklab: Detab's completely rewritten for speed.
// In perl we could fix it by anchoring the regexp with \G.
// In javascript we're less fortunate.

	// expand first n-1 tabs
	text = text.replace(/\t(?=\t)/g,"    "); // attacklab: g_tab_width

	// replace the nth with two sentinels
	text = text.replace(/\t/g,"~A~B");

	// use the sentinel to anchor our regex so it doesn't explode
	text = text.replace(/~B(.+?)~A/g,
		function(wholeMatch,m1,m2) {
			var leadingText = m1;
			var numSpaces = 4 - leadingText.length % 4;  // attacklab: g_tab_width

			// there *must* be a better way to do this:
			for (var i=0; i<numSpaces; i++) leadingText+=" ";

			return leadingText;
		}
	);

	// clean up sentinels
	text = text.replace(/~A/g,"    ");  // attacklab: g_tab_width
	text = text.replace(/~B/g,"");

	return text;
}


//
//  attacklab: Utility functions
//


var escapeCharacters = function(text, charsToEscape, afterBackslash) {
	// First we have to escape the escape characters so that
	// we can build a character class out of them
	var regexString = "([" + charsToEscape.replace(/([\[\]\\])/g,"\\$1") + "])";

	if (afterBackslash) {
		regexString = "\\\\" + regexString;
	}

	var regex = new RegExp(regexString,"g");
	text = text.replace(regex,escapeCharacters_callback);

	return text;
}


var escapeCharacters_callback = function(wholeMatch,m1) {
	var charCodeToEscape = m1.charCodeAt(0);
	return "~E"+charCodeToEscape+"E";
}

} // end of Showdown.converter

// export
if (typeof exports != 'undefined') exports.Showdown = Showdown;
/*
 *  Sugar Library v0.9.1
 *
 *  Freely distributable and licensed under the MIT-style license.
 *  Copyright (c) 2011 Andrew Plummer
 *  http://sugarjs.com/
 *
 * ---------------------------- */
(function(){var k=function(a,b,c){for(var d in c)if(c.hasOwnProperty(d)&&(b?!a.prototype[d]:!a[d]))b?j(a.prototype,d,c[d]):j(a,d,c[d])},s=function(a,b,c,d){var e=b?a.prototype:a;q(d,function(f,g){j(e,f,Y(e[f],g,c))})},Y=function(a,b,c){return function(){return a&&(c===true||c.apply(this,arguments))?a.apply(this,arguments):b.apply(this,arguments)}},j=function(a,b,c){if(Object.defineProperty&&Object.defineProperties)Object.defineProperty(a,b,{value:c,configurable:true,enumerable:false,writeable:true});
else a[b]=c},t=function(a){if(typeof a[0]==="object")return a;else if(a.length==1&&Object.isNumber(a[0]))return[a[0]];for(var b={},c=Array.prototype.slice.call(arguments,1),d=0;d<a.length;d++)b[c[d]]=a[d];return[b]},y=function(a,b){if(typeof a=="object"&&typeof b=="object"){var c=false,d;for(d in a)if(a.hasOwnProperty(d)){if(!y(a[d],b[d]))return false;c=true}if(!c)for(d in b)if(b.hasOwnProperty(d))return false;return true}else return a===b},n=function(a,b,c,d){return Object.isRegExp(b)?b.test(a):
Object.isFunction(b)?b.apply(c,[a].concat(d)):typeof b==="object"?y(b,a):b!==undefined?b===a:!!a},u=function(a,b,c,d){return Object.isFunction(b)?b.apply(c,[a].concat(d)):b===undefined?a:typeof a[b]=="function"?a[b].call(a):a[b]},z=function(a,b,c){var d=b==="max";b=b==="min";var e=d?-Infinity:Infinity,f=[],g;for(g in a)if(a.hasOwnProperty(g)){var h=a[g],i=u(h,c);if(!(i===undefined||i===null))if(i===e)f.push(h);else if(d&&i>e||b&&i<e){f=[h];e=i}}return f},L=function(a,b,c){var d=b[b.length-1]!==false,
e=[],f,g;for(g=0;g<b.length;g++){f=b[g];if(f===true||f===false)break;if(d){f%=a.length;if(f<0)f=a.length+f}if(f>=0&&f<a.length)e.push(c?a.charAt(f):a[f])}return e.length==0?c?"":null:e.length==1?e[0]:e},I=function(a,b){return Object.prototype.toString.call(a)==="[object "+b+"]"},A=function(a){var b=Object.isArray(a)?[]:Object.extended({});q(a,function(c,d){b[c]=Object.isObject(d)||Object.isArray(d)?A(d):d});return b},v=function(a){var b=this;q(a,function(c,d){b[c]=d})};v.prototype.constructor=Object;
var M=["Array","Boolean","Date","Function","Number","String","RegExp"],N=["keys","values","each","merge","isEmpty","equals"],q=function(a,b){var c=0,d;for(d in a)if(a.hasOwnProperty(d)){b.call(a,d,a[d],c);c++}};k(Object,false,{extended:function(a){return new v(a)}});k(Object,false,{isObject:function(a){return a===null||a===undefined||arguments.length===0?false:I(a,"Object")&&a.constructor===Object},each:function(a,b){q(a,function(c,d){b&&b.call(a,c,d,a)});return a},merge:function(){for(var a=arguments[0],
b=1;b<arguments.length;b++){var c=arguments[b],d;for(d in c)if(c.hasOwnProperty(d))a[d]=c[d]}return a},isEmpty:function(a){return y(a,{})},equals:function(a,b){return y(a,b)}});s(Object,false,function(){return arguments.length==1},{keys:function(a,b){var c=[];q(a,function(d){c.push(d);b&&b.call(a,d)});return c},values:function(a,b){var c=[];q(a,function(d,e){c.push(e);b&&b.call(a,e)});return c}});RegExp.NPCGSupport=/()??/.exec("")[1]===undefined;k(RegExp,false,{escape:function(a){return a.replace(/([/'*+?|()\[\]{}.^$])/g,
"\\$1")}});k(RegExp,true,{setFlags:function(a){return RegExp(this.source,a)},addFlag:function(a){var b="";if(this.global||a=="g")b+="g";if(this.ignoreCase||a=="i")b+="i";if(this.multiline||a=="m")b+="m";if(this.sticky||a=="y")b+="y";return this.setFlags(b)},removeFlag:function(a){var b="";if(this.global&&a!="g")b+="g";if(this.ignoreCase&&a!="i")b+="i";if(this.multiline&&a!="m")b+="m";if(this.sticky&&a!="y")b+="y";return this.setFlags(b)}});var J=function(a,b,c){c=Math[c];var d=Math.pow(10,Math.abs(b||
0));if(b<0)d=1/d;return c(a*d)/d},Z=function(a,b){var c=function(){return Math.round(this*b)},d=function(){return O(this,arguments,a,"rewind")},e=function(){return O(this,arguments,a,"advance")};j(Number.prototype,a,c);j(Number.prototype,a+"s",c);j(Number.prototype,a+"Before",d);j(Number.prototype,a+"sBefore",d);j(Number.prototype,a+"Ago",d);j(Number.prototype,a+"sAgo",d);j(Number.prototype,a+"After",e);j(Number.prototype,a+"sAfter",e);j(Number.prototype,a+"FromNow",e);j(Number.prototype,a+"sFromNow",
e)};k(Number,false,{random:function(a,b){if(arguments.length==1){b=a;a=0}min=Math.min(a||0,b||1);max=Math.max(a||0,b||1);return Math.round(Math.random()*(max-min)+min)}});k(Number,true,{toNumber:function(){return parseFloat(this,10)},ceil:function(a){return J(this,a,"ceil")},floor:function(a){return J(this,a,"floor")},abs:function(){return Math.abs(this)},pow:function(a){if(a===undefined||a==null)a=1;return Math.pow(this,a)},round:function(a){return J(this,a,"round")},chr:function(){return String.fromCharCode(this)},
isOdd:function(){return!this.isMultipleOf(2)},isEven:function(){return this.isMultipleOf(2)},isMultipleOf:function(a){return this%a===0},upto:function(a,b){for(var c=[],d=parseInt(this);d<=a;d++){c.push(d);b&&b.call(this,d)}return c},downto:function(a,b){for(var c=[],d=parseInt(this);d>=a;d--){c.push(d);b&&b.call(this,d)}return c},times:function(a){if(a)for(var b=0;b<this;b++)a.call(this,b);return this.toNumber()},ordinalize:function(){var a;if(this>=11&&this<=13)a="th";else switch(this%10){case 1:a=
"st";break;case 2:a="nd";break;case 3:a="rd";break;default:a="th"}return this.toString()+a},pad:function(a,b){var c=this.toNumber()===0?"":this.toString().replace(/^-/,"");c=c.padLeft(a-c.length,"0");if(b||this<0)c=(this<0?"-":"+")+c;return c},format:function(a,b){a=a||",";b=b||".";var c=this.toString().split("."),d=c[0];c=c.length>1?b+c[1]:"";for(var e=/(\d+)(\d{3})/;e.test(d);)d=d.replace(e,"$1"+a+"$2");return d+c},hex:function(){return this.toString(16)}});var o,w,B,C,$=[{base:"A",reg:/[A\u24b6\uff21\u00c0\u00c1\u00c2\u1ea6\u1ea4\u1eaa\u1ea8\u00c3\u0100\u0102\u1eb0\u1eae\u1eb4\u1eb2\u0226\u01e0\u00c4\u01de\u1ea2\u00c5\u01fa\u01cd\u0200\u0202\u1ea0\u1eac\u1eb6\u1e00\u0104\u023a\u2c6f]/g},
{base:"B",reg:/[B\u24b7\uff22\u1e02\u1e04\u1e06\u0243\u0182\u0181]/g},{base:"C",reg:/[C\u24b8\uff23\u0106\u0108\u010a\u010c\u00c7\u1e08\u0187\u023b\ua73e]/g},{base:"D",reg:/[D\u24b9\uff24\u1e0a\u010e\u1e0c\u1e10\u1e12\u1e0e\u0110\u018b\u018a\u0189\ua779]/g},{base:"E",reg:/[E\u24ba\uff25\u00c8\u00c9\u00ca\u1ec0\u1ebe\u1ec4\u1ec2\u1ebc\u0112\u1e14\u1e16\u0114\u0116\u00cb\u1eba\u011a\u0204\u0206\u1eb8\u1ec6\u0228\u1e1c\u0118\u1e18\u1e1a\u0190\u018e]/g},{base:"F",reg:/[F\u24bb\uff26\u1e1e\u0191\ua77b]/g},
{base:"G",reg:/[G\u24bc\uff27\u01f4\u011c\u1e20\u011e\u0120\u01e6\u0122\u01e4\u0193\ua7a0\ua77d\ua77e]/g},{base:"H",reg:/[H\u24bd\uff28\u0124\u1e22\u1e26\u021e\u1e24\u1e28\u1e2a\u0126\u2c67\u2c75\ua78d]/g},{base:"I",reg:/[I\u24be\uff29\u00cc\u00cd\u00ce\u0128\u012a\u012c\u0130\u00cf\u1e2e\u1ec8\u01cf\u0208\u020a\u1eca\u012e\u1e2c\u0197]/g},{base:"J",reg:/[J\u24bf\uff2a\u0134\u0248]/g},{base:"K",reg:/[K\u24c0\uff2b\u1e30\u01e8\u1e32\u0136\u1e34\u0198\u2c69\ua740\ua742\ua744\ua7a2]/g},{base:"L",reg:/[L\u24c1\uff2c\u013f\u0139\u013d\u1e36\u1e38\u013b\u1e3c\u1e3a\u0141\u023d\u2c62\u2c60\ua748\ua746\ua780]/g},
{base:"M",reg:/[M\u24c2\uff2d\u1e3e\u1e40\u1e42\u2c6e\u019c]/g},{base:"N",reg:/[N\u24c3\uff2e\u01f8\u0143\u00d1\u1e44\u0147\u1e46\u0145\u1e4a\u1e48\u0220\u019d\ua790\ua7a4]/g},{base:"O",reg:/[O\u24c4\uff2f\u00d2\u00d3\u00d4\u1ed2\u1ed0\u1ed6\u1ed4\u00d5\u1e4c\u022c\u1e4e\u014c\u1e50\u1e52\u014e\u022e\u0230\u00d6\u022a\u1ece\u0150\u01d1\u020c\u020e\u01a0\u1edc\u1eda\u1ee0\u1ede\u1ee2\u1ecc\u1ed8\u01ea\u01ec\u00d8\u01fe\u0186\u019f\ua74a\ua74c]/g},{base:"P",reg:/[P\u24c5\uff30\u1e54\u1e56\u01a4\u2c63\ua750\ua752\ua754]/g},
{base:"Q",reg:/[Q\u24c6\uff31\ua756\ua758\u024a]/g},{base:"R",reg:/[R\u24c7\uff32\u0154\u1e58\u0158\u0210\u0212\u1e5a\u1e5c\u0156\u1e5e\u024c\u2c64\ua75a\ua7a6\ua782]/g},{base:"S",reg:/[S\u24c8\uff33\u1e9e\u015a\u1e64\u015c\u1e60\u0160\u1e66\u1e62\u1e68\u0218\u015e\u2c7e\ua7a8\ua784]/g},{base:"T",reg:/[T\u24c9\uff34\u1e6a\u0164\u1e6c\u021a\u0162\u1e70\u1e6e\u0166\u01ac\u01ae\u023e\ua786]/g},{base:"U",reg:/[U\u24ca\uff35\u00d9\u00da\u00db\u0168\u1e78\u016a\u1e7a\u016c\u00dc\u01db\u01d7\u01d5\u01d9\u1ee6\u016e\u0170\u01d3\u0214\u0216\u01af\u1eea\u1ee8\u1eee\u1eec\u1ef0\u1ee4\u1e72\u0172\u1e76\u1e74\u0244]/g},
{base:"V",reg:/[V\u24cb\uff36\u1e7c\u1e7e\u01b2\ua75e\u0245]/g},{base:"W",reg:/[W\u24cc\uff37\u1e80\u1e82\u0174\u1e86\u1e84\u1e88\u2c72]/g},{base:"X",reg:/[X\u24cd\uff38\u1e8a\u1e8c]/g},{base:"Y",reg:/[Y\u24ce\uff39\u1ef2\u00dd\u0176\u1ef8\u0232\u1e8e\u0178\u1ef6\u1ef4\u01b3\u024e\u1efe]/g},{base:"Z",reg:/[Z\u24cf\uff3a\u0179\u1e90\u017b\u017d\u1e92\u1e94\u01b5\u0224\u2c7f\u2c6b\ua762]/g},{base:"a",reg:/[a\u24d0\uff41\u1e9a\u00e0\u00e1\u00e2\u1ea7\u1ea5\u1eab\u1ea9\u00e3\u0101\u0103\u1eb1\u1eaf\u1eb5\u1eb3\u0227\u01e1\u00e4\u01df\u1ea3\u00e5\u01fb\u01ce\u0201\u0203\u1ea1\u1ead\u1eb7\u1e01\u0105\u2c65\u0250]/g},
{base:"b",reg:/[b\u24d1\uff42\u1e03\u1e05\u1e07\u0180\u0183\u0253]/g},{base:"c",reg:/[c\u24d2\uff43\u0107\u0109\u010b\u010d\u00e7\u1e09\u0188\u023c\ua73f\u2184]/g},{base:"d",reg:/[d\u24d3\uff44\u1e0b\u010f\u1e0d\u1e11\u1e13\u1e0f\u0111\u018c\u0256\u0257\ua77a]/g},{base:"e",reg:/[e\u24d4\uff45\u00e8\u00e9\u00ea\u1ec1\u1ebf\u1ec5\u1ec3\u1ebd\u0113\u1e15\u1e17\u0115\u0117\u00eb\u1ebb\u011b\u0205\u0207\u1eb9\u1ec7\u0229\u1e1d\u0119\u1e19\u1e1b\u0247\u025b\u01dd]/g},{base:"f",reg:/[f\u24d5\uff46\u1e1f\u0192\ua77c]/g},
{base:"g",reg:/[g\u24d6\uff47\u01f5\u011d\u1e21\u011f\u0121\u01e7\u0123\u01e5\u0260\ua7a1\u1d79\ua77f]/g},{base:"h",reg:/[h\u24d7\uff48\u0125\u1e23\u1e27\u021f\u1e25\u1e29\u1e2b\u1e96\u0127\u2c68\u2c76\u0265]/g},{base:"i",reg:/[i\u24d8\uff49\u00ec\u00ed\u00ee\u0129\u012b\u012d\u00ef\u1e2f\u1ec9\u01d0\u0209\u020b\u1ecb\u012f\u1e2d\u0268\u0131]/g},{base:"j",reg:/[j\u24d9\uff4a\u0135\u01f0\u0249]/g},{base:"k",reg:/[k\u24da\uff4b\u1e31\u01e9\u1e33\u0137\u1e35\u0199\u2c6a\ua741\ua743\ua745\ua7a3]/g},{base:"l",
reg:/[l\u24db\uff4c\u0140\u013a\u013e\u1e37\u1e39\u013c\u1e3d\u1e3b\u017f\u0142\u019a\u026b\u2c61\ua749\ua781\ua747]/g},{base:"m",reg:/[m\u24dc\uff4d\u1e3f\u1e41\u1e43\u0271\u026f]/g},{base:"n",reg:/[n\u24dd\uff4e\u01f9\u0144\u00f1\u1e45\u0148\u1e47\u0146\u1e4b\u1e49\u019e\u0272\u0149\ua791\ua7a5]/g},{base:"o",reg:/[o\u24de\uff4f\u00f2\u00f3\u00f4\u1ed3\u1ed1\u1ed7\u1ed5\u00f5\u1e4d\u022d\u1e4f\u014d\u1e51\u1e53\u014f\u022f\u0231\u00f6\u022b\u1ecf\u0151\u01d2\u020d\u020f\u01a1\u1edd\u1edb\u1ee1\u1edf\u1ee3\u1ecd\u1ed9\u01eb\u01ed\u00f8\u01ff\u0254\ua74b\ua74d\u0275]/g},
{base:"p",reg:/[p\u24df\uff50\u1e55\u1e57\u01a5\u1d7d\ua751\ua753\ua755]/g},{base:"q",reg:/[q\u24e0\uff51\u024b\ua757\ua759]/g},{base:"r",reg:/[r\u24e1\uff52\u0155\u1e59\u0159\u0211\u0213\u1e5b\u1e5d\u0157\u1e5f\u024d\u027d\ua75b\ua7a7\ua783]/g},{base:"s",reg:/[s\u24e2\uff53\u00df\u015b\u1e65\u015d\u1e61\u0161\u1e67\u1e63\u1e69\u0219\u015f\u023f\ua7a9\ua785\u1e9b]/g},{base:"t",reg:/[t\u24e3\uff54\u1e6b\u1e97\u0165\u1e6d\u021b\u0163\u1e71\u1e6f\u0167\u01ad\u0288\u2c66\ua787]/g},{base:"u",reg:/[u\u24e4\uff55\u00f9\u00fa\u00fb\u0169\u1e79\u016b\u1e7b\u016d\u00fc\u01dc\u01d8\u01d6\u01da\u1ee7\u016f\u0171\u01d4\u0215\u0217\u01b0\u1eeb\u1ee9\u1eef\u1eed\u1ef1\u1ee5\u1e73\u0173\u1e77\u1e75\u0289]/g},
{base:"v",reg:/[v\u24e5\uff56\u1e7d\u1e7f\u028b\ua75f\u028c]/g},{base:"w",reg:/[w\u24e6\uff57\u1e81\u1e83\u0175\u1e87\u1e85\u1e98\u1e89\u2c73]/g},{base:"x",reg:/[x\u24e7\uff58\u1e8b\u1e8d]/g},{base:"y",reg:/[y\u24e8\uff59\u1ef3\u00fd\u0177\u1ef9\u0233\u1e8f\u00ff\u1ef7\u1e99\u1ef5\u01b4\u024f\u1eff]/g},{base:"z",reg:/[z\u24e9\uff5a\u017a\u1e91\u017c\u017e\u1e93\u1e95\u01b6\u0225\u0240\u2c6c\ua763]/g},{base:"AA",reg:/[\ua732]/g},{base:"AE",reg:/[\u00c6\u01fc\u01e2]/g},{base:"AO",reg:/[\ua734]/g},{base:"AU",
reg:/[\ua736]/g},{base:"AV",reg:/[\ua738\ua73a]/g},{base:"AY",reg:/[\ua73c]/g},{base:"DZ",reg:/[\u01f1\u01c4]/g},{base:"Dz",reg:/[\u01f2\u01c5]/g},{base:"LJ",reg:/[\u01c7]/g},{base:"Lj",reg:/[\u01c8]/g},{base:"NJ",reg:/[\u01ca]/g},{base:"Nj",reg:/[\u01cb]/g},{base:"OI",reg:/[\u01a2]/g},{base:"OO",reg:/[\ua74e]/g},{base:"OU",reg:/[\u0222]/g},{base:"TZ",reg:/[\ua728]/g},{base:"VY",reg:/[\ua760]/g},{base:"aa",reg:/[\ua733]/g},{base:"ae",reg:/[\u00e6\u01fd\u01e3]/g},{base:"ao",reg:/[\ua735]/g},{base:"au",
reg:/[\ua737]/g},{base:"av",reg:/[\ua739\ua73b]/g},{base:"ay",reg:/[\ua73d]/g},{base:"dz",reg:/[\u01f3\u01c6]/g},{base:"hv",reg:/[\u0195]/g},{base:"lj",reg:/[\u01c9]/g},{base:"nj",reg:/[\u01cc]/g},{base:"oi",reg:/[\u01a3]/g},{base:"ou",reg:/[\u0223]/g},{base:"oo",reg:/[\ua74f]/g},{base:"tz",reg:/[\ua729]/g},{base:"vy",reg:/[\ua761]/g}],P=[{full:"\u3000",half:" ",type:"p"},{full:"\u3001",half:"\uff64",type:"p"},{full:"\u3002",half:"\uff61",type:"p"},{full:"\uff0c",half:",",type:"p"},{full:"\uff0e",
half:".",type:"p"},{full:"\u30fb",half:"\uff65",type:"p"},{full:"\uff1a",half:":",type:"p"},{full:"\uff1b",half:";",type:"p"},{full:"\uff1f",half:"?",type:"p"},{full:"\uff01",half:"!",type:"p"},{full:"\u2018",half:"'",type:"p"},{full:"\u2019",half:"'",type:"p"},{full:"\u201c",half:'"',type:"p"},{full:"\u201d",half:'"',type:"p"},{full:"\u30fc",half:"\uff70",type:"p"},{full:"\uff5e",half:"~",type:"p"},{full:"\u309b",half:"\uff9e",type:"s"},{full:"\u309c",half:"\uff9f",type:"s"},{full:"\uff3e",half:"^",
type:"s"},{full:"\u2010",half:"-",type:"s"},{full:"\uff0f",half:"/",type:"s"},{full:"\uff5c",half:"|",type:"s"},{full:"\uff08",half:"(",type:"s"},{full:"\uff09",half:")",type:"s"},{full:"\uff3b",half:"[",type:"s"},{full:"\uff3d",half:"]",type:"s"},{full:"\uff5b",half:"{",type:"s"},{full:"\uff5d",half:"}",type:"s"},{full:"\u300c",half:"\uff62",type:"s"},{full:"\u300d",half:"\uff63",type:"s"},{full:"\u3008",half:"<",type:"s"},{full:"\u3009",half:">",type:"s"},{full:"\u300a",half:"\u00ab",type:"s"},
{full:"\u300b",half:"\u00bb",type:"s"},{full:"\uff0b",half:"+",type:"s"},{full:"\uff0d",half:"-",type:"s"},{full:"\uff1d",half:"=",type:"s"},{full:"\uff1c",half:"<",type:"s"},{full:"\uff1e",half:">",type:"s"},{full:"\u2103",half:"\u00b0C",type:"s"},{full:"\uffe5",half:"\u00a5",type:"s"},{full:"\uff04",half:"$",type:"s"},{full:"\uffe0",half:"\u00a2",type:"s"},{full:"\uffe1",half:"\u00a3",type:"s"},{full:"\uff05",half:"%",type:"s"},{full:"\uff03",half:"#",type:"s"},{full:"\uff06",half:"&",type:"s"},
{full:"\uff0a",half:"*",type:"s"},{full:"\uff20",half:"@",type:"s"},{full:"\uff10",half:"0",type:"n"},{full:"\uff11",half:"1",type:"n"},{full:"\uff12",half:"2",type:"n"},{full:"\uff13",half:"3",type:"n"},{full:"\uff14",half:"4",type:"n"},{full:"\uff15",half:"5",type:"n"},{full:"\uff16",half:"6",type:"n"},{full:"\uff17",half:"7",type:"n"},{full:"\uff18",half:"8",type:"n"},{full:"\uff19",half:"9",type:"n"},{full:"\uff21",half:"A",type:"a"},{full:"\uff22",half:"B",type:"a"},{full:"\uff23",half:"C",type:"a"},
{full:"\uff24",half:"D",type:"a"},{full:"\uff25",half:"E",type:"a"},{full:"\uff26",half:"F",type:"a"},{full:"\uff27",half:"G",type:"a"},{full:"\uff28",half:"H",type:"a"},{full:"\uff29",half:"I",type:"a"},{full:"\uff2a",half:"J",type:"a"},{full:"\uff2b",half:"K",type:"a"},{full:"\uff2c",half:"L",type:"a"},{full:"\uff2d",half:"M",type:"a"},{full:"\uff2e",half:"N",type:"a"},{full:"\uff2f",half:"O",type:"a"},{full:"\uff30",half:"P",type:"a"},{full:"\uff31",half:"Q",type:"a"},{full:"\uff32",half:"R",type:"a"},
{full:"\uff33",half:"S",type:"a"},{full:"\uff34",half:"T",type:"a"},{full:"\uff35",half:"U",type:"a"},{full:"\uff36",half:"V",type:"a"},{full:"\uff37",half:"W",type:"a"},{full:"\uff38",half:"X",type:"a"},{full:"\uff39",half:"Y",type:"a"},{full:"\uff3a",half:"Z",type:"a"},{full:"\uff41",half:"a",type:"a"},{full:"\uff42",half:"b",type:"a"},{full:"\uff43",half:"c",type:"a"},{full:"\uff44",half:"d",type:"a"},{full:"\uff45",half:"e",type:"a"},{full:"\uff46",half:"f",type:"a"},{full:"\uff47",half:"g",type:"a"},
{full:"\uff48",half:"h",type:"a"},{full:"\uff49",half:"i",type:"a"},{full:"\uff4a",half:"j",type:"a"},{full:"\uff4b",half:"k",type:"a"},{full:"\uff4c",half:"l",type:"a"},{full:"\uff4d",half:"m",type:"a"},{full:"\uff4e",half:"n",type:"a"},{full:"\uff4f",half:"o",type:"a"},{full:"\uff50",half:"p",type:"a"},{full:"\uff51",half:"q",type:"a"},{full:"\uff52",half:"r",type:"a"},{full:"\uff53",half:"s",type:"a"},{full:"\uff54",half:"t",type:"a"},{full:"\uff55",half:"u",type:"a"},{full:"\uff56",half:"v",type:"a"},
{full:"\uff57",half:"w",type:"a"},{full:"\uff58",half:"x",type:"a"},{full:"\uff59",half:"y",type:"a"},{full:"\uff5a",half:"z",type:"a"},{full:"\u30a1",half:"\uff67",type:"k"},{full:"\u30a2",half:"\uff71",type:"k"},{full:"\u30a3",half:"\uff68",type:"k"},{full:"\u30a4",half:"\uff72",type:"k"},{full:"\u30a5",half:"\uff69",type:"k"},{full:"\u30a6",half:"\uff73",type:"k"},{full:"\u30a7",half:"\uff6a",type:"k"},{full:"\u30a8",half:"\uff74",type:"k"},{full:"\u30a9",half:"\uff6b",type:"k"},{full:"\u30aa",
half:"\uff75",type:"k"},{full:"\u30ab",half:"\uff76",type:"k"},{full:"\u30ac",half:"\uff76\uff9e",type:"k"},{full:"\u30ad",half:"\uff77",type:"k"},{full:"\u30ae",half:"\uff77\uff9e",type:"k"},{full:"\u30af",half:"\uff78",type:"k"},{full:"\u30b0",half:"\uff78\uff9e",type:"k"},{full:"\u30b1",half:"\uff79",type:"k"},{full:"\u30b2",half:"\uff79\uff9e",type:"k"},{full:"\u30b3",half:"\uff7a",type:"k"},{full:"\u30b4",half:"\uff7a\uff9e",type:"k"},{full:"\u30b5",half:"\uff7b",type:"k"},{full:"\u30b6",half:"\uff7b\uff9e",
type:"k"},{full:"\u30b7",half:"\uff7c",type:"k"},{full:"\u30b8",half:"\uff7c\uff9e",type:"k"},{full:"\u30b9",half:"\uff7d",type:"k"},{full:"\u30ba",half:"\uff7d\uff9e",type:"k"},{full:"\u30bb",half:"\uff7e",type:"k"},{full:"\u30bc",half:"\uff7e\uff9e",type:"k"},{full:"\u30bd",half:"\uff7f",type:"k"},{full:"\u30be",half:"\uff7f\uff9e",type:"k"},{full:"\u30bf",half:"\uff80",type:"k"},{full:"\u30c0",half:"\uff80\uff9e",type:"k"},{full:"\u30c1",half:"\uff81",type:"k"},{full:"\u30c2",half:"\uff81\uff9e",
type:"k"},{full:"\u30c3",half:"\uff6f",type:"k"},{full:"\u30c4",half:"\uff82",type:"k"},{full:"\u30c5",half:"\uff82\uff9e",type:"k"},{full:"\u30c6",half:"\uff83",type:"k"},{full:"\u30c7",half:"\uff83\uff9e",type:"k"},{full:"\u30c8",half:"\uff84",type:"k"},{full:"\u30c9",half:"\uff84\uff9e",type:"k"},{full:"\u30ca",half:"\uff85",type:"k"},{full:"\u30cb",half:"\uff86",type:"k"},{full:"\u30cc",half:"\uff87",type:"k"},{full:"\u30cd",half:"\uff88",type:"k"},{full:"\u30ce",half:"\uff89",type:"k"},{full:"\u30cf",
half:"\uff8a",type:"k"},{full:"\u30d0",half:"\uff8a\uff9e",type:"k"},{full:"\u30d1",half:"\uff8a\uff9f",type:"k"},{full:"\u30d2",half:"\uff8b",type:"k"},{full:"\u30d3",half:"\uff8b\uff9e",type:"k"},{full:"\u30d4",half:"\uff8b\uff9f",type:"k"},{full:"\u30d5",half:"\uff8c",type:"k"},{full:"\u30d6",half:"\uff8c\uff9e",type:"k"},{full:"\u30d7",half:"\uff8c\uff9f",type:"k"},{full:"\u30d8",half:"\uff8d",type:"k"},{full:"\u30d9",half:"\uff8d\uff9e",type:"k"},{full:"\u30da",half:"\uff8d\uff9f",type:"k"},
{full:"\u30db",half:"\uff8e",type:"k"},{full:"\u30dc",half:"\uff8e\uff9e",type:"k"},{full:"\u30dd",half:"\uff8e\uff9f",type:"k"},{full:"\u30de",half:"\uff8f",type:"k"},{full:"\u30df",half:"\uff90",type:"k"},{full:"\u30e0",half:"\uff91",type:"k"},{full:"\u30e1",half:"\uff92",type:"k"},{full:"\u30e2",half:"\uff93",type:"k"},{full:"\u30e3",half:"\uff6c",type:"k"},{full:"\u30e4",half:"\uff94",type:"k"},{full:"\u30e5",half:"\uff6d",type:"k"},{full:"\u30e6",half:"\uff95",type:"k"},{full:"\u30e7",half:"\uff6e",
type:"k"},{full:"\u30e8",half:"\uff96",type:"k"},{full:"\u30e9",half:"\uff97",type:"k"},{full:"\u30ea",half:"\uff98",type:"k"},{full:"\u30eb",half:"\uff99",type:"k"},{full:"\u30ec",half:"\uff9a",type:"k"},{full:"\u30ed",half:"\uff9b",type:"k"},{full:"\u30ef",half:"\uff9c",type:"k"},{full:"\u30f2",half:"\uff66",type:"k"},{full:"\u30f3",half:"\uff9d",type:"k"}],Q=[{hira:"\u3041",kata:"\u30a1"},{hira:"\u3042",kata:"\u30a2"},{hira:"\u3043",kata:"\u30a3"},{hira:"\u3044",kata:"\u30a4"},{hira:"\u3045",kata:"\u30a5"},
{hira:"\u3046",kata:"\u30a6"},{hira:"\u3047",kata:"\u30a7"},{hira:"\u3048",kata:"\u30a8"},{hira:"\u3049",kata:"\u30a9"},{hira:"\u304a",kata:"\u30aa"},{hira:"\u304b",kata:"\u30ab"},{hira:"\u304c",kata:"\u30ac"},{hira:"\u304d",kata:"\u30ad"},{hira:"\u304e",kata:"\u30ae"},{hira:"\u304f",kata:"\u30af"},{hira:"\u3050",kata:"\u30b0"},{hira:"\u3051",kata:"\u30b1"},{hira:"\u3052",kata:"\u30b2"},{hira:"\u3053",kata:"\u30b3"},{hira:"\u3054",kata:"\u30b4"},{hira:"\u3055",kata:"\u30b5"},{hira:"\u3056",kata:"\u30b6"},
{hira:"\u3057",kata:"\u30b7"},{hira:"\u3058",kata:"\u30b8"},{hira:"\u3059",kata:"\u30b9"},{hira:"\u305a",kata:"\u30ba"},{hira:"\u305b",kata:"\u30bb"},{hira:"\u305c",kata:"\u30bc"},{hira:"\u305d",kata:"\u30bd"},{hira:"\u305e",kata:"\u30be"},{hira:"\u305f",kata:"\u30bf"},{hira:"\u3060",kata:"\u30c0"},{hira:"\u3061",kata:"\u30c1"},{hira:"\u3062",kata:"\u30c2"},{hira:"\u3063",kata:"\u30c3"},{hira:"\u3064",kata:"\u30c4"},{hira:"\u3065",kata:"\u30c5"},{hira:"\u3066",kata:"\u30c6"},{hira:"\u3067",kata:"\u30c7"},
{hira:"\u3068",kata:"\u30c8"},{hira:"\u3069",kata:"\u30c9"},{hira:"\u306a",kata:"\u30ca"},{hira:"\u306b",kata:"\u30cb"},{hira:"\u306c",kata:"\u30cc"},{hira:"\u306d",kata:"\u30cd"},{hira:"\u306e",kata:"\u30ce"},{hira:"\u306f",kata:"\u30cf"},{hira:"\u3070",kata:"\u30d0"},{hira:"\u3071",kata:"\u30d1"},{hira:"\u3072",kata:"\u30d2"},{hira:"\u3073",kata:"\u30d3"},{hira:"\u3074",kata:"\u30d4"},{hira:"\u3075",kata:"\u30d5"},{hira:"\u3076",kata:"\u30d6"},{hira:"\u3077",kata:"\u30d7"},{hira:"\u3078",kata:"\u30d8"},
{hira:"\u3079",kata:"\u30d9"},{hira:"\u307a",kata:"\u30da"},{hira:"\u307b",kata:"\u30db"},{hira:"\u307c",kata:"\u30dc"},{hira:"\u307d",kata:"\u30dd"},{hira:"\u307e",kata:"\u30de"},{hira:"\u307f",kata:"\u30df"},{hira:"\u3080",kata:"\u30e0"},{hira:"\u3081",kata:"\u30e1"},{hira:"\u3082",kata:"\u30e2"},{hira:"\u3083",kata:"\u30e3"},{hira:"\u3084",kata:"\u30e4"},{hira:"\u3085",kata:"\u30e5"},{hira:"\u3086",kata:"\u30e6"},{hira:"\u3087",kata:"\u30e7"},{hira:"\u3088",kata:"\u30e8"},{hira:"\u3089",kata:"\u30e9"},
{hira:"\u308a",kata:"\u30ea"},{hira:"\u308b",kata:"\u30eb"},{hira:"\u308c",kata:"\u30ec"},{hira:"\u308d",kata:"\u30ed"},{hira:"\u308e",kata:"\u30ee"},{hira:"\u308f",kata:"\u30ef"},{hira:"\u3090",kata:"\u30f0"},{hira:"\u3091",kata:"\u30f1"},{hira:"\u3092",kata:"\u30f2"},{hira:"\u3093",kata:"\u30f3"}],aa=[{names:["Greek"],source:"\\u0370-\\u03FF"},{names:["Cyrillic"],source:"\\u0400-\\u04FF"},{names:["Armenian"],source:"\\u0530-\\u058F"},{names:["Hebrew"],source:"\\u0590-\\u05FF"},{names:["Arabic"],
source:"\\u0600-\\u06FF"},{names:["Thai"],source:"\\u0E00-\\u0E7F"},{names:["Tibetan"],source:"\\u0F00-\\u0FFF"},{names:["Georgian"],source:"\\u10A0-\\u10FF"},{names:["Tagalog"],source:"\\u1700-\\u171F"},{names:["Mongolian"],source:"\\u1800-\\u18AF"},{names:["Hiragana"],source:"\\u3040-\\u309F\\u30FB-\\u30FC"},{names:["Katakana"],source:"\\u30A0-\\u30FF\\uFF61-\\uFF9F"},{names:["Kana"],source:"\\u3040-\\u30FF\\uFF61-\\uFF9F"},{names:["Bopomofo"],source:"\\u3100-\\u312F"},{names:["Hangul"],source:"\\uAC00-\\uD7AF\\u1100-\\u11FF"},
{names:["Han","Kanji"],source:"\\u4E00-\\u9FFF\\uF900-\\uFAFF"}],R=function(a){if(!a||a=="all")return{a:true,n:true,k:true,s:true,p:true};var b={};if(a.length<6)for(var c=0;c<a.length;c++)b[a.charAt(c)]=true;else{if(a==="alphabet")b.a=true;if(a==="numbers")b.n=true;if(a==="katakana")b.k=true;if(a==="special")b.s=true;if(a==="punctuation")b.p=true}return b},S=function(a,b,c,d){b=b||0;c=c||" ";d=d||"both";for(var e=0;e<b;e++){if(d==="left"||d==="both")a=c+a;if(d==="right"||d==="both")a+=c}return a.toString()},
ba=function(a,b){var c=a.match(b);if(c&&!RegExp.NPCGSupport&&!b.global)for(var d=1;d<c.length;d++)if(c[d]==="")c[d]=undefined;return c};if(typeof btoa==="undefined")btoa=function(a){var b="",c,d,e="",f,g,h="",i=0;do{c=a.charCodeAt(i++);d=a.charCodeAt(i++);e=a.charCodeAt(i++);f=c>>2;c=(c&3)<<4|d>>4;g=(d&15)<<2|e>>6;h=e&63;if(isNaN(d))g=h=64;else if(isNaN(e))h=64;b=b+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(f)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(c)+
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(g)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(h)}while(i<a.length);return b};if(typeof atob==="undefined")atob=function(a){var b="",c,d,e="",f,g="",h=0;if(/[^A-Za-z0-9\+\/\=]/g.test(a))throw Error("String contains invalid base64 characters");a=a.replace(/[^A-Za-z0-9\+\/\=]/g,"");do{c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(a.charAt(h++));d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(a.charAt(h++));
f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(a.charAt(h++));g="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(a.charAt(h++));c=c<<2|d>>4;d=(d&15)<<4|f>>2;e=(f&3)<<6|g;b+=String.fromCharCode(c);if(f!=64)b+=String.fromCharCode(d);if(g!=64)b+=String.fromCharCode(e)}while(h<a.length);return unescape(b)};k(String,true,{escapeRegExp:function(){return RegExp.escape(this)},escapeURL:function(a){return a?encodeURIComponent(this):encodeURI(this)},
unescapeURL:function(a){return a?decodeURI(this):decodeURIComponent(this)},encodeBase64:function(){return btoa(this)},decodeBase64:function(){return atob(this)},capitalize:function(){return this.substr(0,1).toUpperCase()+this.substr(1).toLowerCase()},trim:function(){return this.trimLeft().trimRight()},trimLeft:function(){return this.replace(/^[\s\u3000][\s\u3000]*/,"")},trimRight:function(){return this.replace(/[\s\u3000][\s\u3000]*$/,"")},pad:function(a,b){return this.padLeft(a,b).padRight(a,b)},
padLeft:function(a,b){return S(this,a,b,"left")},padRight:function(a,b){return S(this,a,b,"right")},repeat:function(a){a=a||0;if(a<0)return this;for(var b="",c=0;c<a;c++)b+=this;return b},each:function(a,b){if(Object.isFunction(a)){b=a;a=/./g}else if(a)if(Object.isString(a))a=RegExp(RegExp.escape(a),"gi");else{if(Object.isRegExp(a))a=a.addFlag("g")}else a=/./g;var c=this.match(a)||[];if(b)for(var d=0;d<c.length;d++)c[d]=b.call(this,c[d],d)||c[d];return c},codes:function(a){for(var b=[],c=0;c<this.length;c++){var d=
this.charCodeAt(c);b.push(d);a&&a.call(this,d,c)}return b},chars:function(a){return this.trim().each(a)},words:function(a){return this.trim().each(/\S+/g,a)},lines:function(a){return this.trim().each(/^.*$/gm,a)},paragraphs:function(a){var b=this.trim().split(/[\r\n]{2,}/);return b=b.map(function(c){if(a)var d=a.call(c);return d?d:c})},normalize:function(){var a=this.toString();$.each(function(b){a=a.replace(b.reg,b.base)});return a},startsWith:function(a,b){if(b===undefined)b=true;var c=Object.isRegExp(a)?
a.source.replace("^",""):RegExp.escape(a);return RegExp("^"+c,b?"":"i").test(this)},endsWith:function(a,b){if(b===undefined)b=true;var c=Object.isRegExp(a)?a.source.replace("$",""):RegExp.escape(a);return RegExp(c+"$",b?"":"i").test(this)},isBlank:function(){return this.trim().length===0},has:function(a){return this.search(a)!==-1},add:function(a,b){b=b||0;if(b<0)b=this.length+b+1;if(b<0||b>this.length)return this;return this.substr(0,b)+a+this.substr(b)},hankaku:function(a){a=R(a);for(var b="",c=
0;c<this.length;c++){var d=this.charAt(c);b+=w[d]&&a[w[d].type]?w[d].half:d}return b},zenkaku:function(a){a=R(a);for(var b="",c=0;c<this.length;c++){var d=this.charAt(c),e=this.charAt(c+1);if(e&&o[d+e]){b+=o[d+e].full;c++}else b+=o[d]&&a[o[d].type]?o[d].full:d}return b},hiragana:function(a){a=a===false?this:this.zenkaku("k");for(var b="",c=0;c<a.length;c++){var d=a.charAt(c);b+=B[d]?B[d].hira:d}return b},katakana:function(){for(var a="",b=0;b<this.length;b++){var c=this.charAt(b);a+=C[c]?C[c].kata:
c}return a},toNumber:function(a){var b=this.replace(/,/g,"");return b.match(/\./)?parseFloat(b):parseInt(b,a||10)},reverse:function(){return this.split("").reverse().join("")},compact:function(){return this.replace(/[\r\n]/g,"").trim().replace(/([\s\u3000])+/g,"$1")},at:function(){return L(this,arguments,true)},first:function(a){a=a===undefined?1:a;return this.substr(0,a)},last:function(a){a=a===undefined?1:a;return this.substr(this.length-a<0?0:this.length-a)},from:function(a){return this.slice(a)},
to:function(a){if(a===undefined)a=this.length;return this.slice(0,a)},toDate:function(){return K([this.toString()])},dasherize:function(){return this.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/_/g,"-").toLowerCase()},underscore:function(){return this.replace(/([a-z])([A-Z])/g,"$1_$2").replace(/-/g,"_").toLowerCase()},camelize:function(a){for(var b=this.dasherize().split("-"),c="",d=0;d<b.length;d++)c+=a===false&&d===0?b[d].toLowerCase():b[d].substr(0,1).toUpperCase()+b[d].substr(1).toLowerCase();
return c},titleize:function(){return this.trim().words(function(a){return a.capitalize()}).join(" ")},stripTags:function(){args=arguments.length>0?arguments:[""];for(var a=this.toString(),b=0;b<args.length;b++){var c=RegExp("</?"+args[b].escapeRegExp()+"[^<>]*>","gi");a=a.replace(c,"")}return a},removeTags:function(){var a=this.toString();if(arguments.length==0){a=a.replace(/<.+?\/>/g,"");a=a.replace(/<.+?>.*<\/.+?>/g,"")}else for(var b=0;b<arguments.length;b++){var c=arguments[b].escapeRegExp();
a=a.replace(RegExp("<"+c+"[^<>]*?/>","gi"),"");a=a.replace(RegExp("<"+c+"[^<>]*>.*?</"+c+">","gi"),"")}return a},toObject:function(a,b){var c={};this.split(a||"&").each(function(d){var e=d.split(b||"=");d=e[0];var f=e[1];if(e=parseInt(e[1]))f=e;else if(f==="true")f=true;else if(f==="false")f=false;c[d]=f});return c}});s(String,true,function(a){return!Object.isRegExp(a)},{split:function(a,b){var c=[],d=0,e=(a.ignoreCase?"i":"")+(a.multiline?"m":"")+(a.sticky?"y":"");a=a.addFlag("g");var f,g,h;RegExp.NPCGSupport||
(f=RegExp("^"+a.source+"$(?!\\s)",e));if(b===undefined||+b<0)b=Infinity;else{b=Math.floor(+b);if(!b)return[]}for(;g=a.exec(this);){e=g.index+g[0].length;if(e>d){c.push(this.slice(d,g.index));!RegExp.NPCGSupport&&g.length>1&&g[0].replace(f,function(){for(var i=1;i<arguments.length-2;i++)if(arguments[i]===undefined)g[i]=undefined});g.length>1&&g.index<this.length&&Array.prototype.push.apply(c,g.slice(1));h=g[0].length;d=e;if(c.length>=b)break}a.lastIndex===g.index&&a.lastIndex++}if(d===this.length){if(h||
!a.test(""))c.push("")}else c.push(this.slice(d));return c.length>b?c.slice(0,b):c}});k(String,true,{insert:String.prototype.add});s(Array,true,true,{forEach:function(a,b){for(var c=0,d=this.length;c<d;c++)a.call(b,this[c],c,this)},reduce:function(a,b){for(var c=b===undefined?this[0]:b,d=b?0:1,e=this.length;d<e;d++)c=a.call(null,c,this[d],d,this);return c},reduceRight:function(a,b){for(var c=b===undefined?this[this.length-1]:b,d=b?this.length-1:this.length-2;d>=0;d--)c=a.call(null,c,this[d],d,this);
return c}});s(Array,true,function(a){return!Object.isObject(a)&&!Object.isFunction(a)},{indexOf:function(a,b){if(b<0)b=this.length+b;else if(b===undefined)b=0;if(b>=this.length)return-1;for(var c=b,d=this.length;c<d;c++)if(n(this[c],a,this,[c,this]))return c;return-1},lastIndexOf:function(a,b){if(b<0)b=this.length+b;else if(b===undefined||b>this.length)b=this.length-1;for(var c=b;c>=0;c--)if(n(this[c],a,this,[c,this]))return c;return-1}});s(Array,true,function(a){return Object.isFunction(a)},{every:function(a,
b){for(var c=0,d=this.length;c<d;c++)if(!n(this[c],a,b,[c,this]))return false;return true},some:function(a,b){for(var c=0,d=this.length;c<d;c++)if(n(this[c],a,b,[c,this]))return true;return false},filter:function(a,b){for(var c=[],d=0,e=this.length;d<e;d++)n(this[d],a,b,[d,this])&&c.push(this[d]);return c},map:function(a,b){for(var c=[],d=0,e=this.length;d<e;d++)c.push(u(this[d],a,b,[d,this]));return c}});k(Array,true,{find:function(a,b,c){a=this.findAll(a,b,c);return a.length>0?a[0]:undefined},findAll:function(a,
b,c){var d=[],e=this;b=b||0;this.eachFromIndex(b,function(f,g){n(f,a,e,[g,e])&&d.push(f)},c);return d},eachFromIndex:function(a,b,c){c=c?this.length:this.length-a;for(var d,e=0;e<c;e++){d=(a+e)%this.length;b.call(this,this[d],d)}},count:function(a){if(a===undefined)return this.length;return this.findAll(a).length},none:function(a){return!this.any(a)},remove:function(a){for(var b=0;a&&b<this.length;)if(n(this[b],a,this,[b,this]))this.splice(b,1);else b++;return this},removeAtIndex:function(a,b){if(a===
undefined)return this;if(b===undefined)b=a;for(var c=0;c<=b-a;c++)this.splice(a,1);return this},add:function(a,b){if(!Object.isNumber(b)||isNaN(b))b=this.length;Array.prototype.splice.apply(this,[b,0].concat(a));return this},include:function(a,b){return this.clone().add(a,b)},exclude:function(a){return this.clone().remove(a)},clone:function(){return this.concat()},unique:function(){var a=[];this.each(function(b){a.indexOf(b)===-1&&a.push(b)});return a},union:function(a){return this.concat(a).unique()},
intersect:function(a){var b=[];Object.isArray(a)||(a=[a]);this.each(function(c){a.indexOf(c)!==-1&&b.push(c)});return b.unique()},subtract:function(a){var b=[];Object.isArray(a)||(a=[a]);this.each(function(c){a.indexOf(c)===-1&&b.push(c)});return b},at:function(){return L(this,arguments,false)},first:function(a){if(a===undefined)return this[0];if(a<0)a=0;return this.slice(0,a)},last:function(a){if(a===undefined)return this[this.length-1];return this.slice(this.length-a<0?0:this.length-a)},from:function(a){return this.slice(a)},
to:function(a){if(a===undefined)a=this.length;return this.slice(0,a)},min:function(a){return z(this,"min",a).unique()},max:function(a){return z(this,"max",a).unique()},least:function(a){a=z(this.groupBy(a),"min","length").flatten();return a.length===this.length?[]:a.unique()},most:function(a){a=z(this.groupBy(a),"max","length").flatten();return a.length===this.length?[]:a.unique()},sum:function(a){a=a?this.map(a):this;return a.length>0?a.reduce(function(b,c){return b+c}):0},average:function(a){a=
a?this.map(a):this;return a.length>0?a.sum()/a.length:0},groupBy:function(a){var b={};this.each(function(c){var d=u(c,a);b[d]||(b[d]=[]);b[d].push(c)});return b},inGroups:function(a,b){var c=arguments.length>1,d=this,e=[],f=Math.ceil(this.length/a);(0).upto(a-1,function(g){g=g*f;var h=d.slice(g,g+f);c&&h.length<f&&(f-h.length).times(function(){h=h.add(b)});e.push(h)});return e},inGroupsOf:function(a,b){if(this.length===0||a===0)return this;if(a===undefined)a=1;if(b===undefined)b=null;var c=[],d=null;
this.each(function(e,f){if(f%a===0){d&&c.push(d);d=[]}if(e===undefined)e=b;d.push(e)});if(!this.length.isMultipleOf(a)){(a-this.length%a).times(function(){d.push(b)});this.length+=a-this.length%a}d.length>0&&c.push(d);return c},split:function(a){var b=[],c=[];this.forEach(function(d,e,f){var g=n(d,a,f,[e,f]);g||c.push(d);if(c.length>0&&(g||e==f.length-1)){b.push(c);c=[]}});return b},compact:function(){var a=[];this.each(function(b){if(Object.isArray(b))a.push(b.compact());else b!==undefined&&b!==
null&&!isNaN(b)&&a.push(b)});return a},isEmpty:function(){return this.compact().length==0},flatten:function(){var a=[];this.each(function(b){if(Object.isArray(b))a=a.concat(b.flatten());else a.push(b)});return a},sortBy:function(a,b){this.sort(function(c,d){var e=u(c,a),f=u(d,a),g=typeof e=="number";return g&&b?f-e:g&&!b?e-f:e===f?0:b?e<f?1:-1:e<f?-1:1});return this},randomize:function(){for(var a=this.concat(),b,c,d=a.length;d;b=parseInt(Math.random()*d),c=a[--d],a[d]=a[b],a[b]=c);return a}});k(Array,
true,{collect:Array.prototype.map,shuffle:Array.prototype.randomize,each:Array.prototype.forEach,all:Array.prototype.every,any:Array.prototype.some,has:Array.prototype.some,insert:Array.prototype.add});var D,E,F=["january","february","march","april","may","june","july","august","september","october","november","december"],G=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],T=["zero","one","two","three","four","five","six","seven","eight","nine","ten"],U=[{reg:"(\\d{4})",to:["year"]},
{reg:"(\\d{4})[-/.](\\d{1,2})",to:["year","month"]},{reg:"([+-])?(\\d{4})[-/.]?(\\d{1,2})[-/.]?(\\d{1,2})",to:["year_sign","year","month","day"]},{reg:"(\\d{2})-?(\\d{2})-?(\\d{2})",to:["year","month","day"]},{reg:"(\\d{1,2})[\\-/.](\\d{1,2})",to:["month","day"],variant:true},{reg:"(\\d{1,2})[\\-/.](\\d{1,2})[\\-/.](\\d{2,4})",to:["month","day","year"],variant:true},{reg:"({MONTHS})[\\s\\-.](\\d{4})",to:["month","year"]},{reg:"(?:{WEEKDAYS})?\\s*({MONTHS})[\\s\\-.]?(?:(\\d{1,2})(?:st|nd|rd|th)?)?,?[\\s\\-.]?(\\d{2,4})?",
to:["month","day","year"]},{reg:"(\\d{1,2}) ({MONTHS}),? (\\d{4})",to:["day","month","year"]},{reg:"(?:(the|a|{NUMBER}|\\d+) (day|week|month|year)s? (before|after|from)\\s+)?(today|tomorrow|yesterday|{WEEKDAYS})(?: at)?",to:["modifier_amount","modifier_unit","modifier_sign","fuzzy_day"]},{reg:"(a|{NUMBER}|\\d+) (millisecond|second|minute|hour|day|week|month|year)s? (from now|ago)",to:["modifier_amount","modifier_unit","modifier_sign"],relative:true},{reg:"(this|next|last)?\\s*(?:week\\s*)?({WEEKDAYS})(?: at)?",
to:["modifier_sign","fuzzy_day"]},{reg:"({WEEKDAYS}) (?:of\\s*)?(this|next|last) week",to:["fuzzy_day","modifier_sign"]},{reg:"({MONTHS})(?: (\\d{1,2})(?:st|nd|rd|th)?)? of (this|next|last) (year)",to:["month","day","modifier_sign","modifier_unit"]},{reg:"(?:the\\s)?(first day|last day)?(\\d{1,2}(?:st|nd|rd|th))? of (?:(the|this|next|last) (month)|({MONTHS}))",to:["modifier_edge","day","modifier_sign","modifier_unit","month"]},{reg:"(?:the\\s)?(beginning|end|first day|last day) of (?:(the|this|next|last) (week|month|year)|(\\d{4})|({MONTHS}))",
to:["modifier_edge","modifier_sign","modifier_unit","year","month"]},{reg:"(this|next|last) (week|month|year)",to:["modifier_sign","modifier_unit"],relative:true},{reg:"(midnight|noon)(?: (tonight|today|tomorrow|yesterday|{WEEKDAYS}))?",to:["hour","fuzzy_day"],timeIncluded:true},{reg:"^(?:(\\d{1,2}):?(\\d{2})?:?(\\d{2})?(\\.\\d{1,6})?(am|pm)?(?:(Z)|(?:([+-])(\\d{2})(?::?(\\d{2}))?)?)?)$",to:["hour","minute","second","millisecond","meridian","utc","offset_sign","offset_hours","offset_minutes"],today:true,
timeIncluded:true}],ca=[{token:"millisec(?:onds?)?|ms(?:ms)?",pad:3,format:function(a,b){return l(a,"get",b,"Milliseconds")}},{token:"s(?:s|ec(?:onds?)?)?",pad:2,format:function(a,b){return l(a,"get",b,"Seconds")}},{token:"m(?:m|in(?:utes?)?)?",pad:2,caps:true,format:function(a,b){return l(a,"get",b,"Minutes")}},{token:"h(?:h|(?:ours?))?|24hr",pad:2,format:function(a,b){return l(a,"get",b,"Hours")}},{token:"12hr",pad:2,format:function(a,b){var c=l(a,"get",b,"Hours");return c===0?12:c-Math.floor(c/
13)*12}},{token:"d(?:d|ate|ays?)?",pad:2,format:function(a,b){return l(a,"get",b,"Date")}},{token:"dow|weekday(?: short)?",weekdays:true,format:function(a,b){return l(a,"get",b,"Day")}},{token:"MM?",pad:2,caps:true,format:function(a,b){return l(a,"get",b,"Month")+1}},{token:"mon(th)?(?: short)?",months:true,format:function(a,b){return l(a,"get",b,"Month")}},{token:"yy",format:function(a,b){return l(a,"get",b,"FullYear").toString().from(2)}},{token:"yyyy|year",format:function(a,b){return l(a,"get",
b,"FullYear")}},{token:"t{1,2}",meridian:true,format:function(a,b){return l(a,"get",b,"Hours")<12?"am":"pm"}},{token:"tz|timezone",format:function(a){return a.getUTCOffset()}},{token:"iso(tz|timezone)",format:function(a){return a.getUTCOffset(true)}},{token:"ord",format:function(a,b){return l(a,"get",b,"Date").ordinalize()}}],r=[{unit:"year",method:"FullYear",multiplier:function(a){return(365+(a?a.isLeapYear()?1:0:0.25))*24*60*60*1E3}},{unit:"month",method:"Month",multiplier:function(a){return(a?
a.daysInMonth():30.4375)*24*60*60*1E3}},{unit:"week",method:"Week",multiplier:function(){return 6048E5}},{unit:"day",method:"Date",multiplier:function(){return 864E5}},{unit:"hour",method:"Hours",multiplier:function(){return 36E5}},{unit:"minute",method:"Minutes",multiplier:function(){return 6E4}},{unit:"second",method:"Seconds",multiplier:function(){return 1E3}},{unit:"millisecond",method:"Milliseconds",multiplier:function(){return 1}}],da=function(a,b){var c={};b.each(function(d,e){var f=a[e+1];
if(typeof f==="string")f=f.toLowerCase();c[d]=f});return c},V=function(a){var b,c={},d={},e=false,f=new Date;if(Object.isObject(a)){d=a;f=(new Date).set(a,true)}else if(Object.isNumber(a))f=new Date(a);else if(Object.isDate(a))f=a;else if(Object.isString(a)){a=a.trim().replace(/\.+$/,"").replace(/^now$/,"");U.each(function(g){if(!b)if(b=ba(a,g.reg)){c=g;var h=da(b,c.to);if(Date.allowVariant&&c.variant){g=h.month;h.month=h.day;h.day=g}if(h.year){if(!h.modifier_unit)h.modifier_unit="year";if(h.year.length===
2)h.year=ea(h.year.toNumber())}if(h.month){g=h.month.toNumber();h.month=isNaN(g)?D.indexOf(h.month.to(3)):g-1}if(h.hour==="noon"||h.hour==="midnight"){h.hour=h.hour==="noon"?12:24;if(!d.day&&!h.fuzzy_day)h.fuzzy_day="today"}if(h.fuzzy_day){g=0;var i=h.fuzzy_day;if(i==="yesterday")g=-1;else if(i==="tomorrow")g=1;else if((i=E.indexOf(i.to(3)))!==-1){f.setWeekday(i);g=0;if(h.modifier_sign&&!h.modifier_unit&&!h.modifier_amount)h.modifier_unit="week"}d.year=f.getFullYear();d.month=f.getMonth();d.day=f.getDate()+
g}if(h.millisecond)h.millisecond=(parseFloat(h.millisecond,10)*1E3).round();r.each(function(x){x=x.unit;if(h[x]!==undefined)d[x]=h[x].toNumber()});if(h.meridian)if(h.meridian==="pm"&&h.hour<12)d.hour+=12;if(h.utc||h.offset_hours||h.offset_minutes){e=true;g=0;if(h.offset_hours)g+=h.offset_hours.toNumber()*60;if(h.offset_minutes)g+=h.offset_minutes.toNumber();if(h.offset_sign&&h.offset_sign==="-")g*=-1;d.minute-=g}if(h.modifier_unit&&h.modifier_sign){g=h.modifier_amount||1;i=h.modifier_unit;var m;g=
g==="the"||g==="a"?1:(m=T.indexOf(g))!==-1?m:g.toNumber();if(h.modifier_sign==="before"||h.modifier_sign==="ago"||h.modifier_sign==="last")g*=-1;else if(h.modifier_sign==="this"||h.modifier_sign==="the")g=0;if(i==="year"&&!c.relative)d.year=f.getFullYear();else if(i==="month"&&!c.relative)d.month=f.getMonth();else if(i==="week"&&!c.relative){d.day=f.getDate();i="day";g*=7}if(d[i]===undefined)d[i]=0;d[i]+=g}if(h.modifier_edge){m=h.modifier_edge;if(m==="beginning"||m==="first"||m==="first day"){if(h.modifier_unit===
"week"){d.month=f.getMonth();d.weekday=0}else if(h.modifier_unit==="month"||h.month)d.day=1;if(!m.match(/day/)){d.hour=0;d.minute=0;d.second=0;d.millisecond=0}}else if(m==="end"||m==="last"||m==="last day"){if(h.modifier_unit==="week"){d.month=f.getMonth();d.weekday=6}else if(h.modifier_unit==="month"||h.month)d.day=32-(new Date(f.getFullYear(),d.month,32)).getDate();else if(h.modifier_unit==="year"){d.month=11;d.day=31}if(!m.match(/day/)){d.hour=23;d.minute=59;d.second=59;d.millisecond=999}}}if(h.year_sign&&
h.year_sign==="-")d.year*=-1;if(c.today){d.year=f.getFullYear();d.month=f.getMonth();d.day=f.getDate()}}});if(b)if(c.relative)f.advance(d);else e?f.setUTC(d,true):f.set(d,true);else f=a?new Date(a):new Date}return{date:f,set:d,format:c}},p=function(a,b,c,d,e){var f,g,h=V(b);c=c>0?c:0;if(!h.date.isValid())return false;r.each(function(m){if(h.set[m.unit]!==undefined||h.set[m.unit+"s"]!==undefined){f=m.unit;g=m.multiplier(h.date)-1}});if(h.format.relative)if(b=h.date["beginningOf"+f.capitalize()])b.call(h.date);
else{c=c||Math.round(g/2);g=0}g=g||0;a=a.getTime();b=h.date.getTime();var i=b+g;return d==="after"?e?a-c>b:a>i+c:d==="before"?e?a<i+c:a-c<b:a>=b-c&&a<i+c+1},H=function(a,b,c,d,e){d=d===true?"UTC":"";if(Object.isNumber(b)&&!e){a.setTime(b);return a}else if(Object.isNumber(b)&&e)b={milliseconds:b};if(b.date)b.day=b.date;c&&a.setDate(15);r.each(function(g){var h=g.unit;g=g.method;var i=W(b,h,c);if(i!==undefined){if(e){if(h==="week"){i=(b.day||0)+i*7;g="Date"}i=i*e+l(a,"get","",g)}l(a,"set",d,g,i)}});
if(!e){var f=W(b,"weekday",c);f!==undefined&&l(a,"set",d,"Weekday",f)}return a},W=function(a,b,c){var d=a[b];if(d===undefined)d=a[b+"s"];if(d===undefined&&c)switch(b){case "day":d=1;break;case "year":case "week":case "weekday":break;default:d=0}return d},l=function(a,b,c,d,e){return a[b+c+d].call(a,e)},ea=function(a){return Math.round((new Date).getFullYear()/100)*100-Math.round(a/100)*100+a},fa=function(a){if(/\w+\s+\w+/.test(a))return null;a=D.indexOf(a.toLowerCase().to(3));return a===-1?null:a},
ga=function(a){if(/\w+\s+\w+/.test(a))return null;a=E.indexOf(a.toLowerCase().to(3));return a===-1?null:a},O=function(a,b,c,d){b=K(b);var e={};e[c]=a;return b[d].call(b,e)},X=function(a){var b,c=a.millisecondsAgo(),d=Math.abs(c),e=d;c=c>=0?-1:1;var f="millisecond";r.concat().reverse().slice(1).each(function(g){b=Math.floor(d/g.multiplier(a));if(b>=1){e=b;f=g.unit}});if(e!=1)f+="s";return[e,f,d,c]},K=function(a){a=a.length>=2&&Object.isNumber(a[0])?t(a,"year","month","day","hour","minute","second",
"millisecond")[0]:a[0];return V(a).date};k(Date,false,{make:function(){return K(arguments)},DSTOffset:((new Date(2E3,6,1)).getTimezoneOffset()-(new Date(2E3,0,1)).getTimezoneOffset())*60*1E3,INTERNATIONAL_TIME:"{h}:{mm}:{ss}",RFC1123:"{Dow}, {dd} {Mon} {yyyy} {hh}:{mm}:{ss} GMT{tz}",RFC1036:"{Weekday}, {dd}-{Mon}-{yy} {hh}:{mm}:{ss} GMT{tz}",ISO8601_DATE:"{yyyy}-{MM}-{dd}",ISO8601_DATETIME:"{yyyy}-{MM}-{dd}T{hh}:{mm}:{ss}.{ms}{isotz}"});k(Date,true,{set:function(){var a=t(arguments,"year","month",
"day","hour","minute","second","millisecond");return H(this,a[0],a[1])},setUTC:function(){var a=t(arguments,"year","month","day","hour","minute","second","millisecond");return H(this,a[0],a[1],true)},setWeekday:function(a){a!==undefined&&this.setDate(this.getDate()+a-this.getDay())},setUTCWeekday:function(a){a!==undefined&&this.setDate(this.getUTCDate()+a-this.getDay())},setWeek:function(a){if(a!==undefined){this.getDate();this.setMonth(0);this.setDate(a*7+1)}},setUTCWeek:function(a){if(a!==undefined){this.getUTCDate();
this.setMonth(0);this.setUTCDate(a*7+1)}},getWeek:function(){var a=new Date(this.getFullYear(),0,1);return Math.ceil((this.getTime()-a.getTime()+1)/6048E5)},getUTCWeek:function(){var a=(new Date).setUTC(this.getUTCFullYear(),0,1,0,0,0,0);return Math.ceil((this.getTime()-a.getTime()+1)/6048E5)},getUTCOffset:function(a){var b=this.utc?0:this.getTimezoneOffset(),c=a===true?":":"";if(!b&&a)return"Z";return Math.round(-b/60).pad(2,true)+c+(b%60).pad(2)},toUTC:function(){if(this.utc)return this;var a=this.clone().addMinutes(this.getTimezoneOffset());
a.utc=true;return a},isUTC:function(){return this.utc||this.getTimezoneOffset()===0},advance:function(){var a=t(arguments,"year","month","day","hour","minute","second","millisecond");return H(this,a[0],false,false,1,true)},rewind:function(){var a=t(arguments,"year","month","day","hour","minute","second","millisecond");return H(this,a[0],false,false,-1)},isValid:function(){return!isNaN(this.getTime())},isAfter:function(a,b){return p(this,a,b,"after")},isBefore:function(a,b){return p(this,a,b,"before")},
isBetween:function(a,b,c){return p(this,a,c,"after",true)&&p(this,b,c,"before",true)?true:p(this,b,c,"after",true)&&p(this,a,c,"before",true)},isLeapYear:function(){var a=this.getFullYear();return a%4===0&&a%100!==0||a%400===0},daysInMonth:function(){return 32-(new Date(this.getFullYear(),this.getMonth(),32)).getDate()},format:function(a){var b=this,c;if(b.isValid())if(a)if(Date[a])a=Date[a];else{if(Object.isFunction(a)){c=X(b);a=a.apply(b,c)||"relative"}}else return this.toString();else return"Invalid Date";
if(a=="relative"){c=c||X(b);if(c[2]<1E3){c[0]=1;c[1]="second"}return c[0]+" "+c[1]+" "+(c[3]<0?"ago":"from now")}ca.each(function(d){if(a)a=a.replace(RegExp("\\{("+d.token+")(?: (pad))?\\}",d.caps?"":"i"),function(e,f,g){e=d.format.call(null,b,"");if(d.pad&&(f.length===2||g==="pad"))e=e.pad(d.pad);if(d.weekdays){g=f.toLowerCase();e=(g=g==="dow"||g==="weekday short")?E[e]:G[e];if(f.first().toUpperCase()===f.first())e=e.capitalize()}if(d.months){g=f.toLowerCase();e=(g=g==="mon"||g==="month short")?
D[e]:F[e];if(f.first().toUpperCase()===f.first())e=e.capitalize()}if(d.meridian){if(f.length===1)e=e.to(1);if(f.toUpperCase()===f)e=e.toUpperCase()}return e})});return a},relative:function(a){return this.format(a||"relative")},is:function(a,b){var c,d;if(Object.isString(b)){var e=r.find(function(f){return f.unit===b});if(e)b=e.multiplier()}b=b>0?b:0;if(Object.isString(a)){a=a.trim();return a==="future"?this.getTime()>(new Date).getTime():a==="past"?this.getTime()<(new Date).getTime():a==="weekday"?
!(this.getDay()===0||this.getDay()===6):a==="weekend"?this.getDay()===0||this.getDay()===6:(d=ga(a))?this.getDay()===d:(c=fa(a))?this.getMonth()===c:p(this,a,b)}else{a=Date.create(a);b=b||0;c=this.getTime();e=a.getTime();return c>=e-b&&c<e+1+b}},resetTime:function(){return this.set({hour:0,minute:0,second:0,millisecond:0})},clone:function(){return new Date(this.getTime())},toISOString:function(){return this.toUTC().format(Date.ISO8601_DATETIME)}});k(Date,false,{ISO8601:Date.ISO8601_DATETIME,create:Date.make});
k(Date,true,{getWeekday:Date.prototype.getDay,getUTCWeekday:Date.prototype.getUTCDay,iso:Date.prototype.toISOString});k(Function,false,{lazy:function(a,b){if(b===undefined)b=1;var c=0;return function(){var d=this,e=arguments;setTimeout(function(){return a.apply(d,e)},Math.round(++c*b))}}});k(Function,true,{bind:function(a){var b=this,c=Array.prototype.slice.call(arguments,1);return function(){return b.apply(a,c.concat(Array.prototype.slice.call(arguments)))}},delay:function(a){var b=this,c=Array.prototype.slice.call(arguments,
1);return this.timer=setTimeout(function(){return b.apply(b,c)},a)},defer:function(){this.delay.apply(this,[0].concat(Array.prototype.slice.call(arguments)));return this},cancel:function(){return clearTimeout(this.timer)}});(function(){M.slice(1).each(function(a){j(Object,"is"+a,function(b){return I(b,a)})});j(Object,"isArray",Array.isArray||function(a){return I(a,"Array")});N.each(function(a){j(v.prototype,a,function(){return Object[a].apply(null,[this].concat(Array.prototype.slice.call(arguments)))})});
j(Object,"clone",A);j(v.prototype,"clone",function(){return A(this)});j(Object,"enableSugar",function(){M.each(function(a){j(Object.prototype,"is"+a,function(){return Object["is"+a](this)})});N.each(function(a){j(Object.prototype,a,v.prototype[a])});j(Object.prototype,"clone",function(){return A(this)})})})();(function(){B={};C={};for(var a=0;a<Q.length;a++){var b=Q[a];B[b.kata]=b;C[b.hira]=b}})();(function(){o={};w={};for(var a=0;a<P.length;a++){var b=P[a];o[b.half]=b;w[b.full]=b}})();(function(){aa.each(function(a){var b=
RegExp("^["+a.source+"\\s]+$"),c=RegExp("["+a.source+"]");a.names.each(function(d){j(String.prototype,"is"+d,function(){return!!this.trim().match(b)});j(String.prototype,"has"+d,function(){return!!this.match(c)})})})})();(function(){r.each(function(a,b){var c=a.unit,d=c.capitalize(),e=a.multiplier();j(Date.prototype,c+"sSince",function(f){return((this.getTime()-Date.create(f).getTime())/e).round()});j(Date.prototype,c+"sUntil",function(f){return((Date.create(f).getTime()-this.getTime())/e).round()});
j(Date.prototype,c+"sAgo",Date.prototype[c+"sUntil"]);j(Date.prototype,c+"sFromNow",Date.prototype[c+"sSince"]);j(Date.prototype,"add"+d+"s",function(f){var g={};g[c]=f;return this.advance(g)});Z(c,e);if(b<3){j(Date.prototype,"isLast"+d,function(){return this.is("last "+c)});j(Date.prototype,"isThis"+d,function(){return this.is("this "+c)});j(Date.prototype,"isNext"+d,function(){return this.is("next "+c)})}if(b<4){j(Date.prototype,"beginningOf"+d,function(f){if(f===undefined||c=="day")f=true;var g=
{month:0,day:1};switch(c){case "week":g.weekday=0;case "day":g.day=this.getDate();case "month":g.month=this.getMonth()}return this.set(g,f)});j(Date.prototype,"endOf"+d,function(f){if(f===undefined||c=="day")f=true;var g=f?{hours:23,minutes:59,seconds:59,milliseconds:999}:{};g.day=this.getDate();g.month=this.getMonth();switch(c){case "year":g.month=11;g.day=31;break;case "month":g.day=this.daysInMonth();break;case "week":g.weekday=6}return this.set(g,f)})}})})();(function(){D=F.map(function(d){return d.to(3)});
E=G.map(function(d){return d.to(3)});var a=F.map(function(d){return d.to(3)+"(?:\\.|"+d.from(3)+")?"}).join("|"),b=G.map(function(d){return d.to(3)+"(?:\\.|"+d.from(3)+")?"}).join("|"),c=T.join("|");U.each(function(d){var e="^"+d.reg;e=e.replace(/{WEEKDAYS}/,b);e=e.replace(/{MONTHS}/,a);e=e.replace(/{NUMBER}/,c);if(!d.timeIncluded){e+="(?:(?:\\s+|t)(\\d{1,2}):?(\\d{2})?:?(\\d{2})?(\\.\\d{1,6})?(am|pm)?(?:(Z)|(?:([+-])(\\d{2})(?::?(\\d{2}))?)?)?)?$";d.to=d.to.concat(["hour","minute","second","millisecond",
"meridian","utc","offset_sign","offset_hours","offset_minutes"])}d.reg=RegExp(e,"i")})})();(function(){["today","yesterday","tomorrow","weekday","weekend","future","past"].concat(G).concat(F).each(function(a){j(Date.prototype,"is"+a.capitalize(),function(){return this.is(a)})})})()})();

/*
jQuery Waypoints - v1.1
Copyright (c) 2011 Caleb Troughton
Dual licensed under the MIT license and GPL license.
https://github.com/imakewebthings/jquery-waypoints/blob/master/MIT-license.txt
https://github.com/imakewebthings/jquery-waypoints/blob/master/GPL-license.txt
*/
(function($,k,m,i,d){var e=$(i),g="waypoint.reached",b=function(o,n){o.element.trigger(g,n);if(o.options.triggerOnce){o.element[k]("destroy")}},h=function(p,o){var n=o.waypoints.length-1;while(n>=0&&o.waypoints[n].element[0]!==p[0]){n-=1}return n},f=[],l=function(n){$.extend(this,{element:$(n),oldScroll:-99999,waypoints:[],didScroll:false,didResize:false,doScroll:$.proxy(function(){var q=this.element.scrollTop(),p=q>this.oldScroll,s=this,r=$.grep(this.waypoints,function(u,t){return p?(u.offset>s.oldScroll&&u.offset<=q):(u.offset<=s.oldScroll&&u.offset>q)}),o=r.length;if(!this.oldScroll||!q){$[m]("refresh")}this.oldScroll=q;if(!o){return}if(!p){r.reverse()}$.each(r,function(u,t){if(t.options.continuous||u===o-1){b(t,[p?"down":"up"])}})},this)});$(n).scroll($.proxy(function(){if(!this.didScroll){this.didScroll=true;i.setTimeout($.proxy(function(){this.doScroll();this.didScroll=false},this),$[m].settings.scrollThrottle)}},this)).resize($.proxy(function(){if(!this.didResize){this.didResize=true;i.setTimeout($.proxy(function(){$[m]("refresh");this.didResize=false},this),$[m].settings.resizeThrottle)}},this));e.load($.proxy(function(){this.doScroll()},this))},j=function(n){var o=null;$.each(f,function(p,q){if(q.element[0]===n){o=q;return false}});return o},c={init:function(o,n){this.each(function(){var u=$.fn[k].defaults.context,q,t=$(this);if(n&&n.context){u=n.context}if(!$.isWindow(u)){u=t.closest(u)[0]}q=j(u);if(!q){q=new l(u);f.push(q)}var p=h(t,q),s=p<0?$.fn[k].defaults:q.waypoints[p].options,r=$.extend({},s,n);r.offset=r.offset==="bottom-in-view"?function(){var v=$.isWindow(u)?$[m]("viewportHeight"):$(u).height();return v-$(this).outerHeight()}:r.offset;if(p<0){q.waypoints.push({element:t,offset:t.offset().top,options:r})}else{q.waypoints[p].options=r}if(o){t.bind(g,o)}});$[m]("refresh");return this},remove:function(){return this.each(function(o,p){var n=$(p);$.each(f,function(r,s){var q=h(n,s);if(q>=0){s.waypoints.splice(q,1)}})})},destroy:function(){return this.unbind(g)[k]("remove")}},a={refresh:function(){$.each(f,function(r,s){var q=$.isWindow(s.element[0]),n=q?0:s.element.offset().top,p=q?$[m]("viewportHeight"):s.element.height(),o=q?0:s.element.scrollTop();$.each(s.waypoints,function(u,x){var t=x.options.offset,w=x.offset;if(typeof x.options.offset==="function"){t=x.options.offset.apply(x.element)}else{if(typeof x.options.offset==="string"){var v=parseFloat(x.options.offset);t=x.options.offset.indexOf("%")?Math.ceil(p*(v/100)):v}}x.offset=x.element.offset().top-n+o-t;if(s.oldScroll>w&&s.oldScroll<=x.offset){b(x,["up"])}else{if(s.oldScroll<w&&s.oldScroll>=x.offset){b(x,["down"])}}});s.waypoints.sort(function(u,t){return u.offset-t.offset})})},viewportHeight:function(){return(i.innerHeight?i.innerHeight:e.height())},aggregate:function(){var n=$();$.each(f,function(o,p){$.each(p.waypoints,function(q,r){n=n.add(r.element)})});return n}};$.fn[k]=function(n){if(c[n]){return c[n].apply(this,Array.prototype.slice.call(arguments,1))}else{if(typeof n==="function"||!n){return c.init.apply(this,arguments)}else{if(typeof n==="object"){return c.init.apply(this,[null,n])}else{$.error("Method "+n+" does not exist on jQuery "+k)}}}};$.fn[k].defaults={continuous:true,offset:0,triggerOnce:false,context:i};$[m]=function(n){if(a[n]){return a[n].apply(this)}else{return a.aggregate()}};$[m].settings={resizeThrottle:200,scrollThrottle:100};e.load(function(){$[m]("refresh")})})(jQuery,"waypoint","waypoints",this);
(function(/*! Stitch !*/) {
  if (!this.require) {
    var modules = {}, cache = {}, require = function(name, root) {
      var module = cache[name], path = expand(root, name), fn;
      if (module) {
        return module;
      } else if (fn = modules[path] || modules[path = expand(path, './index')]) {
        module = {id: name, exports: {}};
        try {
          cache[name] = module.exports;
          fn(module.exports, function(name) {
            return require(name, dirname(path));
          }, module);
          return cache[name] = module.exports;
        } catch (err) {
          delete cache[name];
          throw err;
        }
      } else {
        throw 'module \'' + name + '\' not found';
      }
    }, expand = function(root, name) {
      var results = [], parts, part;
      if (/^\.\.?(\/|$)/.test(name)) {
        parts = [root, name].join('/').split('/');
      } else {
        parts = name.split('/');
      }
      for (var i = 0, length = parts.length; i < length; i++) {
        part = parts[i];
        if (part == '..') {
          results.pop();
        } else if (part != '.' && part != '') {
          results.push(part);
        }
      }
      return results.join('/');
    }, dirname = function(path) {
      return path.split('/').slice(0, -1).join('/');
    };
    this.require = function(name) {
      return require(name, '');
    }
    this.require.define = function(bundle) {
      for (var key in bundle)
        modules[key] = bundle[key];
    };
  }
  return this.require.define;
}).call(this)({"admin": function(exports, require, module) {(function() {
  require("bootstrap_parts");
  window.miu = {
    markdownTitle: function(markItUp, char) {
      var heading, n, num;
      heading = '';
      n = $.trim(markItUp.selection || markItUp.placeHolder).length;
      for (num = 0; 0 <= n ? num <= n : num >= n; 0 <= n ? num++ : num--) {
        heading += char;
      }
      return "\n" + heading;
    }
  };
  window.mdParse = (new Showdown.converter()).makeHtml;
  window.interchangeFrenchAndEnglish = function() {
    var doReplacement, doReplacements, multi_replacements, sr_name, sr_value, _results;
    multi_replacements = {
      titles: {
        en: $(".section-title-en"),
        fr: $(".section-title-fr-CA")
      },
      content: {
        en: $(".section-content-en"),
        fr: $(".section-content-fr-CA")
      }
    };
    doReplacement = function($en, $fr) {
      if (!$en.val()) {
        $en.val($fr.val());
      }
      if (!$fr.val()) {
        return $fr.val($en.val());
      }
    };
    doReplacements = function(set) {
      var $$en, $$fr;
      $$en = set.en;
      $$fr = set.fr;
      return $$en.each(function(i, item) {
        var $en, $fr;
        $en = $(item);
        $fr = $($$fr[i]);
        return doReplacement($en, $fr);
      });
    };
    $(".localized-form-field").each(function(i, el) {
      var $en, $fr;
      $en = $(el).find('[id^="en-form-input"]');
      $fr = $(el).find('[id^="fr-CA-form-input"]');
      return doReplacement($en, $fr);
    });
    _results = [];
    for (sr_name in multi_replacements) {
      sr_value = multi_replacements[sr_name];
      _results.push(doReplacements(sr_value));
    }
    return _results;
  };
  window.setupMultisection_fields = function() {
    var $add_button, $container, $html_model, $injection_container, register_remove_buttons;
    $container = $(".multisection-field");
    $injection_container = $container.find(".multisection-parts");
    $html_model = $container.find(".multisection-part").first();
    $add_button = $container.find(".add-multisection-part");
    register_remove_buttons = function() {
      var $remove_buttons;
      $remove_buttons = $container.find(".remove-multisection-part");
      return $remove_buttons.click(function(e) {
        var $block_to_remove, $current_target;
        $current_target = $(e.target);
        $block_to_remove = $current_target.parents(".multisection-part");
        $block_to_remove.remove();
        return false;
      });
    };
    register_remove_buttons();
    return $add_button.click(function(e) {
      var $new_multisection_part;
      $new_multisection_part = $html_model.clone();
      $new_multisection_part.find("input,textarea").val('');
      $injection_container.append($new_multisection_part);
      register_remove_buttons();
      return false;
    });
  };
  $(document).ready(function() {
    require("./bootstrap_content");
    require("language_switcher");
    window.admin_controller = new (require("controllers/admin"));
    if (Backbone.history.getFragment() === '') {
      Backbone.history.saveLocation("/list/posts");
    }
    return Backbone.history.start();
  });
}).call(this);
}, "bootstrap_content": function(exports, require, module) {(function() {
  var in_storyboard_posts, posts_data, team_data;
  app.collections.posts = new (require("collections/posts"));
  posts_data = JSON.parse($(document.body).attr("data-initial-posts"));
  app.collections.posts.refresh(posts_data);
  in_storyboard_posts = app.collections.posts.filter(function(model) {
    return model.get("in_storyboard");
  });
  app.collections.in_storyboard_posts = new Backbone.Collection(in_storyboard_posts);
  app.collections.team = new (require("collections/team"));
  team_data = JSON.parse($(document.body).attr("data-db-team"));
  app.collections.team.refresh(team_data);
}).call(this);
}, "bootstrap_parts": function(exports, require, module) {(function() {
  var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
  jQuery.fn.tablesorter2 = function(options) {
    var col;
    this.tablesorter(options);
    this.find("th").bind("click", __bind(function(e) {
      var $target, col;
      $target = $(e.currentTarget);
      $target.siblings().removeClass("sorted-on");
      col = $target.index();
      return this.find(".sorted-on").removeClass("sorted-on").end().find("td:nth-child(" + (col + 1) + ")").addClass("sorted-on");
    }, this));
    if (options.sortList) {
      col = options.sortList[0][0];
      this.find(".sorted-on").removeClass("sorted-on").end().find("td:nth-child(" + (col + 1) + ")").addClass("sorted-on");
    }
    return this;
  };
  window.content = require("content");
  window._i = content.tools._i;
  jQuery.fn.isLocalizedField = function() {
    return this.attr("name").split("--")[0] === "localized-field";
  };
  jQuery.fn.localizedFieldName = function() {
    return this.attr("name").split("--")[1];
  };
  jQuery.fn.localizedFieldLangCode = function() {
    return this.attr("name").split("--")[2];
  };
  jQuery.fn.isMarkdownField = function() {
    return this.attr("data-markdown");
  };
  jQuery.fn.parseLocalizedContent = function() {
    var $localized_tag, $wrapping_tag, classes, lang_code, value, wrapping_tag_name;
    lang_code = this.localizedFieldLangCode();
    wrapping_tag_name = this.isMarkdownField() ? "div" : "span";
    classes = "localized localized-" + lang_code;
    $wrapping_tag = $(document.createElement(wrapping_tag_name)).attr("class", classes);
    value = this.parseMarkdownField();
    $localized_tag = $wrapping_tag.html(value);
    return $localized_tag.outerHTML();
  };
  jQuery.fn.parseMarkdownField = function() {
    return this.data("markdown") || this.val();
  };
  jQuery.fn.buildLocalizedObj = function() {
    var o;
    return o = {
      raw: this.val(),
      parsed: this.parseLocalizedContent(),
      lang: this.localizedFieldLangCode()
    };
  };
  jQuery.fn.buildMarkdownObj = function() {
    var o;
    return o = {
      raw: this.val(),
      parsed: this.parseMarkdownField()
    };
  };
  jQuery.fn.parseFormField = function() {
    if (this.isLocalizedField()) {
      return this.buildLocalizedObj();
    } else if (this.isMarkdownField()) {
      return this.buildMarkdownObj();
    } else {
      return {
        parsed: this.val(),
        raw: this.val()
      };
    }
  };
  jQuery.fn.outerHTML = function() {
    return this.clone().wrap('<div></div>').parent().html();
  };
  window.driver_qtip_options = function(options) {
    var _ref;
    if ((_ref = options.textFunction) == null) {
      options.textFunction = function() {
        return $(this).attr("title");
      };
    }
    return {
      content: {
        text: options.textFunction
      },
      style: {
        classes: "warm-yellow"
      },
      tip: {
        width: 11,
        height: 6
      },
      position: {
        viewport: $("#page-content"),
        my: "bottom center",
        at: "top center",
        adjust: {
          y: -3
        }
      }
    };
  };
  window.LegendSegmentsWaypoints = require("legend_segments_waypoints");
  window.app = {
    controllers: {},
    models: {},
    collections: {},
    views: {}
  };
}).call(this);
}, "collections/posts": function(exports, require, module) {(function() {
  var Posts;
  var __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) {
    for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
    function ctor() { this.constructor = child; }
    ctor.prototype = parent.prototype;
    child.prototype = new ctor;
    child.__super__ = parent.prototype;
    return child;
  };
  Posts = (function() {
    __extends(Posts, Backbone.Collection);
    function Posts() {
      Posts.__super__.constructor.apply(this, arguments);
    }
    Posts.prototype.url = "/posts";
    Posts.prototype.model = require('models/post');
    return Posts;
  })();
  module.exports = Posts;
}).call(this);
}, "collections/team": function(exports, require, module) {(function() {
  var Team;
  var __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) {
    for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
    function ctor() { this.constructor = child; }
    ctor.prototype = parent.prototype;
    child.prototype = new ctor;
    child.__super__ = parent.prototype;
    return child;
  };
  Team = (function() {
    __extends(Team, Backbone.Collection);
    function Team() {
      Team.__super__.constructor.apply(this, arguments);
    }
    Team.prototype.model = require("models/team_member");
    Team.prototype.comparator = function(model) {
      return content.sets.team_members.indexOf(model.get("email").toLowerCase());
    };
    return Team;
  })();
  module.exports = Team;
}).call(this);
}, "content/blueprints": function(exports, require, module) {(function(){
  var sets, blueprints, _ref, __import = function(obj, src){
    var own = {}.hasOwnProperty;
    for (var key in src) if (own.call(src, key)) obj[key] = src[key];
    return obj;
  };
  sets = require("./sets");
  blueprints = {};
  blueprints.generic = {
    title: {
      type: {},
      'default': "",
      localized: true,
      filters: sets.localized_attr_filters,
      tabular: true,
      is_specification: false
    },
    sub_title: {
      type: {},
      localized: true,
      filters: sets.localized_attr_filters,
      'default': ""
    },
    post_content: {
      type: {},
      no_admin: true
    },
    post_summary: {
      type: {},
      field_type: "textarea",
      localized: true,
      filters: sets.localized_attr_filters,
      'default': ""
    },
    date_published: {
      type: Date,
      'default': Date.now,
      no_admin: true,
      get: function(date){
        return date.getFullYear() + " " + date.getMonth() + " " + date.getDate();
      }
    },
    box_type: {
      type: String,
      field_type: "select",
      'default': sets.box_types[0],
      'enum': sets.box_types
    },
    tags: {
      type: Array,
      'default': [],
      field_type: "text"
    },
    flickr_set: {
      type: {},
      'default': false,
      no_admin: true
    },
    flickr_set_id: {
      type: String,
      'default': ""
    },
    branch: {
      type: String,
      field_type: "select",
      set: function(new_branch_value){
        return new_branch_value.toLowerCase();
      },
      'default': sets.branches[0],
      'enum': sets.branches
    },
    post_status: {
      type: String,
      field_type: "select",
      set: function(new_post_status){
        return new_post_status.toLowerCase();
      },
      'default': sets.post_statuses[0],
      'enum': sets.post_statuses
    },
    in_storyboard: {
      type: Boolean,
      'default': true,
      default_value: true
    },
    in_table: {
      type: Boolean,
      'default': true,
      default_value: true
    },
    custom_storyboard_url: {
      type: String,
      'default': '',
      default_value: ''
    }
  };
  blueprints.building = (_ref = __import({}, blueprints.generic), _ref.date_completed = {
    type: String,
    'default': 2000,
    tabular: true
  }, _ref.location = {
    type: {},
    'default': "Montreal",
    tabular: true,
    localized: true,
    filters: sets.localized_attr_filters
  }, _ref.square_feet = {
    type: String,
    'default': 1000,
    tabular: true
  }, _ref.floors = {
    type: String,
    'default': 2,
    tabular: true
  }, _ref.budget = {
    type: String,
    'default': 1000000
  }, _ref.type = {
    type: String,
    field_type: "select",
    'default': sets.project_types[0],
    tabular: true,
    'enum': sets.project_types
  }, _ref.number_of_units = {
    type: String,
    'default': 10,
    tabular: true
  }, _ref.usage = {
    type: String,
    field_type: "select",
    'default': sets.usage[0],
    'enum': sets.usage,
    tabular: true
  }, _ref);
  blueprints.resdev = (_ref = __import({}, blueprints.generic), _ref.activity_type = {
    type: String,
    field_type: "select",
    'default': sets.activity_types[0],
    'enum': sets.activity_types,
    tabular: true
  }, _ref.date_occurred = {
    type: String,
    'default': 2000,
    tabular: true
  }, _ref.host = {
    type: {},
    'default': {},
    tabular: true,
    localized: true,
    filters: sets.localized_attr_filters
  }, _ref);
  blueprints.architecture = __import({}, blueprints.building);
  blueprints.management = __import({}, blueprints.building);
  blueprints.updates = (_ref = __import({}, blueprints.generic), _ref.date_published = {
    type: Date,
    'default': Date.now,
    tabular: true,
    no_admin: true,
    get: function(date){
      date.getFullYear() + " " + date.getMonth() + " " + date.getDate();
      return "test";
    }
  }, _ref.title = {
    type: {},
    field_type: "text",
    'default': "",
    localized: true,
    filters: sets.localized_attr_filters,
    tabular: true
  }, _ref);
  blueprints.combined = __import(__import(__import({}, blueprints.generic), blueprints.building), blueprints.resdev);
  blueprints.team_member = {
    first_name: {
      type: String
    },
    last_name: {
      type: String
    },
    email: {
      type: String
    },
    photo_url: {
      type: String
    },
    in_footer: {
      type: Boolean,
      default_value: true
    },
    in_about: {
      type: Boolean,
      default_value: true
    },
    jobtitle: {
      type: {},
      field_type: "text",
      localized: true,
      filters: sets.localized_attr_filters
    },
    education: {
      type: {},
      field_type: "textarea",
      localized: true,
      filters: sets.localized_attr_filters
    },
    stats: {
      type: {},
      field_type: "textarea",
      localized: "true",
      filters: sets.localized_attr_filters
    },
    bio: {
      type: {},
      field_type: "textarea",
      localized: "true",
      filters: (_ref = sets.localized_attr_filters, _ref.outer_container_class = function(s, data){
        return "localized-form-field localized-form-field-" + data.html_handle + " markdown-form-field";
      }, _ref)
    }
  };
  module.exports = blueprints;
}).call(this);
}, "content/data": function(exports, require, module) {(function(){
  var about;
  about = {
    who_we_are: {
      title: {
        en: "who we are",
        "fr-CA": "QUI NOUS SOMMES"
      },
      body: {
        en: "<p>We are KANVA, based in Montreal and founded in 2003. Our multidisciplinary practice centres on contemporary interventions in the urban landscape. Each of our projects expresses our core values of sustainability, innovation and integration. We don’t just design: we envision, build, develop and influence.</p>\n<p>Founding partners Tudor Radulescu and Rami Bebawi are both graduates of the McGill School of Architecture. In 2009, Tudor Radulescu and Rami Bebawi were selected by the Quebec government as Modèles sans frontières (mentors without borders) to serve as positive role models for children from underprivileged communities. La Presse, North America’s largest French-language daily, cited Radulescu and Bebawi as among the 36 most promising figures in tomorrow’s Quebec. They lead the team in commercial, corporate, residential and industrial mandates.</p>\n<p>Collaboration is the key to our work. Our tightly knit team of professionals works to maximize each project’s potential, feasibility and impact. We prioritize cooperation, dialogue and interaction — the same values we share with the community. In our definition, true success comes from setting a positive example.</p>",
        "fr-CA": "<p>Nous sommes KANVA, établis à Montréal depuis 2003. Notre pratique multidisciplinaire est axée sur les interventions contemporaines en milieu urbain. Tous nos projets sont portés par trois grands principes : durabilité, innovation et intégration. Au-delà de faire de la conception, nous sommes animés par une volonté d’imaginer, de construire, de développer et d’influencer. </p>\n<p>La collaboration est au cœur de notre méthode de travail. Notre équipe soudée de professionnels s’applique à maximiser le potentiel, la faisabilité et l’impact de chaque projet. Nous privilégions la coopération, le dialogue et l’interaction — ces mêmes valeurs que nous partageons avec la collectivité. Selon nous, c’est en établissant un exemple positif que l’on atteint un véritable succès.</p>\n<p>Les associés fondateurs de KANVA, Tudor Radulescu et Rami Bebawi, sont diplômés de l’École d’architecture de McGill. En 2009, ils ont été choisis par le gouvernement du Québec pour faire partie de l’initiative Modèles sans frontières afin de servir de modèles de réussite auprès des jeunes issus de l’immigration. Le journal La Presse, principal quotidien français en Amérique du Nord, a d’ailleurs classé les deux associés parmi les 36 personnalités les plus prometteuses du Québec de demain. Sous la direction de Tudor Radulescu et de Rami Bebawi, l’équipe de KANVA réalise des mandats commerciaux, résidentiels et industriels. </p>"
      }
    },
    client_list: {
      title: {
        en: "list of clients",
        "fr-CA": "LISTE DE CLIENTS"
      },
      body: {
        en: ["Vadlavan", "Propair Transporteur Aérien", "Iga Sobeys", "Groupe Archambault", "Bertuch L’agence Graphique", "Institut Neurologique De Montréal", "Snc-Lavalin", "Maison Elizabeth House", "Magil Construction Corporation", "Jardins De Métis/Reford Gardens", "Starlife Gym", "Les Trois Minots", "Telus Mobilité", "Groupe Shapiro", "Aménagement Côté Jardin", "Le Bar Saint-Laurent Frappé", "Olive Orange", "Les Constructions Marton", "Fusion Montréal Crèmerie Artisanale", "Les Galeries Laval", "Bluesponge", "City Trend Urban Planning And Management", "Agence Nationale Des Barrages D’algérie", "Société En Commandite Immobilière Solim", "Johnnyvac", "Ça Va De Soi", "3745 St-Jacques Inc.", "La Librairie De Verdun", "Simard Beaudry Construction", "Yoga Lounge Montréal", "Tango Libre", "F.D.L. Compagnie Ltée"],
        "fr-CA": ["Vadlavan", "Propair Transporteur Aérien", "Iga Sobeys", "Groupe Archambault", "Bertuch L’agence Graphique", "Institut Neurologique De Montréal", "Snc-Lavalin", "Maison Elizabeth House", "Magil Construction Corporation", "Jardins De Métis/Reford Gardens", "Starlife Gym", "Les Trois Minots", "Telus Mobilité", "Groupe Shapiro", "Aménagement Côté Jardin", "Le Bar Saint-Laurent Frappé", "Olive Orange", "Les Constructions Marton", "Fusion Montréal Crèmerie Artisanale", "Les Galeries Laval", "Bluesponge", "City Trend Urban Planning And Management", "Agence Nationale Des Barrages D’algérie", "Société En Commandite Immobilière Solim", "Johnnyvac", "Ça Va De Soi", "3745 St-Jacques Inc.", "La Librairie De Verdun", "Simard Beaudry Construction", "Yoga Lounge Montréal", "Tango Libre", "F.D.L. Compagnie Ltée"]
      }
    },
    our_expertise: {
      title: {
        en: "our expertise",
        "fr-CA": "NOTRE EXPERTISE"
      },
      body: {
        en: "<p>Put simply: we know buildings. Buildings are our medium. We think buildings, talk buildings, breathe, sleep, and dream buildings. They’re the touchstone for all our projects, from works of creative architecture to real estate developments to site-specific installations.</p>\n<p>We know that great design isn’t just beautiful — it’s also smart. One of our fundamental concerns is responsibly transforming buildings and neighbourhoods. We consider the existing conditions, and then ask how we can use them to break new ground.</p>\n<p>We treat every project as an opportunity to innovate and evolve. We set the standards rather than just applying them. And we also keep it real, ensuring an artful balance of creativity, functionality and feasibility.</p>\n",
        "fr-CA": "<p>Simplement dit, les bâtiments constituent notre matière première. Nous pensons, rêvons, et respirons les bâtiments. Ils sont la pierre angulaire de tous nos projets, qu’il soit question d’architecture créative, de promotion immobilière ou d’une installation artistique. </p>\n<p>Pour être réussi, un design ne peut qu’être beau, il doit être intelligent. La transformation responsable des bâtiments et des quartiers figure parmi nos principales préoccupations. C’est pourquoi nous prenons en considération les conditions existantes et explorons les possibilités de nous en servir de façon novatrice. </p>\n<p>Pour nous, chaque projet est une occasion d’innover et d’évoluer. Au lieu d’appliquer les normes, nous cherchons à les établir. Sans perdre de vue la réalité, nous maintenons un ingénieux équilibre entre créativité, fonctionnalité et faisabilité. </p>"
      }
    },
    architecture: {
      title: {
        en: "architecture",
        "fr-CA": "architecture"
      },
      body: {
        en: "<p>We build ideas. For us, each new architectural project is a chance to express a concept through a built form. </p>\n<p>We have extensive construction experience, top industry contacts and multiple professional accreditations. This helps us fuse creativity, attention to detail and respect for heritage with technical and financial feasibility. </p>\n<p>We’re also deeply concerned with narratives of place. We use our knowledge of the city’s evolution to inform all of our work. Every project is an opportunity to tell a story, highlight a building’s character and that of its surroundings, and push our practice — and the field — one step further.</p>",
        "fr-CA": "<p>Construire des idées. Pour nous, chaque projet d’architecture est une occasion d’exprimer un concept au moyen du construit. </p>\n<p>Nous détenons de nombreuses accréditations professionnelles, possédons une vaste expérience en construction et profitons d’un important réseau au sein de l’industrie. Nous concilions créativité, souci du détail et respect du patrimoine avec faisabilité technique et financière. </p>\n<p>Le discours narratif d’un lieu revêt une grande importance pour nous. C’est pourquoi nous mettons notre connaissance de l’évolution de la ville au service de notre art. Chaque projet est l’occasion de raconter une histoire, de mettre en valeur les particularités d’un bâtiment et de son environnement immédiat, et de faire avancer notre pratique.</p>"
      },
      services: {
        title: {
          en: "services offered",
          "fr-CA": "Services offerts"
        },
        body: {
          en: ["Surveying & Layout", "Conceptualization & Design", "3D Renderings & Visual Presentations", "Permits & Authorizations", "Execution documents", "Tender documents", "Construction documents", "Contract Administration", "Interior design", "Master planning", "Landscaping", "Building Expertise"],
          "fr-CA": ["Relevé et mise en plan", "Concepts et esquisses", "Modélisation 3D et présentations graphiques", "Permis et autorisations", "Plans et devis définitifs", "Plans et devis d’appel d’offres", "Plans et devis pour construction", "Surveillance de chantier", "Design intérieur", "Plans directeurs", "Aménagement paysager", "Expertise du bâtiment"]
        }
      }
    },
    management: {
      title: {
        en: "management",
        "fr-CA": "management"
      },
      body: {
        en: "<p>Essentially, we do it all. We find a site. We imagine possibilities. We draw plans, crunch numbers, flesh out ideas, then set about turning the dream into reality. </p>\n<p>Each action and every decision is focused on one single goal: building successful projects. Our strategy is beautifully simple. We’re a one-stop shop. We pool our energies and expertise to deliver turnkey building solutions that provide secure investment opportunities. </p>\n<p>Our deep knowledge of Montreal’s property market, neighbourhoods and regulations makes us a powerful ally in any project. We have longstanding relations with key players, from financers to notaries, surveyors and more. This lets us work efficiently and maximize profitability. Our construction management practices, backed by a strong network of seasoned contractors, incorporate stringent controls to meet quality standards, deadlines and costs. </p>",
        "fr-CA": "<p>Nous nous occupons essentiellement de tout. Nous trouvons un site. Nous envisageons les possibilités. Nous dessinons les plans, jonglons avec les chiffres, développons les idées, puis travaillons à transformer le rêve en réalité. </p>\n<p>Chacune de nos actions et de nos décisions vise un objectif unique : la réussite de chaque projet. Notre stratégie s’avère des plus simples; nous proposons un guichet unique. Par le regroupement de nos ressources et de notre expertise, nous sommes en mesure de livrer des projets clés en main qui offrent des possibilités d’investissement dignes de confiance. </p>\n<p>Grâce à notre connaissance pointue du marché immobilier, des arrondissements et de la réglementation de Montréal, nous représentons un allié de taille dans la réalisation des projets. Nous entretenons des relations de longue date avec les principaux intervenants du milieu, des investisseurs aux notaires en passant par les inspecteurs. L’efficacité et la rentabilité sont donc au rendez-vous. Le respect des normes de qualité, des échéanciers et des coûts est assuré par les contrôles rigoureux mis en place dans nos pratiques de gestion de la construction, qui sont appuyées par un solide réseau d’entrepreneurs expérimentés. </p>"
      },
      services: {
        title: {
          en: "services offered",
          "fr-CA": "Services offerts"
        },
        body: {
          en: ["Land & Property scouting", "Feasibility studies", "Revenue projections", "Construction cost estimates", "Soft cost estimates", "Scheduling & Phasing", "Financial analysis", "Financial structuring", "Marketing and publicity strategies", "Management of Sales", "Project Management", "Accounting", "Construction Management", "Post-construction services"],
          "fr-CA": ["Recherche de propriété", "Études de faisabilité", "Projections de revenus", "Estimation des coûts directs", "Estimation des coûts indirects", "Échéanciers et phasage", "Analyse financière", "Structure financière", "Stratégie de mise en marché", "Gestion des ventes", "Gestion de projet", "Comptabilité", "Gestion de construction", "Services post-construction"]
        }
      }
    },
    resdev: {
      title: {
        en: "R&D",
        "fr-CA": "R&D"
      },
      body: {
        en: "<p>What do buildings mean to us? What functions do they serve beyond shelter? What mirrors do they hold up to us as individuals? As a society?</p>\n<p>Our experimental laboratory uses the built environment as a springboard for creative exploration. This helps us get people talking and thinking. We might stage an art intervention in an abandoned structure, mount a call to artists to question contemporary architecture in the built heritage, or publish an article on how neighbourhood evolution can affect city planning. In short, we aim to bring together people and their built environment.</p>",
        "fr-CA": "<p>Que repr&#233;sentent les b&#226;timents pour nous? Au-del&#224; de servir &#224; abriter, quelles fonctions remplissent-ils? Quelle image nous renvoient-ils en tant qu'individu?</p>\n<p>En tant que soci&#233;t&#233;? &#8232;&#8232;Dans notre laboratoire, l'environnement construit sert de tremplin pour l'exploration cr&#233;ative. Il s'agit d'un v&#233;hicule qui permet de faire parler et r&#233;fl&#233;chir les gens. Que ce soit en organisant une intervention artistique dans un lieu abandonn&#233;, en lan&#231;ant un appel de candidatures aux artistes pour engager une r&#233;flexion sur l'architecture contemporaine dans le contexte du patrimoine b&#226;ti ou en publiant un article sur la fa&#231;on dont l'&#233;volution des quartiers peut influencer le plan d'urbanisme d'une ville, notre objectif est de rapprocher les gens de l'environnement construit.</p>"
      },
      activities: {
        title: {
          en: "activity",
          "fr-CA": "Activité"
        },
        body: {
          en: ["Exhibitions", "Competitions", "Research & Development", "Publications"],
          "fr-CA": ["Exposition", "Concours", "Recherche & Développement", "Publications"]
        }
      }
    },
    in_the_press: {
      title: {
        en: "in the press",
        "fr-CA": "Revue de presse"
      },
      column_names: ["project", "date", "title", "publication", "link"],
      body: {
        en: [
          {
            "project": '',
            "date": 2000,
            "title": "Fundare",
            "publication": "Archéologique, publication no 14",
            "link": "http://www.archeologie.qc.ca/nos_publications_14.php?menu=2#Bebawi"
          }, {
            "project": 'Fabbrica',
            "date": 2010,
            "title": "Fabbrica",
            "publication": "Habitat Collectif",
            "link": ""
          }, {
            "project": "7140 Alexandra",
            "date": 2007,
            "title": "Nid urbain, cachet historique",
            "publication": "Voir",
            "link": "http://www.voir.ca/publishing/article.aspx?zone=1&section=25&article=53546"
          }, {
            "project": "7140 Alexandra",
            "date": 2007,
            "title": "Retour en Petite Italie, des condos abordables dans une ancienne manufacture",
            "publication": "Le Devoir",
            "link": "http://www.ledevoir.com/loisirs/157845/alexandra-retour-en-petite-italie"
          }, {
            "project": "7140 Alexandra",
            "date": 2007,
            "title": "Une autre usine change de vocation",
            "publication": "La Presse",
            "link": "http://montoit.cyberpresse.ca/habitation/immobilier/200709/24/01-870885-marconi-alexandra-une-autre-usine-change-de-vocation.php"
          }, {
            "project": "Fabbrica",
            "date": 2007,
            "title": "Tissu urbain – Pour ces clients de plus en plus concernés par les questions environnementales",
            "publication": "Le Devoir",
            "link": "http://www.ledevoir.com/loisirs/131420/fabbrica-tissu-urbain"
          }, {
            "project": "Fabbrica",
            "date": 2007,
            "title": "Lofts dans une ancienne usine de la Petite Italie",
            "publication": "La Presse",
            "link": "http://montoit.cyberpresse.ca/habitation/presentation-speciale/200706/28/01-870519-lofts-dans-une-ancienne-usine-de-la-petite-italie.php"
          }, {
            "project": "Fabbrica",
            "date": 2006,
            "title": "Lofts branchés dans une usine de textile",
            "publication": "La Presse",
            "link": "http://montoit.cyberpresse.ca/habitation/200610/19/01-869654-lofts-branches-dans-une-usine-de-textile.php"
          }, {
            "project": "Fabbrica",
            "date": 2006,
            "title": "Un recyclage heureux et une insertion harmonieuse / A successful conversion and a harmonious insertion",
            "publication": "L’Opération patrimoine architectural de Montréal",
            "link": "http://www.operationpatrimoine.com/"
          }, {
            "project": "Fabbrica",
            "date": 2010,
            "title": "Biggaré, convoité et propice à la créativité",
            "publication": "La Presse",
            "link": "http://montoit.cyberpresse.ca/habitation/immobilier/201011/10/01-4341285-bigarre-convoite-et-propice-a-la-creativite.php"
          }, {
            "project": "Fabbrica",
            "date": 2006,
            "title": "Un nid urbain",
            "publication": "Voir",
            "link": ""
          }, {
            "project": "W4455",
            "date": 2009,
            "title": "Du neuf au cœur de la promenade Wellington",
            "publication": "Le Devoir",
            "link": "http://www.ledevoir.com/societe/267684/le-w4455-du-neuf-au-coeur-de-la-promenade-wellington"
          }, {
            "project": "W4455",
            "date": 2009,
            "title": "Hype intégrée rue Wellington",
            "publication": "Voir",
            "link": "http://www.voir.ca/publishing/article.aspx?zone=1&section=25&article=65811"
          }, {
            "project": "Fabbrica – W4455 – 7140 Alexandra",
            "date": 2009,
            "title": "Des bâtiments contemporains clés en main",
            "publication": "La Presse",
            "link": "http://montoit.cyberpresse.ca/architecture/200906/24/01-878456-des-batiments-contemporains-cles-en-main.php"
          }, {
            "project": "Irène",
            "date": 2010,
            "title": "Confortable, stylisé, abordable, écologique, rien de moins",
            "publication": "Le Devoir",
            "link": "http://www.ledevoir.com/galeries-photos/lofts-irene-confortable-stylise-abordable-ecologique-rien-de-moins/67716"
          }, {
            "project": "Irène",
            "date": 2010,
            "title": "Saint-Henri de plus en plus convoité",
            "publication": "La Presse",
            "link": "http://montoit.cyberpresse.ca/habitation/201010/05/01-4329672-saint-henri-de-plus-en-plus-convoite.php"
          }, {
            "project": "Irène",
            "date": 2010,
            "title": "Rétro-techno",
            "publication": "Voir",
            "link": "http://www.voir.ca/publishing/article.aspx?zone=1&section=25&article=73253"
          }, {
            "project": "Habitat Verde",
            "date": 2005,
            "title": "Des lofts écologiques et économiques",
            "publication": "La Presse",
            "link": "http://montoit.cyberpresse.ca/habitation/200511/11/01-868188-des-lofts-ecologiques-et-economiques.php"
          }, {
            "project": "",
            "date": 2005,
            "title": "Le Québec de demain – des bâtiments contemporains clés en main",
            "publication": "La Presse",
            "link": "http://montoit.cyberpresse.ca/architecture/200906/24/01-878456-des-batiments-contemporains-cles-en-main.php"
          }, {
            "project": "",
            "date": 2009,
            "title": "Kanva architecture : Art mur à mur",
            "publication": "Voir",
            "link": "http://www.voir.ca/publishing/article.aspx?zone=1&section=25&article=65951"
          }, {
            "project": "",
            "date": 2009,
            "title": "Stanley revisité",
            "publication": "Société des arts technologiques",
            "link": "http://sat.qc.ca/post.php?id=1&post_id=1809&lang=fr Stanley revisité, appel de candidatures"
          }, {
            "project": "7140 Alexandra",
            "date": 2008,
            "title": "Rosemont–La Petite-Patrie : 10 projets qui réinventent le quartier",
            "publication": "La Presse",
            "link": "http://montoit.cyberpresse.ca/habitation/immobilier/200801/30/01-871463-rosemont-la-petite-patrie-10-projets-qui-reinventent-le-quartier.php"
          }
        ],
        "fr-CA": [
          {
            "project": '',
            "date": 2000,
            "title": "Fundare",
            "publication": "Archéologique, publication no 14",
            "link": "http://www.archeologie.qc.ca/nos_publications_14.php?menu=2#Bebawi"
          }, {
            "project": 'Fabbrica',
            "date": 2010,
            "title": "Fabbrica",
            "publication": "Habitat Collectif",
            "link": ""
          }, {
            "project": "7140 Alexandra",
            "date": 2007,
            "title": "Nid urbain, cachet historique",
            "publication": "Voir",
            "link": "http://www.voir.ca/publishing/article.aspx?zone=1&section=25&article=53546"
          }, {
            "project": "7140 Alexandra",
            "date": 2007,
            "title": "Retour en Petite Italie, des condos abordables dans une ancienne manufacture",
            "publication": "Le Devoir",
            "link": "http://www.ledevoir.com/loisirs/157845/alexandra-retour-en-petite-italie"
          }, {
            "project": "7140 Alexandra",
            "date": 2007,
            "title": "Une autre usine change de vocation",
            "publication": "La Presse",
            "link": "http://montoit.cyberpresse.ca/habitation/immobilier/200709/24/01-870885-marconi-alexandra-une-autre-usine-change-de-vocation.php"
          }, {
            "project": "Fabbrica",
            "date": 2007,
            "title": "Tissu urbain – Pour ces clients de plus en plus concernés par les questions environnementales",
            "publication": "Le Devoir",
            "link": "http://www.ledevoir.com/loisirs/131420/fabbrica-tissu-urbain"
          }, {
            "project": "Fabbrica",
            "date": 2007,
            "title": "Lofts dans une ancienne usine de la Petite Italie",
            "publication": "La Presse",
            "link": "http://montoit.cyberpresse.ca/habitation/presentation-speciale/200706/28/01-870519-lofts-dans-une-ancienne-usine-de-la-petite-italie.php"
          }, {
            "project": "Fabbrica",
            "date": 2006,
            "title": "Lofts branchés dans une usine de textile",
            "publication": "La Presse",
            "link": "http://montoit.cyberpresse.ca/habitation/200610/19/01-869654-lofts-branches-dans-une-usine-de-textile.php"
          }, {
            "project": "Fabbrica",
            "date": 2006,
            "title": "Un recyclage heureux et une insertion harmonieuse / A successful conversion and a harmonious insertion",
            "publication": "L’Opération patrimoine architectural de Montréal",
            "link": "http://www.operationpatrimoine.com/"
          }, {
            "project": "Fabbrica",
            "date": 2010,
            "title": "Biggaré, convoité et propice à la créativité",
            "publication": "La Presse",
            "link": "http://montoit.cyberpresse.ca/habitation/immobilier/201011/10/01-4341285-bigarre-convoite-et-propice-a-la-creativite.php"
          }, {
            "project": "Fabbrica",
            "date": 2006,
            "title": "Un nid urbain",
            "publication": "Voir",
            "link": ""
          }, {
            "project": "W4455",
            "date": 2009,
            "title": "Du neuf au cœur de la promenade Wellington",
            "publication": "Le Devoir",
            "link": "http://www.ledevoir.com/societe/267684/le-w4455-du-neuf-au-coeur-de-la-promenade-wellington"
          }, {
            "project": "W4455",
            "date": 2009,
            "title": "Hype intégrée rue Wellington",
            "publication": "Voir",
            "link": "http://www.voir.ca/publishing/article.aspx?zone=1&section=25&article=65811"
          }, {
            "project": "Fabbrica – W4455 – 7140 Alexandra",
            "date": 2009,
            "title": "Des bâtiments contemporains clés en main",
            "publication": "La Presse",
            "link": "http://montoit.cyberpresse.ca/architecture/200906/24/01-878456-des-batiments-contemporains-cles-en-main.php"
          }, {
            "project": "Irène",
            "date": 2010,
            "title": "Confortable, stylisé, abordable, écologique, rien de moins",
            "publication": "Le Devoir",
            "link": "http://www.ledevoir.com/galeries-photos/lofts-irene-confortable-stylise-abordable-ecologique-rien-de-moins/67716"
          }, {
            "project": "Irène",
            "date": 2010,
            "title": "Saint-Henri de plus en plus convoité",
            "publication": "La Presse",
            "link": "http://montoit.cyberpresse.ca/habitation/201010/05/01-4329672-saint-henri-de-plus-en-plus-convoite.php"
          }, {
            "project": "Irène",
            "date": 2010,
            "title": "Rétro-techno",
            "publication": "Voir",
            "link": "http://www.voir.ca/publishing/article.aspx?zone=1&section=25&article=73253"
          }, {
            "project": "Habitat Verde",
            "date": 2005,
            "title": "Des lofts écologiques et économiques",
            "publication": "La Presse",
            "link": "http://montoit.cyberpresse.ca/habitation/200511/11/01-868188-des-lofts-ecologiques-et-economiques.php"
          }, {
            "project": "",
            "date": 2005,
            "title": "Le Québec de demain – des bâtiments contemporains clés en main",
            "publication": "La Presse",
            "link": "http://montoit.cyberpresse.ca/architecture/200906/24/01-878456-des-batiments-contemporains-cles-en-main.php"
          }, {
            "project": "",
            "date": 2009,
            "title": "Kanva architecture : Art mur à mur",
            "publication": "Voir",
            "link": "http://www.voir.ca/publishing/article.aspx?zone=1&section=25&article=65951"
          }, {
            "project": "",
            "date": 2009,
            "title": "Stanley revisité",
            "publication": "Société des arts technologiques",
            "link": "http://sat.qc.ca/post.php?id=1&post_id=1809&lang=fr Stanley revisité, appel de candidatures"
          }, {
            "project": "7140 Alexandra",
            "date": 2008,
            "title": "Rosemont–La Petite-Patrie : 10 projets qui réinventent le quartier",
            "publication": "La Presse",
            "link": "http://montoit.cyberpresse.ca/habitation/immobilier/200801/30/01-871463-rosemont-la-petite-patrie-10-projets-qui-reinventent-le-quartier.php"
          }
        ]
      }
    }
  };
  module.exports = {
    about: about
  };
}).call(this);
}, "content/index": function(exports, require, module) {(function(){
  var settings, sets, blueprints, tools, data, forms, schema_configs, name, part, sub_name, sub_part, bp_name, blueprint, _ref;
  settings = require("./settings");
  sets = require("./sets");
  blueprints = require("./blueprints");
  tools = require("./tools");
  data = require("./data");
  forms = {};
  schema_configs = {
    post: {},
    team: {}
  };
  for (name in _ref = blueprints.team_member) {
    part = _ref[name];
    schema_configs.team[name] = tools.createSchemaField(name, part);
  }
  for (name in _ref = blueprints.combined) {
    part = _ref[name];
    if (part.type) {
      schema_configs.post[name] = tools.createSchemaField(name, part);
    } else {
      schema_configs.post[name] = {};
      for (sub_name in part) {
        sub_part = part[sub_name];
        schema_configs.post[name][sub_name] = tools.createSchemaField(sub_name, sub_part);
      }
    }
  }
  for (bp_name in blueprints) {
    blueprint = blueprints[bp_name];
    forms[bp_name] = {};
    for (name in blueprint) {
      part = blueprint[name];
      if (part.type) {
        if (!part.no_admin) {
          forms[bp_name][name] = tools.createFormField(name, part);
        }
      } else {
        for (sub_name in part) {
          sub_part = part[sub_name];
          if (!sub_part.no_admin) {
            forms[bp_name][sub_name] = tools.createFormField(sub_name, sub_part);
          }
        }
      }
    }
  }
  module.exports = {
    blueprints: blueprints,
    sets: sets,
    schema_configs: schema_configs,
    forms: forms,
    tools: tools,
    settings: settings,
    data: data
  };
}).call(this);
}, "content/sets": function(exports, require, module) {(function(){
  module.exports = {
    localized_attr_filters: {
      "for": function(string, data, lang_code){
        return lang_code + "-" + string;
      },
      container_class: function(string, data, lang_code){
        return "form-field form-field-" + data.name.dasherize().replace(' ', '-') + " " + lang_code + "-form-field-" + data.name.dasherize().replace(" ", "-");
      },
      label: function(string, data, lang_code){
        if (lang_code === "en") {
          return "english";
        } else {
          return "french";
        }
      },
      outer_container_class: function(string, data){
        return "localized-form-field localized-form-field-" + data.html_handle;
      },
      name: function(string, data, lang_code){
        return "localized-field--" + data.name + "--" + lang_code;
      }
    },
    team_members: ["tr@kanva.ca", "mgt@kanva.ca", "ep@kanva.ca", "rb@kanva.ca", "jy@kanva.ca", "ca@kanva.ca", "ko@kanva.ca", "ok@kanva.ca"],
    tables_split_on: {
      architecture: "usage",
      management: "usage",
      resdev: "activity_type",
      update: "usage"
    },
    admin_locations: ["update-post", "create-post", "list-posts"],
    locations: ["home", "storyboard", "table", "post", "about"],
    branches: ["architecture", "management", "resdev", "updates"],
    architecture_tabular_order: {
      "title": "title",
      "date_completed": "date",
      "location": "location",
      "type": "type",
      "square_feet": "feet(2)",
      "floors": "flrs",
      "number_of_units": "# units"
    },
    management_tabular_order: {
      "title": "title",
      "date_completed": "date",
      "location": "location",
      "type": "type",
      "square_feet": "feet(2)",
      "floors": "flrs",
      "number_of_units": "# units"
    },
    updates_tabular_order: {
      "title": "title",
      "date_published": "date"
    },
    resdev_tabular_order: {
      "title": "title",
      "date_occurred": "date",
      "host": "host"
    },
    lang_labels: {
      en: "english",
      "fr-CA": "french"
    },
    langs: [
      {
        code: "en",
        name: "english"
      }, {
        code: "fr-CA",
        name: "french-canadian"
      }
    ],
    project_types: ["new construction", "renovation and addition", "renovation"],
    usage: ["multi-residential", "multi-residential and commercial", "single dwelling residential", "corporate", "commercial"],
    post_statuses: ["published", "draft"],
    activity_types: ["exhibitions", "competition", "materials", "publications"],
    markdown_post_fields: ['localized-field--section_title--en', 'localized-field--section_body--en', 'localized-field--section_title--fr-CA', 'localized-field--section_body--fr-CA', 'localized-field--post_summary--en', 'localized-field--post_summary--fr-CA'],
    box_types: ["automatic", "photo", "photo_plain", "writing"],
    _i_index: {
      materials: {
        en: "materials",
        "fr-CA": "mat&eacute;riaux"
      },
      gallery: {
        en: "gallery",
        "fr-CA": "galerie"
      },
      about: {
        en: "about",
        "fr-CA": "À propos"
      },
      home: {
        en: "home",
        "fr-CA": "Accueil"
      },
      list: {
        en: "list",
        "fr-CA": "Liste"
      },
      all: {
        en: "all",
        "fr-CA": "tous"
      },
      storyboard: {
        en: "thumbnails",
        "fr-CA": "Scénario"
      },
      specifications: {
        en: "specifications",
        "fr-CA": "Spécifications"
      },
      "related content": {
        en: "related content",
        "fr-CA": "Sur le même thème"
      },
      "multi-residential": {
        en: "multi-residential",
        "fr-CA": "multi-résidentiel"
      },
      "single dwelling residential": {
        en: "single dwelling residential",
        "fr-CA": "Logement unique residential"
      },
      "link": {
        en: "link",
        "fr-CA": "Lien"
      },
      "corporate": {
        en: "corporate",
        "fr-CA": "Corporatif"
      },
      "title": {
        en: "title",
        "fr-CA": "titre"
      },
      "location": {
        en: "location",
        "fr-CA": "emplacement"
      },
      "flrs": {
        "en": "floors",
        "fr-CA": "Étages"
      },
      "# units": {
        "en": "# units",
        "fr-CA": "# unités"
      },
      "feet(2)": {
        "en": "feet(2)",
        "fr-CA": "Superficie (pi.ca)"
      },
      "renovation and addition": {
        "en": "renovation and addition",
        "fr-CA": "Rénovation et agrandissement"
      },
      "new construction": {
        en: "new construction",
        "fr-CA": "Nouvelle construction"
      },
      "renovation": {
        "en": "renovation",
        "fr-CA": "Rénovation"
      },
      "exhibitions": {
        en: "exhibitions",
        "fr-CA": "Expositions"
      },
      "competition": {
        en: "competition",
        "fr-CA": "Concours"
      },
      "resdev": {
        en: "R&D",
        "fr-CA": "R&D"
      },
      "host": {
        en: "host",
        "fr-CA": "Hôte"
      },
      "next": {
        en: "next",
        "fr-CA": "suivante"
      },
      "previous": {
        en: "previous",
        "fr-CA": "précédent"
      }
    }
  };
}).call(this);
}, "content/settings": function(exports, require, module) {(function(){
  module.exports = {
    flickr_api_key: "da7203b4ae48a70e9b3297dc13f8e3ca",
    flickr_secret: "da0aa9a666c87ffe",
    flickr_user_id: "64808285@N07",
    flickr_options: {
      extras: ["url_m", "url_l", "url_o", "tags"]
    },
    markit_html: {
      onShiftEnter: {
        keepDefault: false,
        replaceWith: '<br />\n'
      },
      onCtrlEnter: {
        keepDefault: false,
        openWith: '\n<p>',
        closeWith: '</p>'
      },
      onTab: {
        keepDefault: false,
        replaceWith: '    '
      },
      markupSet: [
        {
          name: 'Bold',
          key: 'B',
          openWith: '(!(<strong>|!|<b>)!)',
          closeWith: '(!(</strong>|!|</b>)!)'
        }, {
          name: 'Italic',
          key: 'I',
          openWith: '(!(<em>|!|<i>)!)',
          closeWith: '(!(</em>|!|</i>)!)'
        }, {
          name: 'Stroke through',
          key: 'S',
          openWith: '<del>',
          closeWith: '</del>'
        }, {
          separator: '.'
        }, {
          name: 'Bulleted List',
          openWith: '    <li>',
          closeWith: '</li>',
          multiline: true,
          openBlockWith: '<ul>\n',
          closeBlockWith: '\n</ul>'
        }, {
          name: 'Numeric List',
          openWith: '    <li>',
          closeWith: '</li>',
          multiline: true,
          openBlockWith: '<ol>\n',
          closeBlockWith: '\n</ol>'
        }, {
          separator: '.'
        }, {
          name: 'Picture',
          key: 'P',
          replaceWith: '<img src="[![Source:!:http://]!]" alt="[![Alternative text]!]" />'
        }, {
          name: 'Link',
          key: 'L',
          openWith: '<a href="[![Link:!:http://]!]"(!( title="[![Title]!]")!)>',
          closeWith: '</a>',
          placeHolder: 'Your text to link...'
        }, {
          separator: '.'
        }, {
          name: 'Clean',
          className: 'clean',
          replaceWith: function(markitup){
            return markitup.selection.replace(/<(.*?)>/g, "");
          }
        }, {
          name: 'Preview',
          className: 'preview',
          call: 'preview'
        }
      ]
    },
    markit_markdown: {
      previewParserPath: '',
      onShiftEnter: {
        keepDefault: false,
        openWith: '\n\n'
      },
      previewInWindow: 'width=800, height=600, resizable=yes, scrollbars=yes',
      markupSet: [
        {
          name: 'First Level Heading',
          key: '1',
          placeHolder: 'Your title here...',
          closeWith: function(markItUp){
            return miu.markdownTitle(markItUp, '=');
          }
        }, {
          name: 'Second Level Heading',
          key: '2',
          placeHolder: 'Your title here...',
          closeWith: function(markItUp){
            return miu.markdownTitle(markItUp, '-');
          }
        }, {
          name: 'Heading 3',
          key: '3',
          openWith: '### ',
          placeHolder: 'Your title here...'
        }, {
          name: 'Heading 4',
          key: '4',
          openWith: '#### ',
          placeHolder: 'Your title here...'
        }, {
          name: 'Heading 5',
          key: '5',
          openWith: '##### ',
          placeHolder: 'Your title here...'
        }, {
          name: 'Heading 6',
          key: '6',
          openWith: '###### ',
          placeHolder: 'Your title here...'
        }, {
          separator: '.'
        }, {
          name: 'Bold',
          key: 'B',
          openWith: '**',
          closeWith: '**'
        }, {
          name: 'Italic',
          key: 'I',
          openWith: '_',
          closeWith: '_'
        }, {
          name: 'Bulleted List',
          openWith: '- '
        }, {
          name: 'Numeric List',
          openWith: function(markItUp){
            return markItUp.line + '. ';
          }
        }, {
          name: 'Picture',
          key: 'P',
          replaceWith: '![[![Alternative text]!]]([![Url:!:http://]!] "[![Title]!]")'
        }, {
          name: 'Link',
          key: 'L',
          openWith: '[',
          closeWith: ']([![Url:!:http://]!] "[![Title]!]")',
          placeHolder: 'Your text to link here...'
        }, {
          name: 'Quotes',
          openWith: '> '
        }, {
          name: 'Preview',
          call: 'preview',
          className: "preview"
        }
      ]
    }
  };
}).call(this);
}, "content/tools": function(exports, require, module) {(function(){
  var sets, tools, __import = function(obj, src){
    var own = {}.hasOwnProperty;
    for (var key in src) if (own.call(src, key)) obj[key] = src[key];
    return obj;
  };
  sets = require("./sets");
  tools = {};
  tools.createFormField = function(name, blueprint_part){
    var form_field_model, _ref;
    blueprint_part.filters == null && (blueprint_part.filters = {});
    return form_field_model = {
      blueprint_part: blueprint_part,
      html_handle: tools.cssClassify(name),
      label: tools.htmlLabelify(name),
      name: name,
      original_name: name,
      value: (_ref = blueprint_part.default_value) != null ? _ref : null,
      lang: {},
      'enum': blueprint_part['enum'] || {},
      formset_title: blueprint_part.formset_title || (blueprint_part.localized ? tools.htmlLabelify(name) : ''),
      localized: blueprint_part.localized,
      type: blueprint_part.field_type || tools.getFieldTypeForModelType(blueprint_part.type),
      "for": "form-input-" + tools.cssClassify(name),
      container_class: "form-field form-field-" + tools.cssClassify(name),
      outer_container_class: "",
      render: function(previous_value){
        var fields, lang, data, _i, _ref, _len;
        this.value = previous_value != null
          ? previous_value
          : this.value;
        if (this.localized) {
          fields = {};
          for (_i = 0, _len = (_ref = sets.langs).length; _i < _len; ++_i) {
            lang = _ref[_i];
            data = __import({}, this);
            data = tools.filterAttributes(data, lang.code);
            fields[lang.code] = tools.aField(data, lang.code);
          }
          return tools.aLocalizedFieldContainer(fields);
        } else {
          return tools.renderFormField(this);
        }
      }
    };
  };
  tools.renderFormField = function(data){
    return this.aFieldContainer(this.aField(this.filterAttributes(data)));
  };
  tools.aField = function(data, lang_code){
    if (data.name.has("location")) {
      console.log(data);
    }
    return {
      input: this.createInput(data, lang_code),
      label: this.createLabel(data, lang_code),
      data: data
    };
  };
  tools.aLocalizedFieldContainer = function(fields){
    var lang_code, field, fields_contained, _res;
    _res = [];
    for (lang_code in fields) {
      field = fields[lang_code];
      _res.push(this.aFieldContainer(field));
    }
    fields_contained = _res;
    return "<div class=\"" + fields.en.data.outer_container_class + " \">\n    <h1>" + fields.en.data.formset_title + "</h1>\n    <div class=\"form-fields\">\n        " + fields_contained.join("") + "\n    </div>\n</div>";
  };
  tools.aFieldContainer = function(form_field){
    return "<div class=\"" + form_field.data.container_class + "\">\n" + form_field.label + "\n" + form_field.input + "\n</div>";
  };
  tools.createInput = function(data, lang_code){
    var attributes, num, the_value, option, is_selected, select_content, _ref, _ref2, _res, _i, _len;
    attributes = this.buildInputAttributes(data);
    num = lang_code === "en" ? 0 : 1;
    the_value = (_ref = (_ref = data.value) != null ? (_ref2 = _ref[num]) != null ? _ref2.raw : void 8 : void 8) != null
      ? _ref
      : data.value;
    switch (data.type) {
    case "select":
      _res = [];
      for (_i = 0, _len = (_ref = data['enum']).length; _i < _len; ++_i) {
        option = _ref[_i];
        is_selected = option === the_value;
        _res.push("<option " + tools.maybeAttribute("selected", is_selected) + ">" + option + "</option>");
      }
      select_content = _res;
      return "<select " + attributes + ">\n    " + select_content.join('') + "\n</select>";
    case "textarea":
      return "<textarea " + attributes + ">" + the_value + "</textarea>";
    case "checkbox":
      return "<input " + attributes + "> ";
    default:
      return "<input " + attributes + " value=\"" + the_value + "\"> ";
    }
  };
  tools.createLabel = function(data){
    return "<label " + this.buildLabelAttributes(data) + ">" + data.label + "</label>";
  };
  tools.buildInputAttributes = function(data){
    var attribute_names, attributes, attr_name, attr_wired_to;
    attribute_names = {
      "id": "for",
      "name": "name",
      "placeholder": "placeholder",
      "required": "requird"
    };
    switch (data.type) {
    case "select":
      attribute_names["selected"] = "";
      break;
    case "checkbox":
      attribute_names["type"] = "type";
      attribute_names["checked"] = "value";
      break;
    default:
      attribute_names["type"] = "type";
    }
    attributes = {};
    for (attr_name in attribute_names) {
      attr_wired_to = attribute_names[attr_name];
      if (data[attr_wired_to]) {
        attributes[attr_name] = data[attr_wired_to];
      }
    }
    return this.stringifyAttributes(attributes);
  };
  tools.buildLabelAttributes = function(data){
    var attribute_names, attributes, attr_name, attr_wired_to;
    attribute_names = {
      "for": "for"
    };
    attributes = {};
    for (attr_name in attribute_names) {
      attr_wired_to = attribute_names[attr_name];
      if (data[attr_wired_to]) {
        attributes[attr_name] = data[attr_wired_to];
      }
    }
    return this.stringifyAttributes(attributes);
  };
  tools.stringifyAttributes = function(hash){
    var string, attr_name, attr_value;
    string = '';
    for (attr_name in hash) {
      attr_value = hash[attr_name];
      string += attr_name + "=\"" + attr_value + "\" ";
    }
    return string.trim();
  };
  tools.htmlLabelify = function(string){
    return string.replace(/_/g, " ");
  };
  tools.slugify = function(string){
    if (typeof string === "string") {
      string = string.replace(/\s|_/, "-");
    }
    return string;
  };
  tools.unslugify = function(string){
    return string.replace(/_/g, " ");
  };
  tools.cssClassify = function(string){
    return string.toLowerCase().replace(/\s|_/g, "-");
  };
  tools.maybeAttribute = function(attr, value){
    if (value) {
      return attr + "=\"" + value + "\" ";
    } else {
      return '';
    }
  };
  tools.getFieldTypeForModelType = function(field_type){
    switch (field_type) {
    case Boolean:
      return "checkbox";
    case String:
      return "text";
    default:
      return "text";
    }
  };
  tools.filterAttributes = function(data, lang_code){
    var d_name, d_value;
    for (d_name in data) {
      d_value = data[d_name];
      if (data.blueprint_part.filters[d_name]) {
        data[d_name] = data.blueprint_part.filters[d_name](d_value, data, lang_code) || d_value;
      }
    }
    return data;
  };
  tools.createSchemaField = function(name, blueprint_part){
    return blueprint_part;
  };
  tools._i = function(word, field_name, sans_markup){
    sans_markup == null && (sans_markup = false);
    if (sets._i_index[String(word).toLowerCase()]) {
      if (sans_markup) {
        return {
          "en": sets._i_index[String(word).toLowerCase()]['en'],
          "fr-CA": sets._i_index[String(word).toLowerCase()]['fr-CA']
        };
      } else {
        return "<div class=\"localized-content localized-" + (field_name != null ? field_name : '') + "\">\n    <span class=\"localized localized-en\">" + sets._i_index[String(word).toLowerCase()]["en"] + "</span>\n    <span class=\"localized localized-fr-CA\">" + sets._i_index[String(word).toLowerCase()]["fr-CA"] + "</span>\n</div>";
      }
    } else {
      return word;
    }
  };
  module.exports = tools;
}).call(this);
}, "controllers/admin": function(exports, require, module) {(function() {
  var AdminController;
  var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) {
    for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
    function ctor() { this.constructor = child; }
    ctor.prototype = parent.prototype;
    child.prototype = new ctor;
    child.__super__ = parent.prototype;
    return child;
  };
  AdminController = (function() {
    __extends(AdminController, Backbone.Controller);
    function AdminController() {
      this.updatePost = __bind(this.updatePost, this);
      this.createPost = __bind(this.createPost, this);
      this.listPosts = __bind(this.listPosts, this);
      this.updateTeamMember = __bind(this.updateTeamMember, this);
      this.createTeamMember = __bind(this.createTeamMember, this);
      this.manageTeam = __bind(this.manageTeam, this);
      AdminController.__super__.constructor.apply(this, arguments);
    }
    AdminController.prototype.routes = {
      "/list/posts": "listPosts",
      "/create/post/:branch_name": "createPost",
      "/update/post/:id": "updatePost",
      "/manage/team": "manageTeam",
      "/create/team-member": "createTeamMember",
      "/update/team-member/:id": "updateTeamMember"
    };
    AdminController.prototype.initialize = function() {
      return this.container = $("#page-content");
    };
    AdminController.prototype.manageTeam = function() {
      var view;
      view = new (require("views/admin/admin_table"))({
        collection: app.collections.team,
        redirect_url: "/manage/team",
        content: {
          table_label: "Team Members",
          row_url_base: "#/update/team-member/",
          column_names: {
            "name": "name",
            "email": "email"
          }
        }
      });
      return this.container.html(view.render().el);
    };
    AdminController.prototype.createTeamMember = function() {
      var view;
      view = new (require("views/admin/crud_team"))({
        form_fields: content.forms.team_member,
        collection: app.collections.team,
        type: "create",
        redirect_url: "/manage/team"
      });
      return this.container.html(view.render().el);
    };
    AdminController.prototype.updateTeamMember = function(id) {
      var view;
      view = new (require("views/admin/crud_team"))({
        form_fields: content.forms.team_member,
        model: app.collections.team.get(id),
        type: "update",
        redirect_url: "/manage/team"
      });
      return this.container.html(view.render().el);
    };
    AdminController.prototype.listPosts = function() {
      var view;
      view = new (require("views/posts_list"))({
        collection: app.collections.posts,
        table_constructor: require("views/admin/table_branch")
      });
      return this.container.html(view.render().el);
    };
    AdminController.prototype.createPost = function(branch_name) {
      var view;
      view = new (require("views/admin/crud_post"))({
        branch_name: branch_name,
        type: "create",
        form_fields: content.forms[branch_name],
        collection: app.collections.posts,
        redirect_url: "/list/posts"
      });
      this.container.html(view.render().el);
      return setupMultisection_fields();
    };
    AdminController.prototype.updatePost = function(id) {
      var model, view;
      model = app.collections.posts.get(id);
      view = new (require("views/admin/crud_post"))({
        model: model,
        type: "update",
        form_fields: content.forms[model.get("branch")],
        branch_name: model.get("branch"),
        redirect_url: "/list/posts"
      });
      this.container.html(view.render().el);
      return setupMultisection_fields();
    };
    return AdminController;
  })();
  module.exports = AdminController;
}).call(this);
}, "controllers/client": function(exports, require, module) {(function() {
  var MainController;
  var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) {
    for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
    function ctor() { this.constructor = child; }
    ctor.prototype = parent.prototype;
    child.prototype = new ctor;
    child.__super__ = parent.prototype;
    return child;
  };
  MainController = (function() {
    __extends(MainController, Backbone.Controller);
    function MainController() {
      this.onViewMenuClick = __bind(this.onViewMenuClick, this);
      this.onBranchMenuClick = __bind(this.onBranchMenuClick, this);
      this.home = __bind(this.home, this);
      MainController.__super__.constructor.apply(this, arguments);
    }
    MainController.prototype.updateBodyClass = function() {
      return $(document.body).removeClass(content.sets.locations.join(" ")).addClass(this.current_view_name);
    };
    MainController.prototype.home_is_rendered = false;
    MainController.prototype.current_view_name = "";
    MainController.prototype.last_home_view = "storyboard";
    MainController.prototype.routes = {
      "/home": "lastHomeView",
      "/home/:view": "home",
      "/home/:table": "table",
      "/post/:id": "post",
      "/about": "about",
      "/about/:pageanchor": "about"
    };
    MainController.prototype.lastHomeView = function() {
      return window.location.hash = "/home/" + this.last_home_view;
    };
    MainController.prototype.onRoute = function() {
      var $header, h, _ref;
      $header = $(".site-header");
      $header.find("img").load(function(e) {
        var h;
        h = $header.outerHeight();
        return $(document.body).css("paddingTop", h);
      });
      h = $header.outerHeight();
      $(document.body).css("paddingTop", h);
      if (!this.current_view_name.has("home")) {
        if ((_ref = app.views.nexus) != null) {
          _ref.untrackMenu("all");
        }
        this.trackBranchMenu();
        return this.trackViewMenu();
      } else if (this.current_view_name.has("home") && this.current_view_name.has("table")) {
        this.untrackBranchMenu();
        this.untrackViewMenu();
        return app.views.nexus.trackMenu("table");
      } else if (this.current_view_name.has("home") && this.current_view_name.has("storyboard")) {
        this.untrackBranchMenu();
        this.untrackViewMenu();
        return app.views.nexus.trackMenu("storyboard");
      }
    };
    MainController.prototype.viewChange = function(to_view_name) {
      this.current_view_name = to_view_name;
      $(document.body).attr("data-location", this.current_view_name);
      if (!/home/.test(this.current_view_name)) {
        this.home_is_rendered = false;
        app.menus.canvas_filter_menu.radioTo(".menu-item-all");
      }
      return this.updateBodyClass();
    };
    MainController.prototype.post = function(id) {
      var sought_model, title, view;
      this.viewChange("post");
      sought_model = app.collections.posts.get(id);
      view = new (require("views/site/single"))({
        model: sought_model,
        el: $("#page-content")
      });
      view.render();
      this.onRoute();
      try {
        title = view.model.attributes.title[(current_language === "en" ? 0 : 1)].raw;
      } catch (error) {
        title = '';
      }
      document.title = "Kanva > " + title;
      return $(window).scrollTop(0);
    };
    MainController.prototype.about = function(page_anchor) {
      var t;
      document.title = "Kanva > " + (_i("About", "", true)[current_language]);
      this.viewChange("about");
      $("#page-content").html(app.views.about.render().el);
      if (page_anchor) {
        t = $("." + page_anchor + ":visible").position().top;
        $(window).scrollTop(t);
      } else {
        $(window).scrollTop(0);
      }
      return this.onRoute();
    };
    MainController.prototype.home = function(view) {
      var view_name;
      view_name = view === "table" ? "list" : view;
      document.title = "Kanva > " + (_i(view_name, "", true)[current_language]);
      app.menus.pages_menu.radioTo(".menu-item-home");
      this.viewChange([view, "home"].join(" "));
      this.last_home_view = view;
      app.menus.view_menu.radioTo(app.menus.view_menu.$el.find("[data-target=\"" + view + "\"]"));
      if (!this.home_is_rendered) {
        window.app.views.nexus = new (require("views/nexus"))({
          collection: app.collections.posts,
          default_view: this.last_home_view,
          el: $main_site_container
        });
        app.views.nexus.render();
      }
      app.views.nexus.viewChange(view);
      this.home_is_rendered = true;
      return this.onRoute();
    };
    MainController.prototype.trackBranchMenu = function() {
      return app.menus.canvas_filter_menu.$menu_items.bind("click", this.onBranchMenuClick);
    };
    MainController.prototype.untrackBranchMenu = function() {
      return app.menus.canvas_filter_menu.$menu_items.unbind("click", this.onBranchMenuClick);
    };
    MainController.prototype.trackViewMenu = function() {
      return app.menus.view_menu.$menu_items.bind("click", this.onViewMenuClick);
    };
    MainController.prototype.untrackViewMenu = function() {
      return app.menus.view_menu.$menu_items.unbind("click", this.onViewMenuClick);
    };
    MainController.prototype.onBranchMenuClick = function(e) {
      var to_branch, to_mode;
      to_branch = $(e.currentTarget).data("target");
      to_mode = app.menus.view_menu.$menu_items.filter(".on").data("target");
      if (to_branch === "all") {
        to_mode = "storyboard";
      }
      to_mode = "storyboard";
      return window.location.hash = "/home/" + to_mode;
    };
    MainController.prototype.onViewMenuClick = function(e) {
      var to_mode;
      to_mode = app.menus.view_menu.$menu_items.filter(".on").data("target");
      return window.location.hash = "/home/" + to_mode;
    };
    return MainController;
  })();
  module.exports = MainController;
}).call(this);
}, "flickrnode/auth": function(exports, require, module) {var Auth= function Auth(request) {
    this._request= request;
};

Auth.prototype.getFrob= function(callback) {
    this._request.executeRequest("flickr.auth.getFrob",
                                       {}, true, function(res) { return res._content; }, callback);
};

Auth.prototype.getToken= function(frob, callback) {
   this._request.executeRequest("flickr.auth.getToken",
                                      {"frob":frob}, true, function(res) {
                                           return {
                                              "token": res.token._content,
                                              "perms": res.perms._content,
                                              "user": res.user
                                           };
                                       }, callback);
};

exports.Auth= Auth;}, "flickrnode/blogs": function(exports, require, module) {var Blogs= function Blogs(request) {
    this._request= request;
};
Blogs.prototype.getList= function(callback) {
    this._request.executeRequest("flickr.blogs.getList",
                                 {}, true, null, callback);
};

exports.Blogs = Blogs;}, "flickrnode/contacts": function(exports, require, module) {var Contacts= function Contacts(request) {
    this._request= request;
};

/* Takes optional arguments:
 * page  - Current Page.
 * per_page - Number of records per page
 */
Contacts.prototype.getPublicList= function(user_id, optional_arguments, callback) {
    var arguments=  {"user_id": user_id};
    optional_arguments = optional_arguments || {};
    for(var key in optional_arguments) arguments[key]= optional_arguments[key];
    
    this._request.executeRequest("flickr.contacts.getPublicList",
                                       arguments, false, null, callback );
};

exports.Contacts = Contacts;}, "flickrnode/feeds": function(exports, require, module) {var Feeds= function Feeds(request) {
    this._request= request;
};
Feeds.prototype.photosComments= function(user_id, lang, callback) {
    var arguments=  {"user_id": user_id};
    if( lang ) arguments.lang= lang;
    
    this._request.executeRequest("photos_comments.gne",
                                       arguments, false, null, callback);
};

exports.Feeds = Feeds;}, "flickrnode/flickr": function(exports, require, module) {exports.FlickrAPI = require("./flickrapi").FlickrAPI;
}, "flickrnode/flickrapi": function(exports, require, module) {var Request= require("./request").Request,
    Auth= require("./auth").Auth,
    Blogs= require("./blogs").Blogs,
    People= require("./people").People,
    Photos= require("./photos").Photos,
    Photosets= require("./photosets").Photosets,
    Contacts= require("./contacts").Contacts,
    Feeds= require("./feeds").Feeds,
    Urls= require("./urls").Urls;

var FlickrAPI= function FlickrAPI(api_key, shared_secret, auth_token) {
    this._configure(api_key, shared_secret, auth_token);
};

FlickrAPI.prototype._configure= function(api_key, shared_secret, auth_token) { 
    this.api_key= api_key;
    
    this._request= new Request(api_key, shared_secret, auth_token);
    
    this.people= new People(this._request);
    this.photos= new Photos(this._request);
    //console.log(new Photosets(this._request).getList)
    this.photosets= new Photosets(this._request);
    this.auth= new Auth(this._request);
    this.blogs= new Blogs(this._request);
    this.contacts= new Contacts(this._request);
    this.urls= new Urls(this._request);

    this._feedRequest= new Request(api_key, shared_secret, auth_token, true);
    this.feeds= new Feeds(this._feedRequest);
};
    
FlickrAPI.prototype.setAuthenticationToken= function(auth_token) {
   this._request.setAuthenticationToken(auth_token);
   this._feedRequest.setAuthenticationToken(auth_token);
};

FlickrAPI.prototype.getLoginUrl= function(permissions, frob, callback) {
    if( frob ) {
         var sig= this._request.generateSignature(this.shared_secret, {
                                    "api_key": this.api_key, 
                                    "perms": permissions,
                                    "frob":frob
                                    });
        callback(null, "http://flickr.com/services/auth/?api_key="+this.api_key+"&perms="+permissions+"&frob="+frob+"&api_sig="+ sig, frob);
    } else {     
        var self= this;
        this.auth.getFrob(function(err, frob) {
            if( err ) {
                callback(err);
            } else {
                 var sig= self._request.generateSignature(self.shared_secret, {
                                            "api_key": self.api_key, 
                                            "perms": permissions,
                                            "frob":frob
                                            });
                callback(null, "http://flickr.com/services/auth/?api_key="+self.api_key+"&perms="+permissions+"&frob="+frob+"&api_sig="+ sig, frob)
            }
        });
    }
};


exports.FlickrAPI = FlickrAPI;
}, "flickrnode/md5": function(exports, require, module) {/*
 * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message
 * Digest Algorithm, as defined in RFC 1321.
 * Version 2.2 Copyright (C) Paul Johnston 1999 - 2009
 * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
 * Distributed under the BSD License
 * See http://pajhome.org.uk/crypt/md5 for more info.
 */

/*
 * Configurable variables. You may need to tweak these to be compatible with
 * the server-side, but the defaults work in most cases.
 */
var hexcase = 0;   /* hex output format. 0 - lowercase; 1 - uppercase        */
var b64pad  = "";  /* base-64 pad character. "=" for strict RFC compliance   */

/*
 * These are the functions you'll usually want to call
 * They take string arguments and return either hex or base-64 encoded strings
 */
function hex_md5(s)    { return rstr2hex(rstr_md5(str2rstr_utf8(s))); }
function b64_md5(s)    { return rstr2b64(rstr_md5(str2rstr_utf8(s))); }
function any_md5(s, e) { return rstr2any(rstr_md5(str2rstr_utf8(s)), e); }
function hex_hmac_md5(k, d)
  { return rstr2hex(rstr_hmac_md5(str2rstr_utf8(k), str2rstr_utf8(d))); }
function b64_hmac_md5(k, d)
  { return rstr2b64(rstr_hmac_md5(str2rstr_utf8(k), str2rstr_utf8(d))); }
function any_hmac_md5(k, d, e)
  { return rstr2any(rstr_hmac_md5(str2rstr_utf8(k), str2rstr_utf8(d)), e); }

exports.md5 = function (s)    { return rstr2hex(rstr_md5(s)); }

/*
 * Perform a simple self-test to see if the VM is working
 */
function md5_vm_test()
{
  return hex_md5("abc").toLowerCase() == "900150983cd24fb0d6963f7d28e17f72";
}

/*
 * Calculate the MD5 of a raw string
 */
function rstr_md5(s)
{
  return binl2rstr(binl_md5(rstr2binl(s), s.length * 8));
}

/*
 * Calculate the HMAC-MD5, of a key and some data (raw strings)
 */
function rstr_hmac_md5(key, data)
{
  var bkey = rstr2binl(key);
  if(bkey.length > 16) bkey = binl_md5(bkey, key.length * 8);

  var ipad = Array(16), opad = Array(16);
  for(var i = 0; i < 16; i++)
  {
    ipad[i] = bkey[i] ^ 0x36363636;
    opad[i] = bkey[i] ^ 0x5C5C5C5C;
  }

  var hash = binl_md5(ipad.concat(rstr2binl(data)), 512 + data.length * 8);
  return binl2rstr(binl_md5(opad.concat(hash), 512 + 128));
}

/*
 * Convert a raw string to a hex string
 */
function rstr2hex(input)
{
  try { hexcase } catch(e) { hexcase=0; }
  var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef";
  var output = "";
  var x;
  for(var i = 0; i < input.length; i++)
  {
    x = input.charCodeAt(i);
    output += hex_tab.charAt((x >>> 4) & 0x0F)
           +  hex_tab.charAt( x        & 0x0F);
  }
  return output;
}

/*
 * Convert a raw string to a base-64 string
 */
function rstr2b64(input)
{
  try { b64pad } catch(e) { b64pad=''; }
  var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
  var output = "";
  var len = input.length;
  for(var i = 0; i < len; i += 3)
  {
    var triplet = (input.charCodeAt(i) << 16)
                | (i + 1 < len ? input.charCodeAt(i+1) << 8 : 0)
                | (i + 2 < len ? input.charCodeAt(i+2)      : 0);
    for(var j = 0; j < 4; j++)
    {
      if(i * 8 + j * 6 > input.length * 8) output += b64pad;
      else output += tab.charAt((triplet >>> 6*(3-j)) & 0x3F);
    }
  }
  return output;
}

/*
 * Convert a raw string to an arbitrary string encoding
 */
function rstr2any(input, encoding)
{
  var divisor = encoding.length;
  var i, j, q, x, quotient;

  /* Convert to an array of 16-bit big-endian values, forming the dividend */
  var dividend = Array(Math.ceil(input.length / 2));
  for(i = 0; i < dividend.length; i++)
  {
    dividend[i] = (input.charCodeAt(i * 2) << 8) | input.charCodeAt(i * 2 + 1);
  }

  /*
   * Repeatedly perform a long division. The binary array forms the dividend,
   * the length of the encoding is the divisor. Once computed, the quotient
   * forms the dividend for the next step. All remainders are stored for later
   * use.
   */
  var full_length = Math.ceil(input.length * 8 /
                                    (Math.log(encoding.length) / Math.log(2)));
  var remainders = Array(full_length);
  for(j = 0; j < full_length; j++)
  {
    quotient = Array();
    x = 0;
    for(i = 0; i < dividend.length; i++)
    {
      x = (x << 16) + dividend[i];
      q = Math.floor(x / divisor);
      x -= q * divisor;
      if(quotient.length > 0 || q > 0)
        quotient[quotient.length] = q;
    }
    remainders[j] = x;
    dividend = quotient;
  }

  /* Convert the remainders to the output string */
  var output = "";
  for(i = remainders.length - 1; i >= 0; i--)
    output += encoding.charAt(remainders[i]);

  return output;
}

/*
 * Encode a string as utf-8.
 * For efficiency, this assumes the input is valid utf-16.
 */
function str2rstr_utf8(input)
{
  var output = "";
  var i = -1;
  var x, y;

  while(++i < input.length)
  {
    /* Decode utf-16 surrogate pairs */
    x = input.charCodeAt(i);
    y = i + 1 < input.length ? input.charCodeAt(i + 1) : 0;
    if(0xD800 <= x && x <= 0xDBFF && 0xDC00 <= y && y <= 0xDFFF)
    {
      x = 0x10000 + ((x & 0x03FF) << 10) + (y & 0x03FF);
      i++;
    }

    /* Encode output as utf-8 */
    if(x <= 0x7F)
      output += String.fromCharCode(x);
    else if(x <= 0x7FF)
      output += String.fromCharCode(0xC0 | ((x >>> 6 ) & 0x1F),
                                    0x80 | ( x         & 0x3F));
    else if(x <= 0xFFFF)
      output += String.fromCharCode(0xE0 | ((x >>> 12) & 0x0F),
                                    0x80 | ((x >>> 6 ) & 0x3F),
                                    0x80 | ( x         & 0x3F));
    else if(x <= 0x1FFFFF)
      output += String.fromCharCode(0xF0 | ((x >>> 18) & 0x07),
                                    0x80 | ((x >>> 12) & 0x3F),
                                    0x80 | ((x >>> 6 ) & 0x3F),
                                    0x80 | ( x         & 0x3F));
  }
  return output;
}

/*
 * Encode a string as utf-16
 */
function str2rstr_utf16le(input)
{
  var output = "";
  for(var i = 0; i < input.length; i++)
    output += String.fromCharCode( input.charCodeAt(i)        & 0xFF,
                                  (input.charCodeAt(i) >>> 8) & 0xFF);
  return output;
}

function str2rstr_utf16be(input)
{
  var output = "";
  for(var i = 0; i < input.length; i++)
    output += String.fromCharCode((input.charCodeAt(i) >>> 8) & 0xFF,
                                   input.charCodeAt(i)        & 0xFF);
  return output;
}

/*
 * Convert a raw string to an array of little-endian words
 * Characters >255 have their high-byte silently ignored.
 */
function rstr2binl(input)
{
  var output = Array(input.length >> 2);
  for(var i = 0; i < output.length; i++)
    output[i] = 0;
  for(var i = 0; i < input.length * 8; i += 8)
    output[i>>5] |= (input.charCodeAt(i / 8) & 0xFF) << (i%32);
  return output;
}

/*
 * Convert an array of little-endian words to a string
 */
function binl2rstr(input)
{
  var output = "";
  for(var i = 0; i < input.length * 32; i += 8)
    output += String.fromCharCode((input[i>>5] >>> (i % 32)) & 0xFF);
  return output;
}

/*
 * Calculate the MD5 of an array of little-endian words, and a bit length.
 */
function binl_md5(x, len)
{
  /* append padding */
  x[len >> 5] |= 0x80 << ((len) % 32);
  x[(((len + 64) >>> 9) << 4) + 14] = len;

  var a =  1732584193;
  var b = -271733879;
  var c = -1732584194;
  var d =  271733878;

  for(var i = 0; i < x.length; i += 16)
  {
    var olda = a;
    var oldb = b;
    var oldc = c;
    var oldd = d;

    a = md5_ff(a, b, c, d, x[i+ 0], 7 , -680876936);
    d = md5_ff(d, a, b, c, x[i+ 1], 12, -389564586);
    c = md5_ff(c, d, a, b, x[i+ 2], 17,  606105819);
    b = md5_ff(b, c, d, a, x[i+ 3], 22, -1044525330);
    a = md5_ff(a, b, c, d, x[i+ 4], 7 , -176418897);
    d = md5_ff(d, a, b, c, x[i+ 5], 12,  1200080426);
    c = md5_ff(c, d, a, b, x[i+ 6], 17, -1473231341);
    b = md5_ff(b, c, d, a, x[i+ 7], 22, -45705983);
    a = md5_ff(a, b, c, d, x[i+ 8], 7 ,  1770035416);
    d = md5_ff(d, a, b, c, x[i+ 9], 12, -1958414417);
    c = md5_ff(c, d, a, b, x[i+10], 17, -42063);
    b = md5_ff(b, c, d, a, x[i+11], 22, -1990404162);
    a = md5_ff(a, b, c, d, x[i+12], 7 ,  1804603682);
    d = md5_ff(d, a, b, c, x[i+13], 12, -40341101);
    c = md5_ff(c, d, a, b, x[i+14], 17, -1502002290);
    b = md5_ff(b, c, d, a, x[i+15], 22,  1236535329);

    a = md5_gg(a, b, c, d, x[i+ 1], 5 , -165796510);
    d = md5_gg(d, a, b, c, x[i+ 6], 9 , -1069501632);
    c = md5_gg(c, d, a, b, x[i+11], 14,  643717713);
    b = md5_gg(b, c, d, a, x[i+ 0], 20, -373897302);
    a = md5_gg(a, b, c, d, x[i+ 5], 5 , -701558691);
    d = md5_gg(d, a, b, c, x[i+10], 9 ,  38016083);
    c = md5_gg(c, d, a, b, x[i+15], 14, -660478335);
    b = md5_gg(b, c, d, a, x[i+ 4], 20, -405537848);
    a = md5_gg(a, b, c, d, x[i+ 9], 5 ,  568446438);
    d = md5_gg(d, a, b, c, x[i+14], 9 , -1019803690);
    c = md5_gg(c, d, a, b, x[i+ 3], 14, -187363961);
    b = md5_gg(b, c, d, a, x[i+ 8], 20,  1163531501);
    a = md5_gg(a, b, c, d, x[i+13], 5 , -1444681467);
    d = md5_gg(d, a, b, c, x[i+ 2], 9 , -51403784);
    c = md5_gg(c, d, a, b, x[i+ 7], 14,  1735328473);
    b = md5_gg(b, c, d, a, x[i+12], 20, -1926607734);

    a = md5_hh(a, b, c, d, x[i+ 5], 4 , -378558);
    d = md5_hh(d, a, b, c, x[i+ 8], 11, -2022574463);
    c = md5_hh(c, d, a, b, x[i+11], 16,  1839030562);
    b = md5_hh(b, c, d, a, x[i+14], 23, -35309556);
    a = md5_hh(a, b, c, d, x[i+ 1], 4 , -1530992060);
    d = md5_hh(d, a, b, c, x[i+ 4], 11,  1272893353);
    c = md5_hh(c, d, a, b, x[i+ 7], 16, -155497632);
    b = md5_hh(b, c, d, a, x[i+10], 23, -1094730640);
    a = md5_hh(a, b, c, d, x[i+13], 4 ,  681279174);
    d = md5_hh(d, a, b, c, x[i+ 0], 11, -358537222);
    c = md5_hh(c, d, a, b, x[i+ 3], 16, -722521979);
    b = md5_hh(b, c, d, a, x[i+ 6], 23,  76029189);
    a = md5_hh(a, b, c, d, x[i+ 9], 4 , -640364487);
    d = md5_hh(d, a, b, c, x[i+12], 11, -421815835);
    c = md5_hh(c, d, a, b, x[i+15], 16,  530742520);
    b = md5_hh(b, c, d, a, x[i+ 2], 23, -995338651);

    a = md5_ii(a, b, c, d, x[i+ 0], 6 , -198630844);
    d = md5_ii(d, a, b, c, x[i+ 7], 10,  1126891415);
    c = md5_ii(c, d, a, b, x[i+14], 15, -1416354905);
    b = md5_ii(b, c, d, a, x[i+ 5], 21, -57434055);
    a = md5_ii(a, b, c, d, x[i+12], 6 ,  1700485571);
    d = md5_ii(d, a, b, c, x[i+ 3], 10, -1894986606);
    c = md5_ii(c, d, a, b, x[i+10], 15, -1051523);
    b = md5_ii(b, c, d, a, x[i+ 1], 21, -2054922799);
    a = md5_ii(a, b, c, d, x[i+ 8], 6 ,  1873313359);
    d = md5_ii(d, a, b, c, x[i+15], 10, -30611744);
    c = md5_ii(c, d, a, b, x[i+ 6], 15, -1560198380);
    b = md5_ii(b, c, d, a, x[i+13], 21,  1309151649);
    a = md5_ii(a, b, c, d, x[i+ 4], 6 , -145523070);
    d = md5_ii(d, a, b, c, x[i+11], 10, -1120210379);
    c = md5_ii(c, d, a, b, x[i+ 2], 15,  718787259);
    b = md5_ii(b, c, d, a, x[i+ 9], 21, -343485551);

    a = safe_add(a, olda);
    b = safe_add(b, oldb);
    c = safe_add(c, oldc);
    d = safe_add(d, oldd);
  }
  return Array(a, b, c, d);
}

/*
 * These functions implement the four basic operations the algorithm uses.
 */
function md5_cmn(q, a, b, x, s, t)
{
  return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s),b);
}
function md5_ff(a, b, c, d, x, s, t)
{
  return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t);
}
function md5_gg(a, b, c, d, x, s, t)
{
  return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t);
}
function md5_hh(a, b, c, d, x, s, t)
{
  return md5_cmn(b ^ c ^ d, a, b, x, s, t);
}
function md5_ii(a, b, c, d, x, s, t)
{
  return md5_cmn(c ^ (b | (~d)), a, b, x, s, t);
}

/*
 * Add integers, wrapping at 2^32. This uses 16-bit operations internally
 * to work around bugs in some JS interpreters.
 */
function safe_add(x, y)
{
  var lsw = (x & 0xFFFF) + (y & 0xFFFF);
  var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
  return (msw << 16) | (lsw & 0xFFFF);
}

/*
 * Bitwise rotate a 32-bit number to the left.
 */
function bit_rol(num, cnt)
{
  return (num << cnt) | (num >>> (32 - cnt));
}
}, "flickrnode/people": function(exports, require, module) {var People= function People(request) {
    this._request= request;
};

People.prototype.findByUsername= function(username, callback){
      this._request.executeRequest("flickr.people.findByUsername",
                                         {"username": username}, false, null, callback);
};

exports.People= People;
}, "flickrnode/photos": function(exports, require, module) {var PhotoComments= require("./photos_comments").PhotosComments;

var Photos= function Photos(request) {
    this._request= request;
    this.comments= new PhotoComments(this._request);
};

Photos.prototype.getInfo= function(photo_id, secret, callback) {
    var arguments=  {"photo_id": photo_id};
    if( secret ) arguments.secret= secret;
    
    this._request.executeRequest("flickr.photos.getInfo", arguments, false, null, callback);
};

Photos.prototype.search= function(arguments, callback) {
    this._request.executeRequest("flickr.photos.search", arguments, false, null, callback);

};

exports.Photos= Photos;}, "flickrnode/photos_comments": function(exports, require, module) {var PhotosComments= function PhotosComments(request) {
    this._request= request;
};
//TODO: Test for  adate object and convert to millis in that case.
//if( min_comment_date !== undefined ) arguments.min_comment_date= min_comment_date;
//if( max_comment_date !== undefined ) arguments.max_comment_date= max_comment_date;

PhotosComments.prototype.getList= function(photo_id, optional_arguments, callback) {
    var arguments=  {"photo_id": photo_id};
    optional_arguments = optional_arguments || {};
    for(var key in optional_arguments) arguments[key]= optional_arguments[key];
    
    this._request.executeRequest("flickr.photos.comments.getList", arguments, false, null, callback);
};

exports.PhotosComments= PhotosComments;}, "flickrnode/photosets": function(exports, require, module) {var Photosets= function Photosets(request) {
    this._request= request;
};

Photosets.prototype.getInfo = function(photoset_id, callback) {
    this._request.executeRequest("flickr.photosets.getInfo",  {"photoset_id": photoset_id}, false, null, callback);
};

Photosets.prototype.getList= function(user_id, callback) {
   this._request.executeRequest("flickr.photosets.getList", {"user_id": user_id}, false, null, callback);
};

Photosets.prototype.getPhotos= function(photoset_id, optional_arguments, callback) {
    var arguments=  {"photoset_id": photoset_id};                      
    //TODO: Consider using a mixin here, but be ware I've messed around with the extras argument...
    if( optional_arguments.extras !== undefined && optional_arguments.extras.join !== undefined ) arguments.extras= optional_arguments.extras.join(",");
    if( optional_arguments.privacy_filter !== undefined ) arguments.privacy_filter= optional_arguments.privacy_filter;
    if( optional_arguments.per_page !== undefined ) arguments.per_page=optional_arguments. per_page;
    if( optional_arguments.page !== undefined ) arguments.page= optional_arguments.page;
    if( optional_arguments.media !== undefined ) arguments.media= optional_arguments.media;
    this._request.executeRequest("flickr.photosets.getPhotos", arguments, false, null, callback);
};

exports.Photosets= Photosets;
}, "flickrnode/request": function(exports, require, module) {var sys = require("sys"),
   http = require("http"),
   md5 = require('./md5');

var Request= function Request(api_key, shared_secret, auth_token, isFeedRequest) {
    this._configure(api_key, shared_secret, auth_token);
    this.isFeedRequest= false;
    if( isFeedRequest !== undefined ) this.isFeedRequest= isFeedRequest;  

    if( this.isFeedRequest ) {
        this.baseUrl= "/services/feeds";  
    }
    else {
        this.baseUrl= "/services/rest";  
    }
};

Request.prototype._configure= function(api_key, shared_secret, auth_token) {
    this.api_key= api_key;
    this.shared_secret= shared_secret;
    this.auth_token= auth_token;
};

Request.prototype.setAuthenticationToken= function(auth_token) {
    this._configure(this.api_key, this.shared_secret, auth_token);
};

Request.prototype.generateSignature= function(shared_secret, arguments) {
    var argument_pairs= [];
    for(var key in arguments ) {   
        argument_pairs[argument_pairs.length]= [key, arguments[key]];
    }
    
    argument_pairs.sort(function(a,b) {
        if ( a[0]== b[0] ) return 0 ;
        return a[0] < b[0] ? -1 : 1;  
    });
    var args= "";
    for(var i=0;i<argument_pairs.length;i++) {
        args+= argument_pairs[i][0];
        args+= argument_pairs[i][1];
    }
    var sig= this.shared_secret+args;
    return md5.md5(sig);
};

Request.prototype.getHttpClient= function() {
    return http.createClient(80, "api.flickr.com");
};

Request.prototype.executeRequest= function(method, arguments, sign_it, result_mapper, callback) {
    var argumentString = "";
    var api_sig= undefined;
    if( arguments === undefined )  arguments = {};

    // apply default arguments 
    arguments.format= "json";
    arguments.nojsoncallback= "1";

    if( this.isFeedRequest ) {
        argumentString= "/"+ method;
    }
    else {
        arguments.api_key= this.api_key;
        arguments["method"]= method;
        if( this.auth_token ) arguments.auth_token= this.auth_token;
    
        if( this.shared_secret && (sign_it || this.auth_token) ) {
            api_sig= this.generateSignature(this.shared_secret, arguments);
            if( api_sig ) {
                arguments.api_sig= api_sig;
            }
        }
    }
    var operator= "?";
    for(var key in arguments) {
        argumentString+= (operator + key + "=" + arguments[key]);
        if( operator == "?" ) operator= "&";
    }
   
    var request= this.getHttpClient().request("GET", 
                          this.baseUrl+ argumentString, 
                          {"host": "api.flickr.com"});
    var isFeedRequest= this.isFeedRequest;          
    request.addListener('response', function (response) {
        var result= "";
        response.setEncoding("utf8");
        response.addListener("data", function (chunk) {
          result+= chunk;
        });
        response.addListener("end", function () {   
            // Bizarrely Flickr seems to send back invalid JSON (it escapes single quotes in certain circumstances?!?!!?)
            // We fix that here.
            if( result ) {  
                result= result.replace(/\\'/g,"'");
            }
            if( isFeedRequest ) {
                var m;
                if(!result || (m= result.match(/[\S\s]+We were unable to generate the feed you requested, for the following reason:<\/p>\s*?<p[\S\s]+?>([\S\s]+?)<\/p>[\S\s]+/) ) ) {
                    var  errorString= m[1].replace(/^\s+/,"");
                    errorString= errorString.replace(/\s+$/, "");
                    callback({code: -1, message: errorString});
                }
                else {
                    var res= JSON.parse(result);
                    if( result_mapper ) {
                        res= result_mapper(res);
                    }
                    callback(null, res);
                }
            } 
            else {
                var res= JSON.parse(result);
                if( res.stat && res.stat == "ok" ) {
                    // Munge the response to strip out the stat and just return the response value
                    for(var key in res) {
                        if( key !== "stat" ) {
                            res= res[key];
                        }
                    }
                    if( result_mapper ) {
                        res= result_mapper(res);
                    }
                    callback(null, res);
                } 
                else {
                    callback({code: res.code, message: res.message});
                }
            }
        });
    });       
    request.end();
};

exports.Request = Request;}, "flickrnode/urls": function(exports, require, module) {var Urls= function Urls(request) {
    this._request= request;
};

Urls.prototype.lookupUser= function(url, callback) {
    return this._request.executeRequest("flickr.urls.lookupUser",  {"url": url}, false, null, callback);
};

exports.Urls= Urls;}, "language_switcher": function(exports, require, module) {(function() {
  var $body, default_language, switcher;
  default_language = $.cookie("lang") || "fr-CA";
  switcher = $("#language-switcher");
  $body = $(document.body);
  switcher.click(function(e) {
    var current_language;
    if (!$body.hasClass('en') && !$body.hasClass('fr-CA')) {
      $body.addClass(default_language);
    } else {
      $body.toggleClass("en fr-CA");
    }
    current_language = $body.hasClass('en') ? "en" : "fr-CA";
    window.current_language = current_language;
    $.cookie("lang", current_language);
    return false;
  });
  switcher.trigger("click");
}).call(this);
}, "legend_segments_waypoints": function(exports, require, module) {(function() {
  var LegendSegmentsWaypoints;
  var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
  LegendSegmentsWaypoints = (function() {
    function LegendSegmentsWaypoints(config) {
      this.onMenuWaypointStart = __bind(this.onMenuWaypointStart, this);
      this.onMenuWaypointEnd = __bind(this.onMenuWaypointEnd, this);
      this.onScrolltoSegment = __bind(this.onScrolltoSegment, this);
      this.onAfterJumptoSegment = __bind(this.onAfterJumptoSegment, this);
      this.onJumptoSegment = __bind(this.onJumptoSegment, this);
      var _ref, _ref2, _ref3, _ref4, _ref5, _ref6;
      this.$end_el = config.end_el;
      this.$start_el = config.start_el;
      this.$segments = config.segments;
      this.$menu_container = config.menu_container;
      this.$menu_items = config.menu_items || this.$menu_container.find("li");
      this.attr_references = {
        segment_name: ((_ref = config.attr_references) != null ? _ref.segment_name : void 0) || "data-segment",
        menu_item_segment: ((_ref2 = config.attr_references) != null ? _ref2.menu_item_segment : void 0) || "data-segment"
      };
      this.am_jumping = false;
      this.jumpto_options = config.jumpto_options || {};
      _(this.jumpto_options).defaults({
        onAfter: this.onAfterJumptoSegment
      });
      this.jumpto_speed = config.jumpto_speed || 400;
      this.segmentSelector = config.segmentSelector || function(segment_name) {
        return " *[" + this.attr_references.segment_name + "=\"" + segment_name + "\"] ";
      };
      this.css_menu_classes = {
        container: ((_ref3 = config.css_menu_classes) != null ? _ref3.container : void 0) || "legend-for-segments",
        on: "on",
        off: "off"
      };
      this.css_waypoint_classes = {
        end: "sticky-end",
        start: "sticky-start",
        inbetween: "sticky-inbetween"
      };
      this.$menu_container.addClass(this.css_menu_classes.container);
      this.waypoint_options = {
        menu_start: ((_ref4 = config.waypoint_options) != null ? _ref4.menu_start : void 0) || {},
        menu_end: ((_ref5 = config.waypoint_options) != null ? _ref5.menu_end : void 0) || {
          offset: this.$menu_container.outerHeight()
        },
        segments: ((_ref6 = config.waypoint_options) != null ? _ref6.segments : void 0) || {}
      };
      this.current_segment = void 0;
      this.$current_segment = void 0;
      this.current_segment_index = void 0;
      this.$start_el.waypoint(this.onMenuWaypointStart, this.waypoint_options.menu_start);
      this.$end_el.waypoint(this.onMenuWaypointEnd, this.waypoint_options.menu_end);
      this.$segments.waypoint(this.onScrolltoSegment, this.waypoint_options.segments);
      this.$menu_items.click(this.onJumptoSegment);
    }
    LegendSegmentsWaypoints.prototype.onJumptoSegment = function(e) {
      var $t, target_segment_name;
      $t = $(e.currentTarget);
      target_segment_name = $t.attr(this.attr_references.menu_item_segment);
      this.am_jumping = true;
      return this.jumptoSegment(target_segment_name);
    };
    LegendSegmentsWaypoints.prototype.onAfterJumptoSegment = function(e) {
      return this.am_jumping = false;
    };
    LegendSegmentsWaypoints.prototype.onScrolltoSegment = function(e, dir) {
      var $target_segment;
      $target_segment = $(e.target);
      if (this.am_jumping) {
        return false;
      }
      if (e.target !== e.currentTarget) {
        return false;
      }
      if (dir === "up" && this.current_segment_index === 0) {
        return false;
      }
      if (dir === "up") {
        $target_segment = $(this.$segments[this.current_segment_index - 1]);
      }
      if (this.$current_segment && this.$current_segment.is($target_segment)) {
        return false;
      }
      return this.changeSegmentTo(this.getSegmentName($target_segment));
    };
    LegendSegmentsWaypoints.prototype.jumptoSegment = function(segment_name) {
      this.changeSegmentTo(segment_name);
      return $.scrollTo(this.$current_segment, this.jumpto_speed, this.jumpto_options);
    };
    LegendSegmentsWaypoints.prototype.changeSegmentTo = function(segment_name) {
      this.adjustMenuSelected(segment_name);
      this.current_segment = segment_name;
      this.$current_segment = this.getSegmentEl(segment_name);
      return this.current_segment_index = this.$segments.index(this.$current_segment);
    };
    LegendSegmentsWaypoints.prototype.adjustMenuSelected = function(segment_name) {
      var $newly_selected, $unselected, new_selector;
      this.$menu_items.removeClass("" + this.css_menu_classes.on + " " + this.css_menu_classes.off);
      new_selector = "[" + this.attr_references.menu_item_segment + "=\"" + segment_name + "\"]";
      $newly_selected = this.$menu_items.filter(new_selector);
      $newly_selected.addClass(this.css_menu_classes.on);
      $unselected = this.$menu_items.filter(":not(" + new_selector + ")");
      return $unselected.addClass(this.css_menu_classes.off);
    };
    LegendSegmentsWaypoints.prototype.adjustMenuClass = function(to) {
      var to_add, to_remove;
      to_remove = _.values(_(this.css_waypoint_classes).reject(function(css_class) {
        return css_class === to;
      }));
      to_remove = to_remove.join(" ");
      to_add = this.css_waypoint_classes[to];
      return this.$menu_container.removeClass(to_remove).addClass(to_add);
    };
    LegendSegmentsWaypoints.prototype.getSegmentEl = function(segment_name) {
      return this.$segments.filter(this.segmentSelector(segment_name));
    };
    LegendSegmentsWaypoints.prototype.getSegmentName = function($segment) {
      return $segment.attr(this.attr_references.segment_name);
    };
    LegendSegmentsWaypoints.prototype.onMenuWaypointEnd = function(e, dir) {
      if (e.target === e.currentTarget) {
        switch (dir) {
          case "down":
            return this.adjustMenuClass("end");
          case "up":
            return this.adjustMenuClass("inbetween");
          default:
            throw "error direction is not down or up";
        }
      }
    };
    LegendSegmentsWaypoints.prototype.onMenuWaypointStart = function(e, dir) {
      if (e.target === e.currentTarget) {
        switch (dir) {
          case "down":
            return this.adjustMenuClass("inbetween");
          case "up":
            return this.adjustMenuClass("start");
          default:
            throw "error direction is not down or up";
        }
      }
    };
    LegendSegmentsWaypoints.prototype.destroy = function(include_container_class, include_button_classes) {
      if (include_container_class == null) {
        include_container_class = true;
      }
      if (include_button_classes == null) {
        include_button_classes = false;
      }
      this.$menu_items.unbind("click", this.onJumptoSegment);
      this.$start_el.waypoint('destroy');
      this.$end_el.waypoint('destroy');
      this.$segments.waypoint('destroy');
      if (include_button_classes) {
        0000;
      }
      if (include_container_class) {
        return this.$menu_container.removeClass(this.css_menu_classes.container);
      }
    };
    return LegendSegmentsWaypoints;
  })();
  module.exports = LegendSegmentsWaypoints;
}).call(this);
}, "main": function(exports, require, module) {(function() {
  require("bootstrap_parts");
  $(document).ready(function() {
    require("./bootstrap_content");
    require("language_switcher");
    app.collections.posts.invoke("setComputed");
    window.$main_site_container = $("#page-content")[0];
    window.wp = require("waypoints");
    app.controllers.main = new (require("controllers/client"));
    app.views.about = new (require("views/site/about"))({
      el: $main_site_container
    });
    app.views.site_footer = new (require("views/site/footer"))({
      collection: app.collections.team
    });
    $(document.body).append(app.views.site_footer.render().el);
    app.menus = {};
    app.menus.pages_menu = new (require("views/menus/radio_menu"))({
      model: new (require("models/menu_items"))({
        name: "pages",
        menu_items: ["home", "about"],
        url_function: function(menu_item) {
          return "/#/" + menu_item.slug;
        }
      })
    });
    app.menus.view_menu = new (require("views/menus/radio_menu"))({
      model: new (require("models/menu_items"))({
        name: "view",
        menu_items: [
          "storyboard", {
            slug: "table",
            label: "list",
            attributes: {
              "data-target": "table"
            },
            className: "menu-item menu-item-table"
          }
        ]
      })
    });
    app.menus.canvas_filter_menu = new (require("views/menus/radio_filter_menu"))({
      model: new (require("models/menu_items"))({
        menu_items: content.sets.branches,
        name: "box-list-filter"
      })
    });
    $(".site-header .primary-navigation").append(app.menus.pages_menu.render().el).append(app.menus.canvas_filter_menu.render().el).append(app.menus.view_menu.render().el);
    if (Backbone.history.getFragment() === '') {
      Backbone.history.saveLocation("/home/storyboard");
    }
    Backbone.history.start();
    if ($(document.body).data("location") === "about") {
      return app.menus.pages_menu.radioTo(".menu-item-about");
    }
  });
}).call(this);
}, "models/menu_items": function(exports, require, module) {(function() {
  var MenuItems;
  var __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) {
    for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
    function ctor() { this.constructor = child; }
    ctor.prototype = parent.prototype;
    child.prototype = new ctor;
    child.__super__ = parent.prototype;
    return child;
  }, __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
  MenuItems = (function() {
    __extends(MenuItems, Backbone.Model);
    function MenuItems() {
      MenuItems.__super__.constructor.apply(this, arguments);
    }
    MenuItems.prototype.initialize = function(options) {
      return this.createMenuItemObjects(this.get("menu_items"));
    };
    MenuItems.prototype.defaults = {
      url_target: false
    };
    MenuItems.prototype.createMenuItemObjects = function(menu_items) {
      var createMenuItemObject, menu_item_name;
      createMenuItemObject = __bind(function(config) {
        var menu_item, slug, _base;
        if (typeof config.name === "string") {
          slug = config.name.replace(/_|\s/, "-");
          menu_item = {
            label: config.name,
            slug: slug,
            attributes: {
              "data-target": slug
            },
            className: " menu-item menu-item-" + config.name + " "
          };
          menu_item.url_target = typeof (_base = this.get("url_function")) === "function" ? _base(menu_item) : void 0;
          return _.defaults(menu_item, this.defaults);
        } else {
          return _.defaults(config.name, this.defaults);
        }
      }, this);
      menu_items = (function() {
        var _i, _len, _results;
        _results = [];
        for (_i = 0, _len = menu_items.length; _i < _len; _i++) {
          menu_item_name = menu_items[_i];
          _results.push(createMenuItemObject({
            name: menu_item_name
          }));
        }
        return _results;
      })();
      return this.set({
        menu_items: menu_items
      });
    };
    return MenuItems;
  })();
  module.exports = MenuItems;
}).call(this);
}, "models/post": function(exports, require, module) {(function() {
  var Post;
  var __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) {
    for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
    function ctor() { this.constructor = child; }
    ctor.prototype = parent.prototype;
    child.prototype = new ctor;
    child.__super__ = parent.prototype;
    return child;
  };
  Post = (function() {
    __extends(Post, Backbone.Model);
    function Post() {
      Post.__super__.constructor.apply(this, arguments);
    }
    Post.prototype.urlRoot = "/posts";
    Post.prototype.initialize = function(attrs) {
      return this.id = this.attributes._id;
    };
    Post.prototype.dateAbbreviated = function(date) {
      return "" + (date.getFullYear()) + " - " + (date.getMonth()) + " - " + (date.getDate());
    };
    Post.prototype.setComputed = function() {
      var flickr_set, primary_photo, primary_photo_id;
      if (this.get("flickr_set_id")) {
        flickr_set = this.get("flickr_set");
        primary_photo_id = flickr_set.primary;
        primary_photo = _.select(flickr_set.photo, function(photo) {
          return photo.id === primary_photo_id;
        });
        primary_photo = primary_photo[0];
      }
      this.set({
        primary_photo: primary_photo || false,
        primary_photo_url_l: (primary_photo != null ? primary_photo.url_l : void 0) || false
      });
      if (primary_photo) {
        this.set({
          primary_photo_orientation: primary_photo.height_o.toNumber() > primary_photo.width_o.toNumber() ? "portrait" : "landscape"
        });
      }
      return this.set({
        "date_published": this.dateAbbreviated(new Date(this.get("date_published")))
      });
    };
    return Post;
  })();
  module.exports = Post;
}).call(this);
}, "models/team_member": function(exports, require, module) {(function() {
  var TeamMember;
  var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) {
    for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
    function ctor() { this.constructor = child; }
    ctor.prototype = parent.prototype;
    child.prototype = new ctor;
    child.__super__ = parent.prototype;
    return child;
  };
  TeamMember = (function() {
    __extends(TeamMember, Backbone.Model);
    function TeamMember() {
      this.onNameChange = __bind(this.onNameChange, this);
      TeamMember.__super__.constructor.apply(this, arguments);
    }
    TeamMember.prototype.urlRoot = "/team-member";
    TeamMember.prototype.initialize = function(options) {
      this.bind("change:first_name", this.onNameChange);
      this.bind("change:last_name", this.onNameChange);
      this.id = this.get("_id");
      return this.setComputedFields();
    };
    TeamMember.prototype.setComputedFields = function() {
      return this.setName();
    };
    TeamMember.prototype.setName = function() {
      return this.set({
        "name": "" + (this.get("first_name")) + " " + (this.get("last_name"))
      });
    };
    TeamMember.prototype.onNameChange = function() {
      return this.setName();
    };
    return TeamMember;
  })();
  module.exports = TeamMember;
}).call(this);
}, "templates/about": function(exports, require, module) {module.exports = function anonymous(locals) {
var __ = { lineno: 1, input: "- var about = content.data.about\n.main-content\n    .team-members\n        - each member in team\n            -if(member.in_about)\n                .team-member\n                    -if(member.photo_url)\n                        img.portrait(src=member.photo_url, title=member.name)\n                        .details\n                            p.heading6!= member.name\n                            .jobtitle!= member.jobtitle[0].all_parsed\n                            .stats!= member.stats[0].all_parsed\n                        .education\n                            != member.education[0].all_parsed\n\n\n    -each lang_name,lc in content.sets.lang_labels\n        div(class=\"parts localized localized-#{lc}\")\n            .part-1.part.introduction\n                .contact-us\n                    header\n                        h1 Contact us\n                        -each member in team\n                            -if(member.first_name == \"office\")\n                                != member.stats[0].all_parsed\n                        ul.social.icon-links\n                            li\n                                a(href=\"http://www.linkedin.com/company/kanva\", target=\"_blank\")\n                                    img(src=\"/images/icons/dark/32/linkedin.png\")\n                            li\n                                a(href=\"http://www.facebook.com/pages/Kanva-Architecture/97050979639\", target=\"_blank\")\n                                    img(src=\"/images/icons/dark/32/facebook.png\")\n                            li\n                                a(href=\"https://twitter.com/#!/_Kanva\", target=\"_blank\")\n                                    img(src=\"/images/icons/dark/32/twitter.png\")\n\n                .who-we-are\n                    header\n                        h1!= about.who_we_are.title[lc]\n                    .content!= about.who_we_are.body[lc]\n\n\n            .part-2.part.qualifications\n                .content.client-list\n                    header\n                        h1!= about.client_list.title[lc]\n                    ul\n                        -each client in about.client_list.body[lc]\n                            li!= client\n                .our-expertise\n                    header\n                        h1!= about.our_expertise.title[lc]\n                    .content!= about.our_expertise.body[lc]\n\n            .part-3.part.architecture\n\n                .content.services-list\n                    header\n                        h1!= about.architecture.services.title[lc]\n                    ul\n                        -each service in about.architecture.services.body[lc]\n                            li!= service\n                .intro\n                    header\n                        h1!= about.architecture.title[lc]\n                    .content!= about.architecture.body[lc]\n\n            .part-4.part.management\n\n                .content.services-list\n                    header\n                        h1!= about.management.services.title[lc]\n                    ul\n                        -each service in about.management.services.body[lc]\n                            li!= service\n                .intro\n                    header\n                        h1!= about.management.title[lc]\n                    .content!= about.management.body[lc]\n\n            .part-5.part.resdev\n                .content.services-list\n                    header\n                        h1!= about.resdev.activities.title[lc]\n                    ul\n                        -each activity in about.resdev.activities.body[lc]\n                            li!= activity\n                .intro\n                    header\n                        h1!= about.resdev.title[lc]\n                    .content!= about.resdev.body[lc]\n\n\n\n\n\n            .part-6.part.in-the-press\n                header\n                    h1!= about.in_the_press.title[lc]\n                table.light-theme-table.active-table\n                    thead\n                        tr\n                            -each column_name in about.in_the_press.column_names\n                                th(class=\"#{column_name}-cell\")\n                                    != _i(column_name)\n                                    .sorted-graphic\n                    tbody\n                        -each row in about.in_the_press.body[lc]\n                            tr\n                                -each column_name in about.in_the_press.column_names\n                                    -if(column_name == \"link\" && row[column_name])\n                                        td: a(href=row[column_name], target=\"_blank\")!= window._i(\"Link\",lc)\n                                    -else\n                                        td!= row[column_name] || \"--\"\n\n\n\n", filename: undefined };
function rethrow(err, str, filename, lineno){
  var context = 3
    , lines = str.split('\n')
    , start = Math.max(lineno - context, 0)
    , end = Math.min(lines.length, lineno + context); 

  // Error context
  var context = lines.slice(start, end).map(function(line, i){
    var curr = i + start + 1;
    return (curr == lineno ? '  > ' : '    ')
      + curr
      + '| '
      + line;
  }).join('\n');

  // Alter exception message
  err.path = filename;
  err.message = (filename || 'Jade') + ':' + lineno 
    + '\n' + context + '\n\n' + err.message;
  throw err;
}
try {
function attrs(obj){
  var buf = []
    , terse = obj.terse;
  delete obj.terse;
  var keys = Object.keys(obj)
    , len = keys.length;
  if (len) {
    buf.push('');
    for (var i = 0; i < len; ++i) {
      var key = keys[i]
        , val = obj[key];
      if ('boolean' == typeof val || null == val) {
        if (val) {
          terse
            ? buf.push(key)
            : buf.push(key + '="' + key + '"');
        }
      } else if ('class' == key && Array.isArray(val)) {
        buf.push(key + '="' + escape(val.join(' ')) + '"');
      } else {
        buf.push(key + '="' + escape(val) + '"');
      }
    }
  }
  return buf.join(' ');
}

function escape(html){
  return String(html)
    .replace(/&(?!\w+;)/g, '&amp;')
    .replace(/</g, '&lt;')
    .replace(/>/g, '&gt;')
    .replace(/"/g, '&quot;');
}

var buf = [];
with (locals || {}) {__.lineno = 1;
__.lineno = 1;
 var about = content.data.about
__.lineno = 2;
buf.push('<div');
buf.push(attrs({ "class": ('main-content') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 3;
buf.push('<div');
buf.push(attrs({ "class": ('team-members') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 17;
// iterate team
(function(){
  if ('number' == typeof team.length) {
    for (var index = 0, $$l = team.length; index < $$l; index++) {
      var member = team[index];

__.lineno = 4;
__.lineno = 5;
if(member.in_about)
{
__.lineno = 6;
__.lineno = 6;
buf.push('<div');
buf.push(attrs({ "class": ('team-member') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 7;
if(member.photo_url)
{
__.lineno = 8;
__.lineno = 8;
buf.push('<img');
buf.push(attrs({ 'src':(member.photo_url), 'title':(member.name), "class": ('portrait') }));
buf.push('/>');
__.lineno = 9;
buf.push('<div');
buf.push(attrs({ "class": ('details') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 10;
buf.push('<p');
buf.push(attrs({ "class": ('heading6') }));
buf.push('>');
var __val__ = member.name
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</p>');
__.lineno = 11;
buf.push('<div');
buf.push(attrs({ "class": ('jobtitle') }));
buf.push('>');
var __val__ = member.jobtitle[0].all_parsed
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</div>');
__.lineno = 12;
buf.push('<div');
buf.push(attrs({ "class": ('stats') }));
buf.push('>');
var __val__ = member.stats[0].all_parsed
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</div>');
buf.push('</div>');
__.lineno = 13;
buf.push('<div');
buf.push(attrs({ "class": ('education') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 14;
var __val__ = member.education[0].all_parsed
buf.push(null == __val__ ? "" : __val__);
buf.push('</div>');
}
buf.push('</div>');
}
    }
  } else {
    for (var index in team) {
      var member = team[index];

__.lineno = 4;
__.lineno = 5;
if(member.in_about)
{
__.lineno = 6;
__.lineno = 6;
buf.push('<div');
buf.push(attrs({ "class": ('team-member') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 7;
if(member.photo_url)
{
__.lineno = 8;
__.lineno = 8;
buf.push('<img');
buf.push(attrs({ 'src':(member.photo_url), 'title':(member.name), "class": ('portrait') }));
buf.push('/>');
__.lineno = 9;
buf.push('<div');
buf.push(attrs({ "class": ('details') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 10;
buf.push('<p');
buf.push(attrs({ "class": ('heading6') }));
buf.push('>');
var __val__ = member.name
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</p>');
__.lineno = 11;
buf.push('<div');
buf.push(attrs({ "class": ('jobtitle') }));
buf.push('>');
var __val__ = member.jobtitle[0].all_parsed
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</div>');
__.lineno = 12;
buf.push('<div');
buf.push(attrs({ "class": ('stats') }));
buf.push('>');
var __val__ = member.stats[0].all_parsed
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</div>');
buf.push('</div>');
__.lineno = 13;
buf.push('<div');
buf.push(attrs({ "class": ('education') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 14;
var __val__ = member.education[0].all_parsed
buf.push(null == __val__ ? "" : __val__);
buf.push('</div>');
}
buf.push('</div>');
}
   }
  }
}).call(this);

buf.push('</div>');
__.lineno = 118;
// iterate content.sets.lang_labels
(function(){
  if ('number' == typeof content.sets.lang_labels.length) {
    for (var lc = 0, $$l = content.sets.lang_labels.length; lc < $$l; lc++) {
      var lang_name = content.sets.lang_labels[lc];

__.lineno = 17;
__.lineno = 19;
buf.push('<div');
buf.push(attrs({ "class": ("parts localized localized-" + (lc) + "") }));
buf.push('>');
__.lineno = undefined;
__.lineno = 19;
buf.push('<div');
buf.push(attrs({ "class": ('part-1') + ' ' + ('part') + ' ' + ('introduction') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 20;
buf.push('<div');
buf.push(attrs({ "class": ('contact-us') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 22;
buf.push('<header>');
__.lineno = undefined;
__.lineno = 22;
buf.push('<h1>');
buf.push('Contact us');
__.lineno = undefined;
buf.push('</h1>');
__.lineno = 26;
// iterate team
(function(){
  if ('number' == typeof team.length) {
    for (var index = 0, $$l = team.length; index < $$l; index++) {
      var member = team[index];

__.lineno = 23;
__.lineno = 24;
if(member.first_name == "office")
{
__.lineno = 25;
__.lineno = 25;
var __val__ = member.stats[0].all_parsed
buf.push(null == __val__ ? "" : __val__);
}
    }
  } else {
    for (var index in team) {
      var member = team[index];

__.lineno = 23;
__.lineno = 24;
if(member.first_name == "office")
{
__.lineno = 25;
__.lineno = 25;
var __val__ = member.stats[0].all_parsed
buf.push(null == __val__ ? "" : __val__);
}
   }
  }
}).call(this);

__.lineno = 26;
buf.push('<ul');
buf.push(attrs({ "class": ('social') + ' ' + ('icon-links') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 28;
buf.push('<li>');
__.lineno = undefined;
__.lineno = 29;
buf.push('<a');
buf.push(attrs({ 'href':("http://www.linkedin.com/company/kanva"), 'target':("_blank") }));
buf.push('>');
__.lineno = undefined;
__.lineno = 30;
buf.push('<img');
buf.push(attrs({ 'src':("/images/icons/dark/32/linkedin.png") }));
buf.push('/>');
buf.push('</a>');
buf.push('</li>');
__.lineno = 31;
buf.push('<li>');
__.lineno = undefined;
__.lineno = 32;
buf.push('<a');
buf.push(attrs({ 'href':("http://www.facebook.com/pages/Kanva-Architecture/97050979639"), 'target':("_blank") }));
buf.push('>');
__.lineno = undefined;
__.lineno = 33;
buf.push('<img');
buf.push(attrs({ 'src':("/images/icons/dark/32/facebook.png") }));
buf.push('/>');
buf.push('</a>');
buf.push('</li>');
__.lineno = 34;
buf.push('<li>');
__.lineno = undefined;
__.lineno = 35;
buf.push('<a');
buf.push(attrs({ 'href':("https://twitter.com/#!/_Kanva"), 'target':("_blank") }));
buf.push('>');
__.lineno = undefined;
__.lineno = 36;
buf.push('<img');
buf.push(attrs({ 'src':("/images/icons/dark/32/twitter.png") }));
buf.push('/>');
buf.push('</a>');
buf.push('</li>');
buf.push('</ul>');
buf.push('</header>');
buf.push('</div>');
__.lineno = 37;
buf.push('<div');
buf.push(attrs({ "class": ('who-we-are') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 39;
buf.push('<header>');
__.lineno = undefined;
__.lineno = 39;
buf.push('<h1>');
var __val__ = about.who_we_are.title[lc]
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</h1>');
buf.push('</header>');
__.lineno = 40;
buf.push('<div');
buf.push(attrs({ "class": ('content') }));
buf.push('>');
var __val__ = about.who_we_are.body[lc]
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</div>');
buf.push('</div>');
buf.push('</div>');
__.lineno = 43;
buf.push('<div');
buf.push(attrs({ "class": ('part-2') + ' ' + ('part') + ' ' + ('qualifications') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 44;
buf.push('<div');
buf.push(attrs({ "class": ('content') + ' ' + ('client-list') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 46;
buf.push('<header>');
__.lineno = undefined;
__.lineno = 46;
buf.push('<h1>');
var __val__ = about.client_list.title[lc]
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</h1>');
buf.push('</header>');
__.lineno = 48;
buf.push('<ul>');
__.lineno = undefined;
__.lineno = 50;
// iterate about.client_list.body[lc]
(function(){
  if ('number' == typeof about.client_list.body[lc].length) {
    for (var index = 0, $$l = about.client_list.body[lc].length; index < $$l; index++) {
      var client = about.client_list.body[lc][index];

__.lineno = 48;
__.lineno = 49;
buf.push('<li>');
var __val__ = client
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</li>');
    }
  } else {
    for (var index in about.client_list.body[lc]) {
      var client = about.client_list.body[lc][index];

__.lineno = 48;
__.lineno = 49;
buf.push('<li>');
var __val__ = client
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</li>');
   }
  }
}).call(this);

buf.push('</ul>');
buf.push('</div>');
__.lineno = 50;
buf.push('<div');
buf.push(attrs({ "class": ('our-expertise') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 52;
buf.push('<header>');
__.lineno = undefined;
__.lineno = 52;
buf.push('<h1>');
var __val__ = about.our_expertise.title[lc]
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</h1>');
buf.push('</header>');
__.lineno = 53;
buf.push('<div');
buf.push(attrs({ "class": ('content') }));
buf.push('>');
var __val__ = about.our_expertise.body[lc]
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</div>');
buf.push('</div>');
buf.push('</div>');
__.lineno = 55;
buf.push('<div');
buf.push(attrs({ "class": ('part-3') + ' ' + ('part') + ' ' + ('architecture') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 57;
buf.push('<div');
buf.push(attrs({ "class": ('content') + ' ' + ('services-list') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 59;
buf.push('<header>');
__.lineno = undefined;
__.lineno = 59;
buf.push('<h1>');
var __val__ = about.architecture.services.title[lc]
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</h1>');
buf.push('</header>');
__.lineno = 61;
buf.push('<ul>');
__.lineno = undefined;
__.lineno = 63;
// iterate about.architecture.services.body[lc]
(function(){
  if ('number' == typeof about.architecture.services.body[lc].length) {
    for (var index = 0, $$l = about.architecture.services.body[lc].length; index < $$l; index++) {
      var service = about.architecture.services.body[lc][index];

__.lineno = 61;
__.lineno = 62;
buf.push('<li>');
var __val__ = service
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</li>');
    }
  } else {
    for (var index in about.architecture.services.body[lc]) {
      var service = about.architecture.services.body[lc][index];

__.lineno = 61;
__.lineno = 62;
buf.push('<li>');
var __val__ = service
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</li>');
   }
  }
}).call(this);

buf.push('</ul>');
buf.push('</div>');
__.lineno = 63;
buf.push('<div');
buf.push(attrs({ "class": ('intro') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 65;
buf.push('<header>');
__.lineno = undefined;
__.lineno = 65;
buf.push('<h1>');
var __val__ = about.architecture.title[lc]
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</h1>');
buf.push('</header>');
__.lineno = 66;
buf.push('<div');
buf.push(attrs({ "class": ('content') }));
buf.push('>');
var __val__ = about.architecture.body[lc]
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</div>');
buf.push('</div>');
buf.push('</div>');
__.lineno = 68;
buf.push('<div');
buf.push(attrs({ "class": ('part-4') + ' ' + ('part') + ' ' + ('management') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 70;
buf.push('<div');
buf.push(attrs({ "class": ('content') + ' ' + ('services-list') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 72;
buf.push('<header>');
__.lineno = undefined;
__.lineno = 72;
buf.push('<h1>');
var __val__ = about.management.services.title[lc]
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</h1>');
buf.push('</header>');
__.lineno = 74;
buf.push('<ul>');
__.lineno = undefined;
__.lineno = 76;
// iterate about.management.services.body[lc]
(function(){
  if ('number' == typeof about.management.services.body[lc].length) {
    for (var index = 0, $$l = about.management.services.body[lc].length; index < $$l; index++) {
      var service = about.management.services.body[lc][index];

__.lineno = 74;
__.lineno = 75;
buf.push('<li>');
var __val__ = service
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</li>');
    }
  } else {
    for (var index in about.management.services.body[lc]) {
      var service = about.management.services.body[lc][index];

__.lineno = 74;
__.lineno = 75;
buf.push('<li>');
var __val__ = service
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</li>');
   }
  }
}).call(this);

buf.push('</ul>');
buf.push('</div>');
__.lineno = 76;
buf.push('<div');
buf.push(attrs({ "class": ('intro') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 78;
buf.push('<header>');
__.lineno = undefined;
__.lineno = 78;
buf.push('<h1>');
var __val__ = about.management.title[lc]
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</h1>');
buf.push('</header>');
__.lineno = 79;
buf.push('<div');
buf.push(attrs({ "class": ('content') }));
buf.push('>');
var __val__ = about.management.body[lc]
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</div>');
buf.push('</div>');
buf.push('</div>');
__.lineno = 81;
buf.push('<div');
buf.push(attrs({ "class": ('part-5') + ' ' + ('part') + ' ' + ('resdev') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 82;
buf.push('<div');
buf.push(attrs({ "class": ('content') + ' ' + ('services-list') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 84;
buf.push('<header>');
__.lineno = undefined;
__.lineno = 84;
buf.push('<h1>');
var __val__ = about.resdev.activities.title[lc]
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</h1>');
buf.push('</header>');
__.lineno = 86;
buf.push('<ul>');
__.lineno = undefined;
__.lineno = 88;
// iterate about.resdev.activities.body[lc]
(function(){
  if ('number' == typeof about.resdev.activities.body[lc].length) {
    for (var index = 0, $$l = about.resdev.activities.body[lc].length; index < $$l; index++) {
      var activity = about.resdev.activities.body[lc][index];

__.lineno = 86;
__.lineno = 87;
buf.push('<li>');
var __val__ = activity
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</li>');
    }
  } else {
    for (var index in about.resdev.activities.body[lc]) {
      var activity = about.resdev.activities.body[lc][index];

__.lineno = 86;
__.lineno = 87;
buf.push('<li>');
var __val__ = activity
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</li>');
   }
  }
}).call(this);

buf.push('</ul>');
buf.push('</div>');
__.lineno = 88;
buf.push('<div');
buf.push(attrs({ "class": ('intro') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 90;
buf.push('<header>');
__.lineno = undefined;
__.lineno = 90;
buf.push('<h1>');
var __val__ = about.resdev.title[lc]
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</h1>');
buf.push('</header>');
__.lineno = 91;
buf.push('<div');
buf.push(attrs({ "class": ('content') }));
buf.push('>');
var __val__ = about.resdev.body[lc]
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</div>');
buf.push('</div>');
buf.push('</div>');
__.lineno = 97;
buf.push('<div');
buf.push(attrs({ "class": ('part-6') + ' ' + ('part') + ' ' + ('in-the-press') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 99;
buf.push('<header>');
__.lineno = undefined;
__.lineno = 99;
buf.push('<h1>');
var __val__ = about.in_the_press.title[lc]
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</h1>');
buf.push('</header>');
__.lineno = 100;
buf.push('<table');
buf.push(attrs({ "class": ('light-theme-table') + ' ' + ('active-table') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 102;
buf.push('<thead>');
__.lineno = undefined;
__.lineno = 103;
buf.push('<tr>');
__.lineno = undefined;
__.lineno = 107;
// iterate about.in_the_press.column_names
(function(){
  if ('number' == typeof about.in_the_press.column_names.length) {
    for (var index = 0, $$l = about.in_the_press.column_names.length; index < $$l; index++) {
      var column_name = about.in_the_press.column_names[index];

__.lineno = 103;
__.lineno = 105;
buf.push('<th');
buf.push(attrs({ "class": ("" + (column_name) + "-cell") }));
buf.push('>');
__.lineno = undefined;
__.lineno = 105;
var __val__ = _i(column_name)
buf.push(null == __val__ ? "" : __val__);
__.lineno = 106;
buf.push('<div');
buf.push(attrs({ "class": ('sorted-graphic') }));
buf.push('>');
__.lineno = undefined;
buf.push('</div>');
buf.push('</th>');
    }
  } else {
    for (var index in about.in_the_press.column_names) {
      var column_name = about.in_the_press.column_names[index];

__.lineno = 103;
__.lineno = 105;
buf.push('<th');
buf.push(attrs({ "class": ("" + (column_name) + "-cell") }));
buf.push('>');
__.lineno = undefined;
__.lineno = 105;
var __val__ = _i(column_name)
buf.push(null == __val__ ? "" : __val__);
__.lineno = 106;
buf.push('<div');
buf.push(attrs({ "class": ('sorted-graphic') }));
buf.push('>');
__.lineno = undefined;
buf.push('</div>');
buf.push('</th>');
   }
  }
}).call(this);

buf.push('</tr>');
buf.push('</thead>');
__.lineno = 108;
buf.push('<tbody>');
__.lineno = undefined;
__.lineno = 118;
// iterate about.in_the_press.body[lc]
(function(){
  if ('number' == typeof about.in_the_press.body[lc].length) {
    for (var index = 0, $$l = about.in_the_press.body[lc].length; index < $$l; index++) {
      var row = about.in_the_press.body[lc][index];

__.lineno = 108;
__.lineno = 110;
buf.push('<tr>');
__.lineno = undefined;
__.lineno = 118;
// iterate about.in_the_press.column_names
(function(){
  if ('number' == typeof about.in_the_press.column_names.length) {
    for (var index = 0, $$l = about.in_the_press.column_names.length; index < $$l; index++) {
      var column_name = about.in_the_press.column_names[index];

__.lineno = 110;
__.lineno = 111;
if(column_name == "link" && row[column_name])
{
__.lineno = 112;
__.lineno = 112;
buf.push('<td>');
__.lineno = undefined;
__.lineno = 112;
buf.push('<a');
buf.push(attrs({ 'href':(row[column_name]), 'target':("_blank") }));
buf.push('>');
var __val__ = window._i("Link",lc)
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</a>');
buf.push('</td>');
}
else
{
__.lineno = 114;
__.lineno = 114;
buf.push('<td>');
var __val__ = row[column_name] || "--"
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</td>');
}
    }
  } else {
    for (var index in about.in_the_press.column_names) {
      var column_name = about.in_the_press.column_names[index];

__.lineno = 110;
__.lineno = 111;
if(column_name == "link" && row[column_name])
{
__.lineno = 112;
__.lineno = 112;
buf.push('<td>');
__.lineno = undefined;
__.lineno = 112;
buf.push('<a');
buf.push(attrs({ 'href':(row[column_name]), 'target':("_blank") }));
buf.push('>');
var __val__ = window._i("Link",lc)
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</a>');
buf.push('</td>');
}
else
{
__.lineno = 114;
__.lineno = 114;
buf.push('<td>');
var __val__ = row[column_name] || "--"
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</td>');
}
   }
  }
}).call(this);

buf.push('</tr>');
    }
  } else {
    for (var index in about.in_the_press.body[lc]) {
      var row = about.in_the_press.body[lc][index];

__.lineno = 108;
__.lineno = 110;
buf.push('<tr>');
__.lineno = undefined;
__.lineno = 118;
// iterate about.in_the_press.column_names
(function(){
  if ('number' == typeof about.in_the_press.column_names.length) {
    for (var index = 0, $$l = about.in_the_press.column_names.length; index < $$l; index++) {
      var column_name = about.in_the_press.column_names[index];

__.lineno = 110;
__.lineno = 111;
if(column_name == "link" && row[column_name])
{
__.lineno = 112;
__.lineno = 112;
buf.push('<td>');
__.lineno = undefined;
__.lineno = 112;
buf.push('<a');
buf.push(attrs({ 'href':(row[column_name]), 'target':("_blank") }));
buf.push('>');
var __val__ = window._i("Link",lc)
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</a>');
buf.push('</td>');
}
else
{
__.lineno = 114;
__.lineno = 114;
buf.push('<td>');
var __val__ = row[column_name] || "--"
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</td>');
}
    }
  } else {
    for (var index in about.in_the_press.column_names) {
      var column_name = about.in_the_press.column_names[index];

__.lineno = 110;
__.lineno = 111;
if(column_name == "link" && row[column_name])
{
__.lineno = 112;
__.lineno = 112;
buf.push('<td>');
__.lineno = undefined;
__.lineno = 112;
buf.push('<a');
buf.push(attrs({ 'href':(row[column_name]), 'target':("_blank") }));
buf.push('>');
var __val__ = window._i("Link",lc)
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</a>');
buf.push('</td>');
}
else
{
__.lineno = 114;
__.lineno = 114;
buf.push('<td>');
var __val__ = row[column_name] || "--"
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</td>');
}
   }
  }
}).call(this);

buf.push('</tr>');
   }
  }
}).call(this);

buf.push('</tbody>');
buf.push('</table>');
buf.push('</div>');
buf.push('</div>');
    }
  } else {
    for (var lc in content.sets.lang_labels) {
      var lang_name = content.sets.lang_labels[lc];

__.lineno = 17;
__.lineno = 19;
buf.push('<div');
buf.push(attrs({ "class": ("parts localized localized-" + (lc) + "") }));
buf.push('>');
__.lineno = undefined;
__.lineno = 19;
buf.push('<div');
buf.push(attrs({ "class": ('part-1') + ' ' + ('part') + ' ' + ('introduction') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 20;
buf.push('<div');
buf.push(attrs({ "class": ('contact-us') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 22;
buf.push('<header>');
__.lineno = undefined;
__.lineno = 22;
buf.push('<h1>');
buf.push('Contact us');
__.lineno = undefined;
buf.push('</h1>');
__.lineno = 26;
// iterate team
(function(){
  if ('number' == typeof team.length) {
    for (var index = 0, $$l = team.length; index < $$l; index++) {
      var member = team[index];

__.lineno = 23;
__.lineno = 24;
if(member.first_name == "office")
{
__.lineno = 25;
__.lineno = 25;
var __val__ = member.stats[0].all_parsed
buf.push(null == __val__ ? "" : __val__);
}
    }
  } else {
    for (var index in team) {
      var member = team[index];

__.lineno = 23;
__.lineno = 24;
if(member.first_name == "office")
{
__.lineno = 25;
__.lineno = 25;
var __val__ = member.stats[0].all_parsed
buf.push(null == __val__ ? "" : __val__);
}
   }
  }
}).call(this);

__.lineno = 26;
buf.push('<ul');
buf.push(attrs({ "class": ('social') + ' ' + ('icon-links') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 28;
buf.push('<li>');
__.lineno = undefined;
__.lineno = 29;
buf.push('<a');
buf.push(attrs({ 'href':("http://www.linkedin.com/company/kanva"), 'target':("_blank") }));
buf.push('>');
__.lineno = undefined;
__.lineno = 30;
buf.push('<img');
buf.push(attrs({ 'src':("/images/icons/dark/32/linkedin.png") }));
buf.push('/>');
buf.push('</a>');
buf.push('</li>');
__.lineno = 31;
buf.push('<li>');
__.lineno = undefined;
__.lineno = 32;
buf.push('<a');
buf.push(attrs({ 'href':("http://www.facebook.com/pages/Kanva-Architecture/97050979639"), 'target':("_blank") }));
buf.push('>');
__.lineno = undefined;
__.lineno = 33;
buf.push('<img');
buf.push(attrs({ 'src':("/images/icons/dark/32/facebook.png") }));
buf.push('/>');
buf.push('</a>');
buf.push('</li>');
__.lineno = 34;
buf.push('<li>');
__.lineno = undefined;
__.lineno = 35;
buf.push('<a');
buf.push(attrs({ 'href':("https://twitter.com/#!/_Kanva"), 'target':("_blank") }));
buf.push('>');
__.lineno = undefined;
__.lineno = 36;
buf.push('<img');
buf.push(attrs({ 'src':("/images/icons/dark/32/twitter.png") }));
buf.push('/>');
buf.push('</a>');
buf.push('</li>');
buf.push('</ul>');
buf.push('</header>');
buf.push('</div>');
__.lineno = 37;
buf.push('<div');
buf.push(attrs({ "class": ('who-we-are') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 39;
buf.push('<header>');
__.lineno = undefined;
__.lineno = 39;
buf.push('<h1>');
var __val__ = about.who_we_are.title[lc]
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</h1>');
buf.push('</header>');
__.lineno = 40;
buf.push('<div');
buf.push(attrs({ "class": ('content') }));
buf.push('>');
var __val__ = about.who_we_are.body[lc]
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</div>');
buf.push('</div>');
buf.push('</div>');
__.lineno = 43;
buf.push('<div');
buf.push(attrs({ "class": ('part-2') + ' ' + ('part') + ' ' + ('qualifications') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 44;
buf.push('<div');
buf.push(attrs({ "class": ('content') + ' ' + ('client-list') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 46;
buf.push('<header>');
__.lineno = undefined;
__.lineno = 46;
buf.push('<h1>');
var __val__ = about.client_list.title[lc]
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</h1>');
buf.push('</header>');
__.lineno = 48;
buf.push('<ul>');
__.lineno = undefined;
__.lineno = 50;
// iterate about.client_list.body[lc]
(function(){
  if ('number' == typeof about.client_list.body[lc].length) {
    for (var index = 0, $$l = about.client_list.body[lc].length; index < $$l; index++) {
      var client = about.client_list.body[lc][index];

__.lineno = 48;
__.lineno = 49;
buf.push('<li>');
var __val__ = client
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</li>');
    }
  } else {
    for (var index in about.client_list.body[lc]) {
      var client = about.client_list.body[lc][index];

__.lineno = 48;
__.lineno = 49;
buf.push('<li>');
var __val__ = client
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</li>');
   }
  }
}).call(this);

buf.push('</ul>');
buf.push('</div>');
__.lineno = 50;
buf.push('<div');
buf.push(attrs({ "class": ('our-expertise') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 52;
buf.push('<header>');
__.lineno = undefined;
__.lineno = 52;
buf.push('<h1>');
var __val__ = about.our_expertise.title[lc]
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</h1>');
buf.push('</header>');
__.lineno = 53;
buf.push('<div');
buf.push(attrs({ "class": ('content') }));
buf.push('>');
var __val__ = about.our_expertise.body[lc]
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</div>');
buf.push('</div>');
buf.push('</div>');
__.lineno = 55;
buf.push('<div');
buf.push(attrs({ "class": ('part-3') + ' ' + ('part') + ' ' + ('architecture') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 57;
buf.push('<div');
buf.push(attrs({ "class": ('content') + ' ' + ('services-list') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 59;
buf.push('<header>');
__.lineno = undefined;
__.lineno = 59;
buf.push('<h1>');
var __val__ = about.architecture.services.title[lc]
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</h1>');
buf.push('</header>');
__.lineno = 61;
buf.push('<ul>');
__.lineno = undefined;
__.lineno = 63;
// iterate about.architecture.services.body[lc]
(function(){
  if ('number' == typeof about.architecture.services.body[lc].length) {
    for (var index = 0, $$l = about.architecture.services.body[lc].length; index < $$l; index++) {
      var service = about.architecture.services.body[lc][index];

__.lineno = 61;
__.lineno = 62;
buf.push('<li>');
var __val__ = service
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</li>');
    }
  } else {
    for (var index in about.architecture.services.body[lc]) {
      var service = about.architecture.services.body[lc][index];

__.lineno = 61;
__.lineno = 62;
buf.push('<li>');
var __val__ = service
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</li>');
   }
  }
}).call(this);

buf.push('</ul>');
buf.push('</div>');
__.lineno = 63;
buf.push('<div');
buf.push(attrs({ "class": ('intro') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 65;
buf.push('<header>');
__.lineno = undefined;
__.lineno = 65;
buf.push('<h1>');
var __val__ = about.architecture.title[lc]
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</h1>');
buf.push('</header>');
__.lineno = 66;
buf.push('<div');
buf.push(attrs({ "class": ('content') }));
buf.push('>');
var __val__ = about.architecture.body[lc]
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</div>');
buf.push('</div>');
buf.push('</div>');
__.lineno = 68;
buf.push('<div');
buf.push(attrs({ "class": ('part-4') + ' ' + ('part') + ' ' + ('management') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 70;
buf.push('<div');
buf.push(attrs({ "class": ('content') + ' ' + ('services-list') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 72;
buf.push('<header>');
__.lineno = undefined;
__.lineno = 72;
buf.push('<h1>');
var __val__ = about.management.services.title[lc]
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</h1>');
buf.push('</header>');
__.lineno = 74;
buf.push('<ul>');
__.lineno = undefined;
__.lineno = 76;
// iterate about.management.services.body[lc]
(function(){
  if ('number' == typeof about.management.services.body[lc].length) {
    for (var index = 0, $$l = about.management.services.body[lc].length; index < $$l; index++) {
      var service = about.management.services.body[lc][index];

__.lineno = 74;
__.lineno = 75;
buf.push('<li>');
var __val__ = service
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</li>');
    }
  } else {
    for (var index in about.management.services.body[lc]) {
      var service = about.management.services.body[lc][index];

__.lineno = 74;
__.lineno = 75;
buf.push('<li>');
var __val__ = service
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</li>');
   }
  }
}).call(this);

buf.push('</ul>');
buf.push('</div>');
__.lineno = 76;
buf.push('<div');
buf.push(attrs({ "class": ('intro') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 78;
buf.push('<header>');
__.lineno = undefined;
__.lineno = 78;
buf.push('<h1>');
var __val__ = about.management.title[lc]
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</h1>');
buf.push('</header>');
__.lineno = 79;
buf.push('<div');
buf.push(attrs({ "class": ('content') }));
buf.push('>');
var __val__ = about.management.body[lc]
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</div>');
buf.push('</div>');
buf.push('</div>');
__.lineno = 81;
buf.push('<div');
buf.push(attrs({ "class": ('part-5') + ' ' + ('part') + ' ' + ('resdev') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 82;
buf.push('<div');
buf.push(attrs({ "class": ('content') + ' ' + ('services-list') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 84;
buf.push('<header>');
__.lineno = undefined;
__.lineno = 84;
buf.push('<h1>');
var __val__ = about.resdev.activities.title[lc]
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</h1>');
buf.push('</header>');
__.lineno = 86;
buf.push('<ul>');
__.lineno = undefined;
__.lineno = 88;
// iterate about.resdev.activities.body[lc]
(function(){
  if ('number' == typeof about.resdev.activities.body[lc].length) {
    for (var index = 0, $$l = about.resdev.activities.body[lc].length; index < $$l; index++) {
      var activity = about.resdev.activities.body[lc][index];

__.lineno = 86;
__.lineno = 87;
buf.push('<li>');
var __val__ = activity
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</li>');
    }
  } else {
    for (var index in about.resdev.activities.body[lc]) {
      var activity = about.resdev.activities.body[lc][index];

__.lineno = 86;
__.lineno = 87;
buf.push('<li>');
var __val__ = activity
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</li>');
   }
  }
}).call(this);

buf.push('</ul>');
buf.push('</div>');
__.lineno = 88;
buf.push('<div');
buf.push(attrs({ "class": ('intro') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 90;
buf.push('<header>');
__.lineno = undefined;
__.lineno = 90;
buf.push('<h1>');
var __val__ = about.resdev.title[lc]
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</h1>');
buf.push('</header>');
__.lineno = 91;
buf.push('<div');
buf.push(attrs({ "class": ('content') }));
buf.push('>');
var __val__ = about.resdev.body[lc]
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</div>');
buf.push('</div>');
buf.push('</div>');
__.lineno = 97;
buf.push('<div');
buf.push(attrs({ "class": ('part-6') + ' ' + ('part') + ' ' + ('in-the-press') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 99;
buf.push('<header>');
__.lineno = undefined;
__.lineno = 99;
buf.push('<h1>');
var __val__ = about.in_the_press.title[lc]
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</h1>');
buf.push('</header>');
__.lineno = 100;
buf.push('<table');
buf.push(attrs({ "class": ('light-theme-table') + ' ' + ('active-table') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 102;
buf.push('<thead>');
__.lineno = undefined;
__.lineno = 103;
buf.push('<tr>');
__.lineno = undefined;
__.lineno = 107;
// iterate about.in_the_press.column_names
(function(){
  if ('number' == typeof about.in_the_press.column_names.length) {
    for (var index = 0, $$l = about.in_the_press.column_names.length; index < $$l; index++) {
      var column_name = about.in_the_press.column_names[index];

__.lineno = 103;
__.lineno = 105;
buf.push('<th');
buf.push(attrs({ "class": ("" + (column_name) + "-cell") }));
buf.push('>');
__.lineno = undefined;
__.lineno = 105;
var __val__ = _i(column_name)
buf.push(null == __val__ ? "" : __val__);
__.lineno = 106;
buf.push('<div');
buf.push(attrs({ "class": ('sorted-graphic') }));
buf.push('>');
__.lineno = undefined;
buf.push('</div>');
buf.push('</th>');
    }
  } else {
    for (var index in about.in_the_press.column_names) {
      var column_name = about.in_the_press.column_names[index];

__.lineno = 103;
__.lineno = 105;
buf.push('<th');
buf.push(attrs({ "class": ("" + (column_name) + "-cell") }));
buf.push('>');
__.lineno = undefined;
__.lineno = 105;
var __val__ = _i(column_name)
buf.push(null == __val__ ? "" : __val__);
__.lineno = 106;
buf.push('<div');
buf.push(attrs({ "class": ('sorted-graphic') }));
buf.push('>');
__.lineno = undefined;
buf.push('</div>');
buf.push('</th>');
   }
  }
}).call(this);

buf.push('</tr>');
buf.push('</thead>');
__.lineno = 108;
buf.push('<tbody>');
__.lineno = undefined;
__.lineno = 118;
// iterate about.in_the_press.body[lc]
(function(){
  if ('number' == typeof about.in_the_press.body[lc].length) {
    for (var index = 0, $$l = about.in_the_press.body[lc].length; index < $$l; index++) {
      var row = about.in_the_press.body[lc][index];

__.lineno = 108;
__.lineno = 110;
buf.push('<tr>');
__.lineno = undefined;
__.lineno = 118;
// iterate about.in_the_press.column_names
(function(){
  if ('number' == typeof about.in_the_press.column_names.length) {
    for (var index = 0, $$l = about.in_the_press.column_names.length; index < $$l; index++) {
      var column_name = about.in_the_press.column_names[index];

__.lineno = 110;
__.lineno = 111;
if(column_name == "link" && row[column_name])
{
__.lineno = 112;
__.lineno = 112;
buf.push('<td>');
__.lineno = undefined;
__.lineno = 112;
buf.push('<a');
buf.push(attrs({ 'href':(row[column_name]), 'target':("_blank") }));
buf.push('>');
var __val__ = window._i("Link",lc)
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</a>');
buf.push('</td>');
}
else
{
__.lineno = 114;
__.lineno = 114;
buf.push('<td>');
var __val__ = row[column_name] || "--"
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</td>');
}
    }
  } else {
    for (var index in about.in_the_press.column_names) {
      var column_name = about.in_the_press.column_names[index];

__.lineno = 110;
__.lineno = 111;
if(column_name == "link" && row[column_name])
{
__.lineno = 112;
__.lineno = 112;
buf.push('<td>');
__.lineno = undefined;
__.lineno = 112;
buf.push('<a');
buf.push(attrs({ 'href':(row[column_name]), 'target':("_blank") }));
buf.push('>');
var __val__ = window._i("Link",lc)
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</a>');
buf.push('</td>');
}
else
{
__.lineno = 114;
__.lineno = 114;
buf.push('<td>');
var __val__ = row[column_name] || "--"
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</td>');
}
   }
  }
}).call(this);

buf.push('</tr>');
    }
  } else {
    for (var index in about.in_the_press.body[lc]) {
      var row = about.in_the_press.body[lc][index];

__.lineno = 108;
__.lineno = 110;
buf.push('<tr>');
__.lineno = undefined;
__.lineno = 118;
// iterate about.in_the_press.column_names
(function(){
  if ('number' == typeof about.in_the_press.column_names.length) {
    for (var index = 0, $$l = about.in_the_press.column_names.length; index < $$l; index++) {
      var column_name = about.in_the_press.column_names[index];

__.lineno = 110;
__.lineno = 111;
if(column_name == "link" && row[column_name])
{
__.lineno = 112;
__.lineno = 112;
buf.push('<td>');
__.lineno = undefined;
__.lineno = 112;
buf.push('<a');
buf.push(attrs({ 'href':(row[column_name]), 'target':("_blank") }));
buf.push('>');
var __val__ = window._i("Link",lc)
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</a>');
buf.push('</td>');
}
else
{
__.lineno = 114;
__.lineno = 114;
buf.push('<td>');
var __val__ = row[column_name] || "--"
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</td>');
}
    }
  } else {
    for (var index in about.in_the_press.column_names) {
      var column_name = about.in_the_press.column_names[index];

__.lineno = 110;
__.lineno = 111;
if(column_name == "link" && row[column_name])
{
__.lineno = 112;
__.lineno = 112;
buf.push('<td>');
__.lineno = undefined;
__.lineno = 112;
buf.push('<a');
buf.push(attrs({ 'href':(row[column_name]), 'target':("_blank") }));
buf.push('>');
var __val__ = window._i("Link",lc)
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</a>');
buf.push('</td>');
}
else
{
__.lineno = 114;
__.lineno = 114;
buf.push('<td>');
var __val__ = row[column_name] || "--"
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</td>');
}
   }
  }
}).call(this);

buf.push('</tr>');
   }
  }
}).call(this);

buf.push('</tbody>');
buf.push('</table>');
buf.push('</div>');
buf.push('</div>');
   }
  }
}).call(this);

buf.push('</div>');}return buf.join("");
} catch (err) {
  rethrow(err, __.input, __.filename, __.lineno);
}
};}, "templates/active_table": function(exports, require, module) {module.exports = function anonymous(locals) {
var __ = { lineno: 1, input: "header\n    -if(locals[\"table_label\"])\n        h1.table-label!= window._i(table_label)\n    -if(locals[\"table_icon_url\"])\n        img.table-icon(src=table_icon_url)\ntable\n    thead\n        tr\n            -each column_label,column_name in column_names\n                th(class=\"#{column_name}-cell\")\n                    != column_label\n                    .sorted-graphic\n    tbody\n        -each row in rows\n            tr(data-id=row._id, data-primary-photo=row.primary_photo_url_l, data-summary=row.post_summary.localized, data-title=row.title)\n                -each column_label,column_name in column_names\n                    td(class=\"#{column_name}-cell\")\n                        -if(column_name == \"title\")\n                            .permalink\n                                a(href=\"/#/post/#{row._id}\")\n                                    img(src=\"/images/icons/dark/24/preview.png\")\n                        != window._i(row[column_name])\n", filename: undefined };
function rethrow(err, str, filename, lineno){
  var context = 3
    , lines = str.split('\n')
    , start = Math.max(lineno - context, 0)
    , end = Math.min(lines.length, lineno + context); 

  // Error context
  var context = lines.slice(start, end).map(function(line, i){
    var curr = i + start + 1;
    return (curr == lineno ? '  > ' : '    ')
      + curr
      + '| '
      + line;
  }).join('\n');

  // Alter exception message
  err.path = filename;
  err.message = (filename || 'Jade') + ':' + lineno 
    + '\n' + context + '\n\n' + err.message;
  throw err;
}
try {
function attrs(obj){
  var buf = []
    , terse = obj.terse;
  delete obj.terse;
  var keys = Object.keys(obj)
    , len = keys.length;
  if (len) {
    buf.push('');
    for (var i = 0; i < len; ++i) {
      var key = keys[i]
        , val = obj[key];
      if ('boolean' == typeof val || null == val) {
        if (val) {
          terse
            ? buf.push(key)
            : buf.push(key + '="' + key + '"');
        }
      } else if ('class' == key && Array.isArray(val)) {
        buf.push(key + '="' + escape(val.join(' ')) + '"');
      } else {
        buf.push(key + '="' + escape(val) + '"');
      }
    }
  }
  return buf.join(' ');
}

function escape(html){
  return String(html)
    .replace(/&(?!\w+;)/g, '&amp;')
    .replace(/</g, '&lt;')
    .replace(/>/g, '&gt;')
    .replace(/"/g, '&quot;');
}

var buf = [];
with (locals || {}) {__.lineno = 1;
__.lineno = 2;
buf.push('<header>');
__.lineno = undefined;
__.lineno = 2;
if(locals["table_label"])
{
__.lineno = 3;
__.lineno = 3;
buf.push('<h1');
buf.push(attrs({ "class": ('table-label') }));
buf.push('>');
var __val__ = window._i(table_label)
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</h1>');
}
__.lineno = 4;
if(locals["table_icon_url"])
{
__.lineno = 5;
__.lineno = 5;
buf.push('<img');
buf.push(attrs({ 'src':(table_icon_url), "class": ('table-icon') }));
buf.push('/>');
}
buf.push('</header>');
__.lineno = 7;
buf.push('<table>');
__.lineno = undefined;
__.lineno = 8;
buf.push('<thead>');
__.lineno = undefined;
__.lineno = 9;
buf.push('<tr>');
__.lineno = undefined;
__.lineno = 13;
// iterate column_names
(function(){
  if ('number' == typeof column_names.length) {
    for (var column_name = 0, $$l = column_names.length; column_name < $$l; column_name++) {
      var column_label = column_names[column_name];

__.lineno = 9;
__.lineno = 11;
buf.push('<th');
buf.push(attrs({ "class": ("" + (column_name) + "-cell") }));
buf.push('>');
__.lineno = undefined;
__.lineno = 11;
var __val__ = column_label
buf.push(null == __val__ ? "" : __val__);
__.lineno = 12;
buf.push('<div');
buf.push(attrs({ "class": ('sorted-graphic') }));
buf.push('>');
__.lineno = undefined;
buf.push('</div>');
buf.push('</th>');
    }
  } else {
    for (var column_name in column_names) {
      var column_label = column_names[column_name];

__.lineno = 9;
__.lineno = 11;
buf.push('<th');
buf.push(attrs({ "class": ("" + (column_name) + "-cell") }));
buf.push('>');
__.lineno = undefined;
__.lineno = 11;
var __val__ = column_label
buf.push(null == __val__ ? "" : __val__);
__.lineno = 12;
buf.push('<div');
buf.push(attrs({ "class": ('sorted-graphic') }));
buf.push('>');
__.lineno = undefined;
buf.push('</div>');
buf.push('</th>');
   }
  }
}).call(this);

buf.push('</tr>');
buf.push('</thead>');
__.lineno = 14;
buf.push('<tbody>');
__.lineno = undefined;
__.lineno = 23;
// iterate rows
(function(){
  if ('number' == typeof rows.length) {
    for (var index = 0, $$l = rows.length; index < $$l; index++) {
      var row = rows[index];

__.lineno = 14;
__.lineno = 16;
buf.push('<tr');
buf.push(attrs({ 'data-id':(row._id), 'data-primary-photo':(row.primary_photo_url_l), 'data-summary':(row.post_summary.localized), 'data-title':(row.title) }));
buf.push('>');
__.lineno = undefined;
__.lineno = 23;
// iterate column_names
(function(){
  if ('number' == typeof column_names.length) {
    for (var column_name = 0, $$l = column_names.length; column_name < $$l; column_name++) {
      var column_label = column_names[column_name];

__.lineno = 16;
__.lineno = 18;
buf.push('<td');
buf.push(attrs({ "class": ("" + (column_name) + "-cell") }));
buf.push('>');
__.lineno = undefined;
__.lineno = 18;
if(column_name == "title")
{
__.lineno = 19;
__.lineno = 19;
buf.push('<div');
buf.push(attrs({ "class": ('permalink') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 21;
buf.push('<a');
buf.push(attrs({ 'href':("/#/post/" + (row._id) + "") }));
buf.push('>');
__.lineno = undefined;
__.lineno = 22;
buf.push('<img');
buf.push(attrs({ 'src':("/images/icons/dark/24/preview.png") }));
buf.push('/>');
buf.push('</a>');
buf.push('</div>');
}
__.lineno = 22;
var __val__ = window._i(row[column_name])
buf.push(null == __val__ ? "" : __val__);
buf.push('</td>');
    }
  } else {
    for (var column_name in column_names) {
      var column_label = column_names[column_name];

__.lineno = 16;
__.lineno = 18;
buf.push('<td');
buf.push(attrs({ "class": ("" + (column_name) + "-cell") }));
buf.push('>');
__.lineno = undefined;
__.lineno = 18;
if(column_name == "title")
{
__.lineno = 19;
__.lineno = 19;
buf.push('<div');
buf.push(attrs({ "class": ('permalink') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 21;
buf.push('<a');
buf.push(attrs({ 'href':("/#/post/" + (row._id) + "") }));
buf.push('>');
__.lineno = undefined;
__.lineno = 22;
buf.push('<img');
buf.push(attrs({ 'src':("/images/icons/dark/24/preview.png") }));
buf.push('/>');
buf.push('</a>');
buf.push('</div>');
}
__.lineno = 22;
var __val__ = window._i(row[column_name])
buf.push(null == __val__ ? "" : __val__);
buf.push('</td>');
   }
  }
}).call(this);

buf.push('</tr>');
    }
  } else {
    for (var index in rows) {
      var row = rows[index];

__.lineno = 14;
__.lineno = 16;
buf.push('<tr');
buf.push(attrs({ 'data-id':(row._id), 'data-primary-photo':(row.primary_photo_url_l), 'data-summary':(row.post_summary.localized), 'data-title':(row.title) }));
buf.push('>');
__.lineno = undefined;
__.lineno = 23;
// iterate column_names
(function(){
  if ('number' == typeof column_names.length) {
    for (var column_name = 0, $$l = column_names.length; column_name < $$l; column_name++) {
      var column_label = column_names[column_name];

__.lineno = 16;
__.lineno = 18;
buf.push('<td');
buf.push(attrs({ "class": ("" + (column_name) + "-cell") }));
buf.push('>');
__.lineno = undefined;
__.lineno = 18;
if(column_name == "title")
{
__.lineno = 19;
__.lineno = 19;
buf.push('<div');
buf.push(attrs({ "class": ('permalink') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 21;
buf.push('<a');
buf.push(attrs({ 'href':("/#/post/" + (row._id) + "") }));
buf.push('>');
__.lineno = undefined;
__.lineno = 22;
buf.push('<img');
buf.push(attrs({ 'src':("/images/icons/dark/24/preview.png") }));
buf.push('/>');
buf.push('</a>');
buf.push('</div>');
}
__.lineno = 22;
var __val__ = window._i(row[column_name])
buf.push(null == __val__ ? "" : __val__);
buf.push('</td>');
    }
  } else {
    for (var column_name in column_names) {
      var column_label = column_names[column_name];

__.lineno = 16;
__.lineno = 18;
buf.push('<td');
buf.push(attrs({ "class": ("" + (column_name) + "-cell") }));
buf.push('>');
__.lineno = undefined;
__.lineno = 18;
if(column_name == "title")
{
__.lineno = 19;
__.lineno = 19;
buf.push('<div');
buf.push(attrs({ "class": ('permalink') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 21;
buf.push('<a');
buf.push(attrs({ 'href':("/#/post/" + (row._id) + "") }));
buf.push('>');
__.lineno = undefined;
__.lineno = 22;
buf.push('<img');
buf.push(attrs({ 'src':("/images/icons/dark/24/preview.png") }));
buf.push('/>');
buf.push('</a>');
buf.push('</div>');
}
__.lineno = 22;
var __val__ = window._i(row[column_name])
buf.push(null == __val__ ? "" : __val__);
buf.push('</td>');
   }
  }
}).call(this);

buf.push('</tr>');
   }
  }
}).call(this);

buf.push('</tbody>');
buf.push('</table>');}return buf.join("");
} catch (err) {
  rethrow(err, __.input, __.filename, __.lineno);
}
};}, "templates/admin/create_team_member": function(exports, require, module) {module.exports = function anonymous(locals) {
var __ = { lineno: 1, input: ".errors\nform\n    - each form_field in form_fields\n        -value = locals[\"values\"] ? values[form_field.name] : ''\n        != form_field.render(value)\n\n    -if(locals[\"extra_fields\"])\n        -each field in extra_fields\n            != field\n\n    button(type=\"submit\")!= form_submit_label\n", filename: undefined };
function rethrow(err, str, filename, lineno){
  var context = 3
    , lines = str.split('\n')
    , start = Math.max(lineno - context, 0)
    , end = Math.min(lines.length, lineno + context); 

  // Error context
  var context = lines.slice(start, end).map(function(line, i){
    var curr = i + start + 1;
    return (curr == lineno ? '  > ' : '    ')
      + curr
      + '| '
      + line;
  }).join('\n');

  // Alter exception message
  err.path = filename;
  err.message = (filename || 'Jade') + ':' + lineno 
    + '\n' + context + '\n\n' + err.message;
  throw err;
}
try {
function attrs(obj){
  var buf = []
    , terse = obj.terse;
  delete obj.terse;
  var keys = Object.keys(obj)
    , len = keys.length;
  if (len) {
    buf.push('');
    for (var i = 0; i < len; ++i) {
      var key = keys[i]
        , val = obj[key];
      if ('boolean' == typeof val || null == val) {
        if (val) {
          terse
            ? buf.push(key)
            : buf.push(key + '="' + key + '"');
        }
      } else if ('class' == key && Array.isArray(val)) {
        buf.push(key + '="' + escape(val.join(' ')) + '"');
      } else {
        buf.push(key + '="' + escape(val) + '"');
      }
    }
  }
  return buf.join(' ');
}

function escape(html){
  return String(html)
    .replace(/&(?!\w+;)/g, '&amp;')
    .replace(/</g, '&lt;')
    .replace(/>/g, '&gt;')
    .replace(/"/g, '&quot;');
}

var buf = [];
with (locals || {}) {__.lineno = 1;
__.lineno = 1;
buf.push('<div');
buf.push(attrs({ "class": ('errors') }));
buf.push('>');
__.lineno = undefined;
buf.push('</div>');
__.lineno = 3;
buf.push('<form>');
__.lineno = undefined;
__.lineno = 7;
// iterate form_fields
(function(){
  if ('number' == typeof form_fields.length) {
    for (var index = 0, $$l = form_fields.length; index < $$l; index++) {
      var form_field = form_fields[index];

__.lineno = 3;
__.lineno = 4;
value = locals["values"] ? values[form_field.name] : ''
__.lineno = 5;
var __val__ = form_field.render(value)
buf.push(null == __val__ ? "" : __val__);
    }
  } else {
    for (var index in form_fields) {
      var form_field = form_fields[index];

__.lineno = 3;
__.lineno = 4;
value = locals["values"] ? values[form_field.name] : ''
__.lineno = 5;
var __val__ = form_field.render(value)
buf.push(null == __val__ ? "" : __val__);
   }
  }
}).call(this);

__.lineno = 7;
if(locals["extra_fields"])
{
__.lineno = 8;
__.lineno = 11;
// iterate extra_fields
(function(){
  if ('number' == typeof extra_fields.length) {
    for (var index = 0, $$l = extra_fields.length; index < $$l; index++) {
      var field = extra_fields[index];

__.lineno = 8;
__.lineno = 9;
var __val__ = field
buf.push(null == __val__ ? "" : __val__);
    }
  } else {
    for (var index in extra_fields) {
      var field = extra_fields[index];

__.lineno = 8;
__.lineno = 9;
var __val__ = field
buf.push(null == __val__ ? "" : __val__);
   }
  }
}).call(this);

}
__.lineno = 11;
buf.push('<button');
buf.push(attrs({ 'type':("submit") }));
buf.push('>');
var __val__ = form_submit_label
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</button>');
buf.push('</form>');}return buf.join("");
} catch (err) {
  rethrow(err, __.input, __.filename, __.lineno);
}
};}, "templates/admin/list_posts": function(exports, require, module) {module.exports = function anonymous(locals) {
var __ = { lineno: 1, input: "", filename: undefined };
function rethrow(err, str, filename, lineno){
  var context = 3
    , lines = str.split('\n')
    , start = Math.max(lineno - context, 0)
    , end = Math.min(lines.length, lineno + context); 

  // Error context
  var context = lines.slice(start, end).map(function(line, i){
    var curr = i + start + 1;
    return (curr == lineno ? '  > ' : '    ')
      + curr
      + '| '
      + line;
  }).join('\n');

  // Alter exception message
  err.path = filename;
  err.message = (filename || 'Jade') + ':' + lineno 
    + '\n' + context + '\n\n' + err.message;
  throw err;
}
try {
function attrs(obj){
  var buf = []
    , terse = obj.terse;
  delete obj.terse;
  var keys = Object.keys(obj)
    , len = keys.length;
  if (len) {
    buf.push('');
    for (var i = 0; i < len; ++i) {
      var key = keys[i]
        , val = obj[key];
      if ('boolean' == typeof val || null == val) {
        if (val) {
          terse
            ? buf.push(key)
            : buf.push(key + '="' + key + '"');
        }
      } else if ('class' == key && Array.isArray(val)) {
        buf.push(key + '="' + escape(val.join(' ')) + '"');
      } else {
        buf.push(key + '="' + escape(val) + '"');
      }
    }
  }
  return buf.join(' ');
}

function escape(html){
  return String(html)
    .replace(/&(?!\w+;)/g, '&amp;')
    .replace(/</g, '&lt;')
    .replace(/>/g, '&gt;')
    .replace(/"/g, '&quot;');
}

var buf = [];
with (locals || {}) {__.lineno = 1;}return buf.join("");
} catch (err) {
  rethrow(err, __.input, __.filename, __.lineno);
}
};}, "templates/admin/list_posts_row": function(exports, require, module) {module.exports = function anonymous(locals) {
var __ = { lineno: 1, input: "tr(id=_id)\n    - each meta_field_name,i in meta_field_names\n        td(class=\"#{meta_field_name}-cell\")\n            -if(i == 0)\n                button.delete-post &times;\n                a(href=\"#/update/post/#{_id}\")!= locals[meta_field_name]\n            -else\n                != locals[meta_field_name]\n\n\n\n", filename: undefined };
function rethrow(err, str, filename, lineno){
  var context = 3
    , lines = str.split('\n')
    , start = Math.max(lineno - context, 0)
    , end = Math.min(lines.length, lineno + context); 

  // Error context
  var context = lines.slice(start, end).map(function(line, i){
    var curr = i + start + 1;
    return (curr == lineno ? '  > ' : '    ')
      + curr
      + '| '
      + line;
  }).join('\n');

  // Alter exception message
  err.path = filename;
  err.message = (filename || 'Jade') + ':' + lineno 
    + '\n' + context + '\n\n' + err.message;
  throw err;
}
try {
function attrs(obj){
  var buf = []
    , terse = obj.terse;
  delete obj.terse;
  var keys = Object.keys(obj)
    , len = keys.length;
  if (len) {
    buf.push('');
    for (var i = 0; i < len; ++i) {
      var key = keys[i]
        , val = obj[key];
      if ('boolean' == typeof val || null == val) {
        if (val) {
          terse
            ? buf.push(key)
            : buf.push(key + '="' + key + '"');
        }
      } else if ('class' == key && Array.isArray(val)) {
        buf.push(key + '="' + escape(val.join(' ')) + '"');
      } else {
        buf.push(key + '="' + escape(val) + '"');
      }
    }
  }
  return buf.join(' ');
}

function escape(html){
  return String(html)
    .replace(/&(?!\w+;)/g, '&amp;')
    .replace(/</g, '&lt;')
    .replace(/>/g, '&gt;')
    .replace(/"/g, '&quot;');
}

var buf = [];
with (locals || {}) {__.lineno = 1;
__.lineno = 2;
buf.push('<tr');
buf.push(attrs({ 'id':(_id) }));
buf.push('>');
__.lineno = undefined;
__.lineno = 12;
// iterate meta_field_names
(function(){
  if ('number' == typeof meta_field_names.length) {
    for (var i = 0, $$l = meta_field_names.length; i < $$l; i++) {
      var meta_field_name = meta_field_names[i];

__.lineno = 2;
__.lineno = 4;
buf.push('<td');
buf.push(attrs({ "class": ("" + (meta_field_name) + "-cell") }));
buf.push('>');
__.lineno = undefined;
__.lineno = 4;
if(i == 0)
{
__.lineno = 5;
__.lineno = 5;
buf.push('<button');
buf.push(attrs({ "class": ('delete-post') }));
buf.push('>');
buf.push('&times;');
__.lineno = undefined;
buf.push('</button>');
__.lineno = 6;
buf.push('<a');
buf.push(attrs({ 'href':("#/update/post/" + (_id) + "") }));
buf.push('>');
var __val__ = locals[meta_field_name]
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</a>');
}
else
{
__.lineno = 8;
__.lineno = 8;
var __val__ = locals[meta_field_name]
buf.push(null == __val__ ? "" : __val__);
}
buf.push('</td>');
    }
  } else {
    for (var i in meta_field_names) {
      var meta_field_name = meta_field_names[i];

__.lineno = 2;
__.lineno = 4;
buf.push('<td');
buf.push(attrs({ "class": ("" + (meta_field_name) + "-cell") }));
buf.push('>');
__.lineno = undefined;
__.lineno = 4;
if(i == 0)
{
__.lineno = 5;
__.lineno = 5;
buf.push('<button');
buf.push(attrs({ "class": ('delete-post') }));
buf.push('>');
buf.push('&times;');
__.lineno = undefined;
buf.push('</button>');
__.lineno = 6;
buf.push('<a');
buf.push(attrs({ 'href':("#/update/post/" + (_id) + "") }));
buf.push('>');
var __val__ = locals[meta_field_name]
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</a>');
}
else
{
__.lineno = 8;
__.lineno = 8;
var __val__ = locals[meta_field_name]
buf.push(null == __val__ ? "" : __val__);
}
buf.push('</td>');
   }
  }
}).call(this);

buf.push('</tr>');}return buf.join("");
} catch (err) {
  rethrow(err, __.input, __.filename, __.lineno);
}
};}, "templates/admin/post": function(exports, require, module) {module.exports = function anonymous(locals) {
var __ = { lineno: 1, input: ".errors\nform\n    - each form_field in form_fields\n        -value = locals[\"values\"] ? values[form_field.name] : ''\n        != form_field.render(value)\n\n    -if(locals[\"extra_fields\"])\n        -each field in extra_fields\n            != field\n\n\n    .multisection-field.multisection-field-post-content(data-field-name=\"post_content\")\n        h1 Post Content\n        .lang-titles\n            h2.en-lang-title English\n            h2.fr-CA-lang-title French\n        .multisection-parts\n            -if(locals[\"values\"])\n                -each v,k in values.post_content\n                    .multisection-part\n                        .en-multisection-part\n                            .form-field\n                                label(for=\"body-title-section-en\") Section title\n                                input.section-title-en(id=\"body-title-section-en\",name=\"localized-field--section_title--en\",value=v.section_title[0].raw)\n\n                            .form-field\n                                label(for=\"body-content-section-en\") Section content\n                                textarea.section-content-en(id=\"body-content-section-en\",name=\"localized-field--section_body--en\")= v.section_body[0].raw\n\n                        .fr-CA-multisection-part\n                            .form-field\n                                label(for=\"body-title-section-fr-CA\") Section title\n                                input.section-title-fr-CA(id=\"body-title-section-fr-CA\",name=\"localized-field--section_title--fr-CA\",value=v.section_title[1].raw)\n\n                            .form-field\n                                label(for=\"body-content-section-fr-CA\") Section content\n                                textarea.section-content-fr-CA(id=\"body-content-section-fr-CA\",name=\"localized-field--section_body--fr-CA\")= v.section_body[1].raw\n\n                        a(href=\"#\").remove-multisection-part &times;\n            -else\n                .multisection-part\n                    .en-multisection-part\n                        .form-field\n                            label(for=\"body-title-section-en\") Section title\n                            input.section-title-en(id=\"body-title-section-en\",name=\"localized-field--section_title--en\")\n\n                        .form-field\n                            label(for=\"body-content-section-en\") Section content\n                            textarea.section-content-en(id=\"body-content-section-en\",name=\"localized-field--section_body--en\")\n\n                    .fr-CA-multisection-part\n                        .form-field\n                            label(for=\"body-title-section-fr-CA\") Section title\n                            input.section-title-fr-CA(id=\"body-title-section-fr-CA\",name=\"localized-field--section_title--fr-CA\")\n\n                        .form-field\n                            label(for=\"body-content-section-fr-CA\") Section content\n                            textarea.section-content-fr-CA(id=\"body-content-section-fr-CA\",name=\"localized-field--section_body--fr-CA\")\n\n                    a(href=\"#\").remove-multisection-part &times;\n        a(href=\"#\").add-multisection-part +\n\n    button(type=\"submit\")!= form_submit_label\n", filename: undefined };
function rethrow(err, str, filename, lineno){
  var context = 3
    , lines = str.split('\n')
    , start = Math.max(lineno - context, 0)
    , end = Math.min(lines.length, lineno + context); 

  // Error context
  var context = lines.slice(start, end).map(function(line, i){
    var curr = i + start + 1;
    return (curr == lineno ? '  > ' : '    ')
      + curr
      + '| '
      + line;
  }).join('\n');

  // Alter exception message
  err.path = filename;
  err.message = (filename || 'Jade') + ':' + lineno 
    + '\n' + context + '\n\n' + err.message;
  throw err;
}
try {
function attrs(obj){
  var buf = []
    , terse = obj.terse;
  delete obj.terse;
  var keys = Object.keys(obj)
    , len = keys.length;
  if (len) {
    buf.push('');
    for (var i = 0; i < len; ++i) {
      var key = keys[i]
        , val = obj[key];
      if ('boolean' == typeof val || null == val) {
        if (val) {
          terse
            ? buf.push(key)
            : buf.push(key + '="' + key + '"');
        }
      } else if ('class' == key && Array.isArray(val)) {
        buf.push(key + '="' + escape(val.join(' ')) + '"');
      } else {
        buf.push(key + '="' + escape(val) + '"');
      }
    }
  }
  return buf.join(' ');
}

function escape(html){
  return String(html)
    .replace(/&(?!\w+;)/g, '&amp;')
    .replace(/</g, '&lt;')
    .replace(/>/g, '&gt;')
    .replace(/"/g, '&quot;');
}

var buf = [];
with (locals || {}) {__.lineno = 1;
__.lineno = 1;
buf.push('<div');
buf.push(attrs({ "class": ('errors') }));
buf.push('>');
__.lineno = undefined;
buf.push('</div>');
__.lineno = 3;
buf.push('<form>');
__.lineno = undefined;
__.lineno = 7;
// iterate form_fields
(function(){
  if ('number' == typeof form_fields.length) {
    for (var index = 0, $$l = form_fields.length; index < $$l; index++) {
      var form_field = form_fields[index];

__.lineno = 3;
__.lineno = 4;
value = locals["values"] ? values[form_field.name] : ''
__.lineno = 5;
var __val__ = form_field.render(value)
buf.push(null == __val__ ? "" : __val__);
    }
  } else {
    for (var index in form_fields) {
      var form_field = form_fields[index];

__.lineno = 3;
__.lineno = 4;
value = locals["values"] ? values[form_field.name] : ''
__.lineno = 5;
var __val__ = form_field.render(value)
buf.push(null == __val__ ? "" : __val__);
   }
  }
}).call(this);

__.lineno = 7;
if(locals["extra_fields"])
{
__.lineno = 8;
__.lineno = 12;
// iterate extra_fields
(function(){
  if ('number' == typeof extra_fields.length) {
    for (var index = 0, $$l = extra_fields.length; index < $$l; index++) {
      var field = extra_fields[index];

__.lineno = 8;
__.lineno = 9;
var __val__ = field
buf.push(null == __val__ ? "" : __val__);
    }
  } else {
    for (var index in extra_fields) {
      var field = extra_fields[index];

__.lineno = 8;
__.lineno = 9;
var __val__ = field
buf.push(null == __val__ ? "" : __val__);
   }
  }
}).call(this);

}
__.lineno = 12;
buf.push('<div');
buf.push(attrs({ 'data-field-name':("post_content"), "class": ('multisection-field') + ' ' + ('multisection-field-post-content') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 13;
buf.push('<h1>');
buf.push('Post Content');
__.lineno = undefined;
buf.push('</h1>');
__.lineno = 14;
buf.push('<div');
buf.push(attrs({ "class": ('lang-titles') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 15;
buf.push('<h2');
buf.push(attrs({ "class": ('en-lang-title') }));
buf.push('>');
buf.push('English');
__.lineno = undefined;
buf.push('</h2>');
__.lineno = 16;
buf.push('<h2');
buf.push(attrs({ "class": ('fr-CA-lang-title') }));
buf.push('>');
buf.push('French');
__.lineno = undefined;
buf.push('</h2>');
buf.push('</div>');
__.lineno = 17;
buf.push('<div');
buf.push(attrs({ "class": ('multisection-parts') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 18;
if(locals["values"])
{
__.lineno = 19;
__.lineno = 40;
// iterate values.post_content
(function(){
  if ('number' == typeof values.post_content.length) {
    for (var k = 0, $$l = values.post_content.length; k < $$l; k++) {
      var v = values.post_content[k];

__.lineno = 19;
__.lineno = 20;
buf.push('<div');
buf.push(attrs({ "class": ('multisection-part') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 21;
buf.push('<div');
buf.push(attrs({ "class": ('en-multisection-part') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 22;
buf.push('<div');
buf.push(attrs({ "class": ('form-field') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 23;
buf.push('<label');
buf.push(attrs({ 'for':("body-title-section-en") }));
buf.push('>');
buf.push('Section title');
__.lineno = undefined;
buf.push('</label>');
__.lineno = 24;
buf.push('<input');
buf.push(attrs({ 'id':("body-title-section-en"), 'name':("localized-field--section_title--en"), 'value':(v.section_title[0].raw), "class": ('section-title-en') }));
buf.push('/>');
buf.push('</div>');
__.lineno = 26;
buf.push('<div');
buf.push(attrs({ "class": ('form-field') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 27;
buf.push('<label');
buf.push(attrs({ 'for':("body-content-section-en") }));
buf.push('>');
buf.push('Section content');
__.lineno = undefined;
buf.push('</label>');
__.lineno = 28;
buf.push('<textarea');
buf.push(attrs({ 'id':("body-content-section-en"), 'name':("localized-field--section_body--en"), "class": ('section-content-en') }));
buf.push('>');
var __val__ = v.section_body[0].raw
buf.push(escape(null == __val__ ? "" : __val__));
__.lineno = undefined;
buf.push('</textarea>');
buf.push('</div>');
buf.push('</div>');
__.lineno = 30;
buf.push('<div');
buf.push(attrs({ "class": ('fr-CA-multisection-part') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 31;
buf.push('<div');
buf.push(attrs({ "class": ('form-field') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 32;
buf.push('<label');
buf.push(attrs({ 'for':("body-title-section-fr-CA") }));
buf.push('>');
buf.push('Section title');
__.lineno = undefined;
buf.push('</label>');
__.lineno = 33;
buf.push('<input');
buf.push(attrs({ 'id':("body-title-section-fr-CA"), 'name':("localized-field--section_title--fr-CA"), 'value':(v.section_title[1].raw), "class": ('section-title-fr-CA') }));
buf.push('/>');
buf.push('</div>');
__.lineno = 35;
buf.push('<div');
buf.push(attrs({ "class": ('form-field') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 36;
buf.push('<label');
buf.push(attrs({ 'for':("body-content-section-fr-CA") }));
buf.push('>');
buf.push('Section content');
__.lineno = undefined;
buf.push('</label>');
__.lineno = 37;
buf.push('<textarea');
buf.push(attrs({ 'id':("body-content-section-fr-CA"), 'name':("localized-field--section_body--fr-CA"), "class": ('section-content-fr-CA') }));
buf.push('>');
var __val__ = v.section_body[1].raw
buf.push(escape(null == __val__ ? "" : __val__));
__.lineno = undefined;
buf.push('</textarea>');
buf.push('</div>');
buf.push('</div>');
__.lineno = 39;
buf.push('<a');
buf.push(attrs({ 'href':("#"), "class": ('remove-multisection-part') }));
buf.push('>');
buf.push('&times;');
__.lineno = undefined;
buf.push('</a>');
buf.push('</div>');
    }
  } else {
    for (var k in values.post_content) {
      var v = values.post_content[k];

__.lineno = 19;
__.lineno = 20;
buf.push('<div');
buf.push(attrs({ "class": ('multisection-part') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 21;
buf.push('<div');
buf.push(attrs({ "class": ('en-multisection-part') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 22;
buf.push('<div');
buf.push(attrs({ "class": ('form-field') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 23;
buf.push('<label');
buf.push(attrs({ 'for':("body-title-section-en") }));
buf.push('>');
buf.push('Section title');
__.lineno = undefined;
buf.push('</label>');
__.lineno = 24;
buf.push('<input');
buf.push(attrs({ 'id':("body-title-section-en"), 'name':("localized-field--section_title--en"), 'value':(v.section_title[0].raw), "class": ('section-title-en') }));
buf.push('/>');
buf.push('</div>');
__.lineno = 26;
buf.push('<div');
buf.push(attrs({ "class": ('form-field') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 27;
buf.push('<label');
buf.push(attrs({ 'for':("body-content-section-en") }));
buf.push('>');
buf.push('Section content');
__.lineno = undefined;
buf.push('</label>');
__.lineno = 28;
buf.push('<textarea');
buf.push(attrs({ 'id':("body-content-section-en"), 'name':("localized-field--section_body--en"), "class": ('section-content-en') }));
buf.push('>');
var __val__ = v.section_body[0].raw
buf.push(escape(null == __val__ ? "" : __val__));
__.lineno = undefined;
buf.push('</textarea>');
buf.push('</div>');
buf.push('</div>');
__.lineno = 30;
buf.push('<div');
buf.push(attrs({ "class": ('fr-CA-multisection-part') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 31;
buf.push('<div');
buf.push(attrs({ "class": ('form-field') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 32;
buf.push('<label');
buf.push(attrs({ 'for':("body-title-section-fr-CA") }));
buf.push('>');
buf.push('Section title');
__.lineno = undefined;
buf.push('</label>');
__.lineno = 33;
buf.push('<input');
buf.push(attrs({ 'id':("body-title-section-fr-CA"), 'name':("localized-field--section_title--fr-CA"), 'value':(v.section_title[1].raw), "class": ('section-title-fr-CA') }));
buf.push('/>');
buf.push('</div>');
__.lineno = 35;
buf.push('<div');
buf.push(attrs({ "class": ('form-field') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 36;
buf.push('<label');
buf.push(attrs({ 'for':("body-content-section-fr-CA") }));
buf.push('>');
buf.push('Section content');
__.lineno = undefined;
buf.push('</label>');
__.lineno = 37;
buf.push('<textarea');
buf.push(attrs({ 'id':("body-content-section-fr-CA"), 'name':("localized-field--section_body--fr-CA"), "class": ('section-content-fr-CA') }));
buf.push('>');
var __val__ = v.section_body[1].raw
buf.push(escape(null == __val__ ? "" : __val__));
__.lineno = undefined;
buf.push('</textarea>');
buf.push('</div>');
buf.push('</div>');
__.lineno = 39;
buf.push('<a');
buf.push(attrs({ 'href':("#"), "class": ('remove-multisection-part') }));
buf.push('>');
buf.push('&times;');
__.lineno = undefined;
buf.push('</a>');
buf.push('</div>');
   }
  }
}).call(this);

}
else
{
__.lineno = 41;
__.lineno = 41;
buf.push('<div');
buf.push(attrs({ "class": ('multisection-part') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 42;
buf.push('<div');
buf.push(attrs({ "class": ('en-multisection-part') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 43;
buf.push('<div');
buf.push(attrs({ "class": ('form-field') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 44;
buf.push('<label');
buf.push(attrs({ 'for':("body-title-section-en") }));
buf.push('>');
buf.push('Section title');
__.lineno = undefined;
buf.push('</label>');
__.lineno = 45;
buf.push('<input');
buf.push(attrs({ 'id':("body-title-section-en"), 'name':("localized-field--section_title--en"), "class": ('section-title-en') }));
buf.push('/>');
buf.push('</div>');
__.lineno = 47;
buf.push('<div');
buf.push(attrs({ "class": ('form-field') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 48;
buf.push('<label');
buf.push(attrs({ 'for':("body-content-section-en") }));
buf.push('>');
buf.push('Section content');
__.lineno = undefined;
buf.push('</label>');
__.lineno = 49;
buf.push('<textarea');
buf.push(attrs({ 'id':("body-content-section-en"), 'name':("localized-field--section_body--en"), "class": ('section-content-en') }));
buf.push('>');
__.lineno = undefined;
buf.push('</textarea>');
buf.push('</div>');
buf.push('</div>');
__.lineno = 51;
buf.push('<div');
buf.push(attrs({ "class": ('fr-CA-multisection-part') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 52;
buf.push('<div');
buf.push(attrs({ "class": ('form-field') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 53;
buf.push('<label');
buf.push(attrs({ 'for':("body-title-section-fr-CA") }));
buf.push('>');
buf.push('Section title');
__.lineno = undefined;
buf.push('</label>');
__.lineno = 54;
buf.push('<input');
buf.push(attrs({ 'id':("body-title-section-fr-CA"), 'name':("localized-field--section_title--fr-CA"), "class": ('section-title-fr-CA') }));
buf.push('/>');
buf.push('</div>');
__.lineno = 56;
buf.push('<div');
buf.push(attrs({ "class": ('form-field') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 57;
buf.push('<label');
buf.push(attrs({ 'for':("body-content-section-fr-CA") }));
buf.push('>');
buf.push('Section content');
__.lineno = undefined;
buf.push('</label>');
__.lineno = 58;
buf.push('<textarea');
buf.push(attrs({ 'id':("body-content-section-fr-CA"), 'name':("localized-field--section_body--fr-CA"), "class": ('section-content-fr-CA') }));
buf.push('>');
__.lineno = undefined;
buf.push('</textarea>');
buf.push('</div>');
buf.push('</div>');
__.lineno = 60;
buf.push('<a');
buf.push(attrs({ 'href':("#"), "class": ('remove-multisection-part') }));
buf.push('>');
buf.push('&times;');
__.lineno = undefined;
buf.push('</a>');
buf.push('</div>');
}
buf.push('</div>');
__.lineno = 61;
buf.push('<a');
buf.push(attrs({ 'href':("#"), "class": ('add-multisection-part') }));
buf.push('>');
buf.push('+');
__.lineno = undefined;
buf.push('</a>');
buf.push('</div>');
__.lineno = 63;
buf.push('<button');
buf.push(attrs({ 'type':("submit") }));
buf.push('>');
var __val__ = form_submit_label
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</button>');
buf.push('</form>');}return buf.join("");
} catch (err) {
  rethrow(err, __.input, __.filename, __.lineno);
}
};}, "templates/admin/update_post": function(exports, require, module) {module.exports = function anonymous(locals) {
var __ = { lineno: 1, input: ".errors\nform(action=form_action,method=form_method)\n    - each form_field in form_fields\n        -if(form_field.render)\n            -existing_data = locals[form_field.input_name]\n            != form_field.render(existing_data)\n        -else\n            != form_field\n\n    -if(form_method == \"put\")\n        input(type=\"hidden\",name=\"_method\",value=\"PUT\")\n    button(type=\"submit\")!= form_submit_label\n", filename: undefined };
function rethrow(err, str, filename, lineno){
  var context = 3
    , lines = str.split('\n')
    , start = Math.max(lineno - context, 0)
    , end = Math.min(lines.length, lineno + context); 

  // Error context
  var context = lines.slice(start, end).map(function(line, i){
    var curr = i + start + 1;
    return (curr == lineno ? '  > ' : '    ')
      + curr
      + '| '
      + line;
  }).join('\n');

  // Alter exception message
  err.path = filename;
  err.message = (filename || 'Jade') + ':' + lineno 
    + '\n' + context + '\n\n' + err.message;
  throw err;
}
try {
function attrs(obj){
  var buf = []
    , terse = obj.terse;
  delete obj.terse;
  var keys = Object.keys(obj)
    , len = keys.length;
  if (len) {
    buf.push('');
    for (var i = 0; i < len; ++i) {
      var key = keys[i]
        , val = obj[key];
      if ('boolean' == typeof val || null == val) {
        if (val) {
          terse
            ? buf.push(key)
            : buf.push(key + '="' + key + '"');
        }
      } else if ('class' == key && Array.isArray(val)) {
        buf.push(key + '="' + escape(val.join(' ')) + '"');
      } else {
        buf.push(key + '="' + escape(val) + '"');
      }
    }
  }
  return buf.join(' ');
}

function escape(html){
  return String(html)
    .replace(/&(?!\w+;)/g, '&amp;')
    .replace(/</g, '&lt;')
    .replace(/>/g, '&gt;')
    .replace(/"/g, '&quot;');
}

var buf = [];
with (locals || {}) {__.lineno = 1;
__.lineno = 1;
buf.push('<div');
buf.push(attrs({ "class": ('errors') }));
buf.push('>');
__.lineno = undefined;
buf.push('</div>');
__.lineno = 3;
buf.push('<form');
buf.push(attrs({ 'action':(form_action), 'method':(form_method) }));
buf.push('>');
__.lineno = undefined;
__.lineno = 10;
// iterate form_fields
(function(){
  if ('number' == typeof form_fields.length) {
    for (var index = 0, $$l = form_fields.length; index < $$l; index++) {
      var form_field = form_fields[index];

__.lineno = 3;
__.lineno = 4;
if(form_field.render)
{
__.lineno = 5;
__.lineno = 5;
existing_data = locals[form_field.input_name]
__.lineno = 6;
var __val__ = form_field.render(existing_data)
buf.push(null == __val__ ? "" : __val__);
}
else
{
__.lineno = 8;
__.lineno = 8;
var __val__ = form_field
buf.push(null == __val__ ? "" : __val__);
}
    }
  } else {
    for (var index in form_fields) {
      var form_field = form_fields[index];

__.lineno = 3;
__.lineno = 4;
if(form_field.render)
{
__.lineno = 5;
__.lineno = 5;
existing_data = locals[form_field.input_name]
__.lineno = 6;
var __val__ = form_field.render(existing_data)
buf.push(null == __val__ ? "" : __val__);
}
else
{
__.lineno = 8;
__.lineno = 8;
var __val__ = form_field
buf.push(null == __val__ ? "" : __val__);
}
   }
  }
}).call(this);

__.lineno = 10;
if(form_method == "put")
{
__.lineno = 11;
__.lineno = 12;
buf.push('<input');
buf.push(attrs({ 'type':("hidden"), 'name':("_method"), 'value':("PUT") }));
buf.push('/>');
}
__.lineno = 12;
buf.push('<button');
buf.push(attrs({ 'type':("submit") }));
buf.push('>');
var __val__ = form_submit_label
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</button>');
buf.push('</form>');}return buf.join("");
} catch (err) {
  rethrow(err, __.input, __.filename, __.lineno);
}
};}, "templates/base_table": function(exports, require, module) {module.exports = function anonymous(locals) {
var __ = { lineno: 1, input: "header\n    -if(locals[\"table_label\"])\n        h1.table-label!= window._i(table_label)\n    -if(locals[\"table_icon_url\"])\n        img.table-icon(src=table_icon_url)\ntable\n    thead\n        tr\n            -each column_label,column_name in column_names\n                    th(class=\"#{column_name}-cell\")!= column_label\n    tbody\n        -each row in rows\n            tr\n                -each column_label,column_name in column_names\n                    td(class=\"#{column_name}-cell\")!= window._i(row[column_name])\n", filename: undefined };
function rethrow(err, str, filename, lineno){
  var context = 3
    , lines = str.split('\n')
    , start = Math.max(lineno - context, 0)
    , end = Math.min(lines.length, lineno + context); 

  // Error context
  var context = lines.slice(start, end).map(function(line, i){
    var curr = i + start + 1;
    return (curr == lineno ? '  > ' : '    ')
      + curr
      + '| '
      + line;
  }).join('\n');

  // Alter exception message
  err.path = filename;
  err.message = (filename || 'Jade') + ':' + lineno 
    + '\n' + context + '\n\n' + err.message;
  throw err;
}
try {
function attrs(obj){
  var buf = []
    , terse = obj.terse;
  delete obj.terse;
  var keys = Object.keys(obj)
    , len = keys.length;
  if (len) {
    buf.push('');
    for (var i = 0; i < len; ++i) {
      var key = keys[i]
        , val = obj[key];
      if ('boolean' == typeof val || null == val) {
        if (val) {
          terse
            ? buf.push(key)
            : buf.push(key + '="' + key + '"');
        }
      } else if ('class' == key && Array.isArray(val)) {
        buf.push(key + '="' + escape(val.join(' ')) + '"');
      } else {
        buf.push(key + '="' + escape(val) + '"');
      }
    }
  }
  return buf.join(' ');
}

function escape(html){
  return String(html)
    .replace(/&(?!\w+;)/g, '&amp;')
    .replace(/</g, '&lt;')
    .replace(/>/g, '&gt;')
    .replace(/"/g, '&quot;');
}

var buf = [];
with (locals || {}) {__.lineno = 1;
__.lineno = 2;
buf.push('<header>');
__.lineno = undefined;
__.lineno = 2;
if(locals["table_label"])
{
__.lineno = 3;
__.lineno = 3;
buf.push('<h1');
buf.push(attrs({ "class": ('table-label') }));
buf.push('>');
var __val__ = window._i(table_label)
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</h1>');
}
__.lineno = 4;
if(locals["table_icon_url"])
{
__.lineno = 5;
__.lineno = 5;
buf.push('<img');
buf.push(attrs({ 'src':(table_icon_url), "class": ('table-icon') }));
buf.push('/>');
}
buf.push('</header>');
__.lineno = 7;
buf.push('<table>');
__.lineno = undefined;
__.lineno = 8;
buf.push('<thead>');
__.lineno = undefined;
__.lineno = 9;
buf.push('<tr>');
__.lineno = undefined;
__.lineno = 11;
// iterate column_names
(function(){
  if ('number' == typeof column_names.length) {
    for (var column_name = 0, $$l = column_names.length; column_name < $$l; column_name++) {
      var column_label = column_names[column_name];

__.lineno = 9;
__.lineno = 10;
buf.push('<th');
buf.push(attrs({ "class": ("" + (column_name) + "-cell") }));
buf.push('>');
var __val__ = column_label
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</th>');
    }
  } else {
    for (var column_name in column_names) {
      var column_label = column_names[column_name];

__.lineno = 9;
__.lineno = 10;
buf.push('<th');
buf.push(attrs({ "class": ("" + (column_name) + "-cell") }));
buf.push('>');
var __val__ = column_label
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</th>');
   }
  }
}).call(this);

buf.push('</tr>');
buf.push('</thead>');
__.lineno = 12;
buf.push('<tbody>');
__.lineno = undefined;
__.lineno = 16;
// iterate rows
(function(){
  if ('number' == typeof rows.length) {
    for (var index = 0, $$l = rows.length; index < $$l; index++) {
      var row = rows[index];

__.lineno = 12;
__.lineno = 14;
buf.push('<tr>');
__.lineno = undefined;
__.lineno = 16;
// iterate column_names
(function(){
  if ('number' == typeof column_names.length) {
    for (var column_name = 0, $$l = column_names.length; column_name < $$l; column_name++) {
      var column_label = column_names[column_name];

__.lineno = 14;
__.lineno = 15;
buf.push('<td');
buf.push(attrs({ "class": ("" + (column_name) + "-cell") }));
buf.push('>');
var __val__ = window._i(row[column_name])
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</td>');
    }
  } else {
    for (var column_name in column_names) {
      var column_label = column_names[column_name];

__.lineno = 14;
__.lineno = 15;
buf.push('<td');
buf.push(attrs({ "class": ("" + (column_name) + "-cell") }));
buf.push('>');
var __val__ = window._i(row[column_name])
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</td>');
   }
  }
}).call(this);

buf.push('</tr>');
    }
  } else {
    for (var index in rows) {
      var row = rows[index];

__.lineno = 12;
__.lineno = 14;
buf.push('<tr>');
__.lineno = undefined;
__.lineno = 16;
// iterate column_names
(function(){
  if ('number' == typeof column_names.length) {
    for (var column_name = 0, $$l = column_names.length; column_name < $$l; column_name++) {
      var column_label = column_names[column_name];

__.lineno = 14;
__.lineno = 15;
buf.push('<td');
buf.push(attrs({ "class": ("" + (column_name) + "-cell") }));
buf.push('>');
var __val__ = window._i(row[column_name])
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</td>');
    }
  } else {
    for (var column_name in column_names) {
      var column_label = column_names[column_name];

__.lineno = 14;
__.lineno = 15;
buf.push('<td');
buf.push(attrs({ "class": ("" + (column_name) + "-cell") }));
buf.push('>');
var __val__ = window._i(row[column_name])
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</td>');
   }
  }
}).call(this);

buf.push('</tr>');
   }
  }
}).call(this);

buf.push('</tbody>');
buf.push('</table>');}return buf.join("");
} catch (err) {
  rethrow(err, __.input, __.filename, __.lineno);
}
};}, "templates/generic_box": function(exports, require, module) {module.exports = function anonymous(locals) {
var __ = { lineno: 1, input: "", filename: undefined };
function rethrow(err, str, filename, lineno){
  var context = 3
    , lines = str.split('\n')
    , start = Math.max(lineno - context, 0)
    , end = Math.min(lines.length, lineno + context); 

  // Error context
  var context = lines.slice(start, end).map(function(line, i){
    var curr = i + start + 1;
    return (curr == lineno ? '  > ' : '    ')
      + curr
      + '| '
      + line;
  }).join('\n');

  // Alter exception message
  err.path = filename;
  err.message = (filename || 'Jade') + ':' + lineno 
    + '\n' + context + '\n\n' + err.message;
  throw err;
}
try {
function attrs(obj){
  var buf = []
    , terse = obj.terse;
  delete obj.terse;
  var keys = Object.keys(obj)
    , len = keys.length;
  if (len) {
    buf.push('');
    for (var i = 0; i < len; ++i) {
      var key = keys[i]
        , val = obj[key];
      if ('boolean' == typeof val || null == val) {
        if (val) {
          terse
            ? buf.push(key)
            : buf.push(key + '="' + key + '"');
        }
      } else if ('class' == key && Array.isArray(val)) {
        buf.push(key + '="' + escape(val.join(' ')) + '"');
      } else {
        buf.push(key + '="' + escape(val) + '"');
      }
    }
  }
  return buf.join(' ');
}

function escape(html){
  return String(html)
    .replace(/&(?!\w+;)/g, '&amp;')
    .replace(/</g, '&lt;')
    .replace(/>/g, '&gt;')
    .replace(/"/g, '&quot;');
}

var buf = [];
with (locals || {}) {__.lineno = 1;}return buf.join("");
} catch (err) {
  rethrow(err, __.input, __.filename, __.lineno);
}
};}, "templates/menu_item": function(exports, require, module) {module.exports = function anonymous(locals) {
var __ = { lineno: 1, input: "li(class=className)\n    -if(url_target)\n        a.the-button.thin-menu-item.typo-brand(href=url_target)\n            span.the-label!= window._i(label)\n    -else\n        a.the-button.thin-menu-item.typo-brand\n            span.the-label!= window._i(label)\n", filename: undefined };
function rethrow(err, str, filename, lineno){
  var context = 3
    , lines = str.split('\n')
    , start = Math.max(lineno - context, 0)
    , end = Math.min(lines.length, lineno + context); 

  // Error context
  var context = lines.slice(start, end).map(function(line, i){
    var curr = i + start + 1;
    return (curr == lineno ? '  > ' : '    ')
      + curr
      + '| '
      + line;
  }).join('\n');

  // Alter exception message
  err.path = filename;
  err.message = (filename || 'Jade') + ':' + lineno 
    + '\n' + context + '\n\n' + err.message;
  throw err;
}
try {
function attrs(obj){
  var buf = []
    , terse = obj.terse;
  delete obj.terse;
  var keys = Object.keys(obj)
    , len = keys.length;
  if (len) {
    buf.push('');
    for (var i = 0; i < len; ++i) {
      var key = keys[i]
        , val = obj[key];
      if ('boolean' == typeof val || null == val) {
        if (val) {
          terse
            ? buf.push(key)
            : buf.push(key + '="' + key + '"');
        }
      } else if ('class' == key && Array.isArray(val)) {
        buf.push(key + '="' + escape(val.join(' ')) + '"');
      } else {
        buf.push(key + '="' + escape(val) + '"');
      }
    }
  }
  return buf.join(' ');
}

function escape(html){
  return String(html)
    .replace(/&(?!\w+;)/g, '&amp;')
    .replace(/</g, '&lt;')
    .replace(/>/g, '&gt;')
    .replace(/"/g, '&quot;');
}

var buf = [];
with (locals || {}) {__.lineno = 1;
__.lineno = 2;
buf.push('<li');
buf.push(attrs({ "class": (className) }));
buf.push('>');
__.lineno = undefined;
__.lineno = 2;
if(url_target)
{
__.lineno = 3;
__.lineno = 3;
buf.push('<a');
buf.push(attrs({ 'href':(url_target), "class": ('the-button') + ' ' + ('thin-menu-item') + ' ' + ('typo-brand') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 4;
buf.push('<span');
buf.push(attrs({ "class": ('the-label') }));
buf.push('>');
var __val__ = window._i(label)
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</span>');
buf.push('</a>');
}
else
{
__.lineno = 6;
__.lineno = 6;
buf.push('<a');
buf.push(attrs({ "class": ('the-button') + ' ' + ('thin-menu-item') + ' ' + ('typo-brand') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 7;
buf.push('<span');
buf.push(attrs({ "class": ('the-label') }));
buf.push('>');
var __val__ = window._i(label)
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</span>');
buf.push('</a>');
}
buf.push('</li>');}return buf.join("");
} catch (err) {
  rethrow(err, __.input, __.filename, __.lineno);
}
};}, "templates/nexus": function(exports, require, module) {module.exports = function anonymous(locals) {
var __ = { lineno: 1, input: "", filename: undefined };
function rethrow(err, str, filename, lineno){
  var context = 3
    , lines = str.split('\n')
    , start = Math.max(lineno - context, 0)
    , end = Math.min(lines.length, lineno + context); 

  // Error context
  var context = lines.slice(start, end).map(function(line, i){
    var curr = i + start + 1;
    return (curr == lineno ? '  > ' : '    ')
      + curr
      + '| '
      + line;
  }).join('\n');

  // Alter exception message
  err.path = filename;
  err.message = (filename || 'Jade') + ':' + lineno 
    + '\n' + context + '\n\n' + err.message;
  throw err;
}
try {
function attrs(obj){
  var buf = []
    , terse = obj.terse;
  delete obj.terse;
  var keys = Object.keys(obj)
    , len = keys.length;
  if (len) {
    buf.push('');
    for (var i = 0; i < len; ++i) {
      var key = keys[i]
        , val = obj[key];
      if ('boolean' == typeof val || null == val) {
        if (val) {
          terse
            ? buf.push(key)
            : buf.push(key + '="' + key + '"');
        }
      } else if ('class' == key && Array.isArray(val)) {
        buf.push(key + '="' + escape(val.join(' ')) + '"');
      } else {
        buf.push(key + '="' + escape(val) + '"');
      }
    }
  }
  return buf.join(' ');
}

function escape(html){
  return String(html)
    .replace(/&(?!\w+;)/g, '&amp;')
    .replace(/</g, '&lt;')
    .replace(/>/g, '&gt;')
    .replace(/"/g, '&quot;');
}

var buf = [];
with (locals || {}) {__.lineno = 1;}return buf.join("");
} catch (err) {
  rethrow(err, __.input, __.filename, __.lineno);
}
};}, "templates/photo_box": function(exports, require, module) {module.exports = function anonymous(locals) {
var __ = { lineno: 1, input: "//.type-dot(data-target=branch)\n//  img(src=\"/images/#{branch}_dot.png\")\na(href=\"#/post/#{_id}\")\n    img(id=primary_photo.id, src=primary_photo_poster_url, class=\"post-primary-photo #{primary_photo_orientation}\")\n.copy-container.dark-zone.post-overlay-description\n    h1: a(href=\"#/post/#{_id}\")!= title[0].all_parsed\n\n", filename: undefined };
function rethrow(err, str, filename, lineno){
  var context = 3
    , lines = str.split('\n')
    , start = Math.max(lineno - context, 0)
    , end = Math.min(lines.length, lineno + context); 

  // Error context
  var context = lines.slice(start, end).map(function(line, i){
    var curr = i + start + 1;
    return (curr == lineno ? '  > ' : '    ')
      + curr
      + '| '
      + line;
  }).join('\n');

  // Alter exception message
  err.path = filename;
  err.message = (filename || 'Jade') + ':' + lineno 
    + '\n' + context + '\n\n' + err.message;
  throw err;
}
try {
function attrs(obj){
  var buf = []
    , terse = obj.terse;
  delete obj.terse;
  var keys = Object.keys(obj)
    , len = keys.length;
  if (len) {
    buf.push('');
    for (var i = 0; i < len; ++i) {
      var key = keys[i]
        , val = obj[key];
      if ('boolean' == typeof val || null == val) {
        if (val) {
          terse
            ? buf.push(key)
            : buf.push(key + '="' + key + '"');
        }
      } else if ('class' == key && Array.isArray(val)) {
        buf.push(key + '="' + escape(val.join(' ')) + '"');
      } else {
        buf.push(key + '="' + escape(val) + '"');
      }
    }
  }
  return buf.join(' ');
}

function escape(html){
  return String(html)
    .replace(/&(?!\w+;)/g, '&amp;')
    .replace(/</g, '&lt;')
    .replace(/>/g, '&gt;')
    .replace(/"/g, '&quot;');
}

var buf = [];
with (locals || {}) {__.lineno = 1;
__.lineno = 2;
buf.push('<!--.type-dot(data-target=branch)-->');
__.lineno = 3;
buf.push('<!--  img(src="/images/#{branch}_dot.png")-->');
__.lineno = 4;
buf.push('<a');
buf.push(attrs({ 'href':("#/post/" + (_id) + "") }));
buf.push('>');
__.lineno = undefined;
__.lineno = 5;
buf.push('<img');
buf.push(attrs({ 'id':(primary_photo.id), 'src':(primary_photo_poster_url), "class": ("post-primary-photo " + (primary_photo_orientation) + "") }));
buf.push('/>');
buf.push('</a>');
__.lineno = 5;
buf.push('<div');
buf.push(attrs({ "class": ('copy-container') + ' ' + ('dark-zone') + ' ' + ('post-overlay-description') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 6;
buf.push('<h1>');
__.lineno = undefined;
__.lineno = 6;
buf.push('<a');
buf.push(attrs({ 'href':("#/post/" + (_id) + "") }));
buf.push('>');
var __val__ = title[0].all_parsed
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</a>');
buf.push('</h1>');
buf.push('</div>');}return buf.join("");
} catch (err) {
  rethrow(err, __.input, __.filename, __.lineno);
}
};}, "templates/photo_plain_box": function(exports, require, module) {module.exports = function anonymous(locals) {
var __ = { lineno: 1, input: "//.type-dot(data-target=branch)\n//  img(src=\"/images/#{branch}_dot.png\")\na(href=url_target)\n    img(id=primary_photo.id, src=primary_photo_poster_url, title=primary_photo.title, class=\"post-primary-photo #{primary_photo_orientation}\")\n    .copy-container!= post_summary[0].all_parsed\n\n\n\n", filename: undefined };
function rethrow(err, str, filename, lineno){
  var context = 3
    , lines = str.split('\n')
    , start = Math.max(lineno - context, 0)
    , end = Math.min(lines.length, lineno + context); 

  // Error context
  var context = lines.slice(start, end).map(function(line, i){
    var curr = i + start + 1;
    return (curr == lineno ? '  > ' : '    ')
      + curr
      + '| '
      + line;
  }).join('\n');

  // Alter exception message
  err.path = filename;
  err.message = (filename || 'Jade') + ':' + lineno 
    + '\n' + context + '\n\n' + err.message;
  throw err;
}
try {
function attrs(obj){
  var buf = []
    , terse = obj.terse;
  delete obj.terse;
  var keys = Object.keys(obj)
    , len = keys.length;
  if (len) {
    buf.push('');
    for (var i = 0; i < len; ++i) {
      var key = keys[i]
        , val = obj[key];
      if ('boolean' == typeof val || null == val) {
        if (val) {
          terse
            ? buf.push(key)
            : buf.push(key + '="' + key + '"');
        }
      } else if ('class' == key && Array.isArray(val)) {
        buf.push(key + '="' + escape(val.join(' ')) + '"');
      } else {
        buf.push(key + '="' + escape(val) + '"');
      }
    }
  }
  return buf.join(' ');
}

function escape(html){
  return String(html)
    .replace(/&(?!\w+;)/g, '&amp;')
    .replace(/</g, '&lt;')
    .replace(/>/g, '&gt;')
    .replace(/"/g, '&quot;');
}

var buf = [];
with (locals || {}) {__.lineno = 1;
__.lineno = 2;
buf.push('<!--.type-dot(data-target=branch)-->');
__.lineno = 3;
buf.push('<!--  img(src="/images/#{branch}_dot.png")-->');
__.lineno = 4;
buf.push('<a');
buf.push(attrs({ 'href':(url_target) }));
buf.push('>');
__.lineno = undefined;
__.lineno = 5;
buf.push('<img');
buf.push(attrs({ 'id':(primary_photo.id), 'src':(primary_photo_poster_url), 'title':(primary_photo.title), "class": ("post-primary-photo " + (primary_photo_orientation) + "") }));
buf.push('/>');
__.lineno = 5;
buf.push('<div');
buf.push(attrs({ "class": ('copy-container') }));
buf.push('>');
var __val__ = post_summary[0].all_parsed
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</div>');
buf.push('</a>');}return buf.join("");
} catch (err) {
  rethrow(err, __.input, __.filename, __.lineno);
}
};}, "templates/post": function(exports, require, module) {module.exports = function anonymous(locals) {
var __ = { lineno: 1, input: ".type-dot(data-branch=branch)\n    img(src=\"/images/#{branch}_dot.png\")\n-if(branch == \"architecture\" || branch == \"management\" || branch == \"resdev\")\n    -if(flickr_set) \n        -each photo in flickr_set.photo\n            -if(photo.id==flickr_set.primary)\n                - var use_url = photo.url_m\n                - posteronly = /posteronly/\n                - is_posteronly = posteronly.test(photo.tags) \n                - if(is_posteronly) use_url = photo.url_o\n                a(href=\"#/post/#{_id}\")\n                    img.post-primary-photo(id=photo.id, src=use_url, title=photo.title)\n        .copy-container.dark-zone.post-overlay-description\n            h1: a(href=\"#/post/#{_id}\")!= title\n    -else\n        .copy-container\n            h1: a(href=\"#/post/#{_id}\")!= title\n\n\n-else if(branch == \"updates\")\n    .copy-container\n        h1: a(href=\"#/post/#{_id}\")!= title\n", filename: undefined };
function rethrow(err, str, filename, lineno){
  var context = 3
    , lines = str.split('\n')
    , start = Math.max(lineno - context, 0)
    , end = Math.min(lines.length, lineno + context); 

  // Error context
  var context = lines.slice(start, end).map(function(line, i){
    var curr = i + start + 1;
    return (curr == lineno ? '  > ' : '    ')
      + curr
      + '| '
      + line;
  }).join('\n');

  // Alter exception message
  err.path = filename;
  err.message = (filename || 'Jade') + ':' + lineno 
    + '\n' + context + '\n\n' + err.message;
  throw err;
}
try {
function attrs(obj){
  var buf = []
    , terse = obj.terse;
  delete obj.terse;
  var keys = Object.keys(obj)
    , len = keys.length;
  if (len) {
    buf.push('');
    for (var i = 0; i < len; ++i) {
      var key = keys[i]
        , val = obj[key];
      if ('boolean' == typeof val || null == val) {
        if (val) {
          terse
            ? buf.push(key)
            : buf.push(key + '="' + key + '"');
        }
      } else if ('class' == key && Array.isArray(val)) {
        buf.push(key + '="' + escape(val.join(' ')) + '"');
      } else {
        buf.push(key + '="' + escape(val) + '"');
      }
    }
  }
  return buf.join(' ');
}

function escape(html){
  return String(html)
    .replace(/&(?!\w+;)/g, '&amp;')
    .replace(/</g, '&lt;')
    .replace(/>/g, '&gt;')
    .replace(/"/g, '&quot;');
}

var buf = [];
with (locals || {}) {__.lineno = 1;
__.lineno = 1;
buf.push('<div');
buf.push(attrs({ 'data-branch':(branch), "class": ('type-dot') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 3;
buf.push('<img');
buf.push(attrs({ 'src':("/images/" + (branch) + "_dot.png") }));
buf.push('/>');
buf.push('</div>');
__.lineno = 3;
if(branch == "architecture" || branch == "management" || branch == "resdev")
{
__.lineno = 4;
__.lineno = 4;
if(flickr_set) 
{
__.lineno = 5;
__.lineno = 13;
// iterate flickr_set.photo
(function(){
  if ('number' == typeof flickr_set.photo.length) {
    for (var index = 0, $$l = flickr_set.photo.length; index < $$l; index++) {
      var photo = flickr_set.photo[index];

__.lineno = 5;
__.lineno = 6;
if(photo.id==flickr_set.primary)
{
__.lineno = 7;
__.lineno = 7;
 var use_url = photo.url_m
__.lineno = 8;
 posteronly = /posteronly/
__.lineno = 9;
 is_posteronly = posteronly.test(photo.tags) 
__.lineno = 10;
 if(is_posteronly) use_url = photo.url_o
__.lineno = 12;
buf.push('<a');
buf.push(attrs({ 'href':("#/post/" + (_id) + "") }));
buf.push('>');
__.lineno = undefined;
__.lineno = 12;
buf.push('<img');
buf.push(attrs({ 'id':(photo.id), 'src':(use_url), 'title':(photo.title), "class": ('post-primary-photo') }));
buf.push('/>');
buf.push('</a>');
}
    }
  } else {
    for (var index in flickr_set.photo) {
      var photo = flickr_set.photo[index];

__.lineno = 5;
__.lineno = 6;
if(photo.id==flickr_set.primary)
{
__.lineno = 7;
__.lineno = 7;
 var use_url = photo.url_m
__.lineno = 8;
 posteronly = /posteronly/
__.lineno = 9;
 is_posteronly = posteronly.test(photo.tags) 
__.lineno = 10;
 if(is_posteronly) use_url = photo.url_o
__.lineno = 12;
buf.push('<a');
buf.push(attrs({ 'href':("#/post/" + (_id) + "") }));
buf.push('>');
__.lineno = undefined;
__.lineno = 12;
buf.push('<img');
buf.push(attrs({ 'id':(photo.id), 'src':(use_url), 'title':(photo.title), "class": ('post-primary-photo') }));
buf.push('/>');
buf.push('</a>');
}
   }
  }
}).call(this);

__.lineno = 13;
buf.push('<div');
buf.push(attrs({ "class": ('copy-container') + ' ' + ('dark-zone') + ' ' + ('post-overlay-description') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 14;
buf.push('<h1>');
__.lineno = undefined;
__.lineno = 14;
buf.push('<a');
buf.push(attrs({ 'href':("#/post/" + (_id) + "") }));
buf.push('>');
var __val__ = title
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</a>');
buf.push('</h1>');
buf.push('</div>');
}
else
{
__.lineno = 16;
__.lineno = 16;
buf.push('<div');
buf.push(attrs({ "class": ('copy-container') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 17;
buf.push('<h1>');
__.lineno = undefined;
__.lineno = 17;
buf.push('<a');
buf.push(attrs({ 'href':("#/post/" + (_id) + "") }));
buf.push('>');
var __val__ = title
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</a>');
buf.push('</h1>');
buf.push('</div>');
}
}
else if(branch == "updates")
{
__.lineno = 21;
__.lineno = 21;
buf.push('<div');
buf.push(attrs({ "class": ('copy-container') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 22;
buf.push('<h1>');
__.lineno = undefined;
__.lineno = 22;
buf.push('<a');
buf.push(attrs({ 'href':("#/post/" + (_id) + "") }));
buf.push('>');
var __val__ = title
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</a>');
buf.push('</h1>');
buf.push('</div>');
}}return buf.join("");
} catch (err) {
  rethrow(err, __.input, __.filename, __.lineno);
}
};}, "templates/sectioned_table": function(exports, require, module) {module.exports = function anonymous(locals) {
var __ = { lineno: 1, input: "header\n    -if(locals[\"table_label\"])\n        h1.table-label!= window._i(table_label)\n    -if(locals[\"table_icon_url\"])\n        img.table-icon(src=table_icon_url)\n\ntable.common-table-header\n    thead\n        tr\n            -each column_label,column_name in column_names\n                th(class=\"#{column_name}-cell\")\n                    != window._i(column_label)\n                    .sorted-graphic\n.table-sections\n", filename: undefined };
function rethrow(err, str, filename, lineno){
  var context = 3
    , lines = str.split('\n')
    , start = Math.max(lineno - context, 0)
    , end = Math.min(lines.length, lineno + context); 

  // Error context
  var context = lines.slice(start, end).map(function(line, i){
    var curr = i + start + 1;
    return (curr == lineno ? '  > ' : '    ')
      + curr
      + '| '
      + line;
  }).join('\n');

  // Alter exception message
  err.path = filename;
  err.message = (filename || 'Jade') + ':' + lineno 
    + '\n' + context + '\n\n' + err.message;
  throw err;
}
try {
function attrs(obj){
  var buf = []
    , terse = obj.terse;
  delete obj.terse;
  var keys = Object.keys(obj)
    , len = keys.length;
  if (len) {
    buf.push('');
    for (var i = 0; i < len; ++i) {
      var key = keys[i]
        , val = obj[key];
      if ('boolean' == typeof val || null == val) {
        if (val) {
          terse
            ? buf.push(key)
            : buf.push(key + '="' + key + '"');
        }
      } else if ('class' == key && Array.isArray(val)) {
        buf.push(key + '="' + escape(val.join(' ')) + '"');
      } else {
        buf.push(key + '="' + escape(val) + '"');
      }
    }
  }
  return buf.join(' ');
}

function escape(html){
  return String(html)
    .replace(/&(?!\w+;)/g, '&amp;')
    .replace(/</g, '&lt;')
    .replace(/>/g, '&gt;')
    .replace(/"/g, '&quot;');
}

var buf = [];
with (locals || {}) {__.lineno = 1;
__.lineno = 2;
buf.push('<header>');
__.lineno = undefined;
__.lineno = 2;
if(locals["table_label"])
{
__.lineno = 3;
__.lineno = 3;
buf.push('<h1');
buf.push(attrs({ "class": ('table-label') }));
buf.push('>');
var __val__ = window._i(table_label)
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</h1>');
}
__.lineno = 4;
if(locals["table_icon_url"])
{
__.lineno = 5;
__.lineno = 5;
buf.push('<img');
buf.push(attrs({ 'src':(table_icon_url), "class": ('table-icon') }));
buf.push('/>');
}
buf.push('</header>');
__.lineno = 7;
buf.push('<table');
buf.push(attrs({ "class": ('common-table-header') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 9;
buf.push('<thead>');
__.lineno = undefined;
__.lineno = 10;
buf.push('<tr>');
__.lineno = undefined;
__.lineno = 14;
// iterate column_names
(function(){
  if ('number' == typeof column_names.length) {
    for (var column_name = 0, $$l = column_names.length; column_name < $$l; column_name++) {
      var column_label = column_names[column_name];

__.lineno = 10;
__.lineno = 12;
buf.push('<th');
buf.push(attrs({ "class": ("" + (column_name) + "-cell") }));
buf.push('>');
__.lineno = undefined;
__.lineno = 12;
var __val__ = window._i(column_label)
buf.push(null == __val__ ? "" : __val__);
__.lineno = 13;
buf.push('<div');
buf.push(attrs({ "class": ('sorted-graphic') }));
buf.push('>');
__.lineno = undefined;
buf.push('</div>');
buf.push('</th>');
    }
  } else {
    for (var column_name in column_names) {
      var column_label = column_names[column_name];

__.lineno = 10;
__.lineno = 12;
buf.push('<th');
buf.push(attrs({ "class": ("" + (column_name) + "-cell") }));
buf.push('>');
__.lineno = undefined;
__.lineno = 12;
var __val__ = window._i(column_label)
buf.push(null == __val__ ? "" : __val__);
__.lineno = 13;
buf.push('<div');
buf.push(attrs({ "class": ('sorted-graphic') }));
buf.push('>');
__.lineno = undefined;
buf.push('</div>');
buf.push('</th>');
   }
  }
}).call(this);

buf.push('</tr>');
buf.push('</thead>');
buf.push('</table>');
__.lineno = 14;
buf.push('<div');
buf.push(attrs({ "class": ('table-sections') }));
buf.push('>');
__.lineno = undefined;
buf.push('</div>');}return buf.join("");
} catch (err) {
  rethrow(err, __.input, __.filename, __.lineno);
}
};}, "templates/single": function(exports, require, module) {module.exports = function anonymous(locals) {
var __ = { lineno: 1, input: "nav.article-navigation.sticky-element\n    .inner\n        header\n            //img.branch-icon(src=\"/images/icons/special/24/#{branch}.png\")\n            h1.medium-heading!= title[0].all_parsed\n            span.branch-name!= window._i(branch_name)\n            h2.sub-title.heading5!= sub_title[0].all_parsed\n        ul\n            -if(flickr_set)\n                li.segment-anchor(data-segment=\"gallery\")\n                    a.segment-label!= window._i(\"Gallery\") \n                    .arrow-container\n                        .inner\n                            .arrow\n\n\n\n            -each section in post_content\n                li.segment-anchor(data-segment=section.section_title[0].raw)\n                    a.segment-label!= section.section_title[0].all_parsed\n                    .arrow-container\n                        .inner\n                            .arrow\n\n\n        table.specification-table\n            tbody\n                -each specification_label,specification_name in specification_labels\n                    tr\n                        th.micro-heading!= window._i(specification_label)\n                        - var tds =  locals[specification_name][0] && locals[specification_name][0].all_parsed  ? locals[specification_name][0].all_parsed : locals[specification_name]\n                        td!= window._i(tds) \n\narticle\n    -if(flickr_set)\n        .content-section(data-segment=\"gallery\")\n            - each photo in flickr_set.photo\n                - posteronly = /posteronly/\n                - is_posteronly = posteronly.test(photo.tags)\n                - if (!is_posteronly)\n                    .img-container\n                        -use_url = photo.url_m\n                        -use_url_full_size = photo.url_l || photo.url_o\n                        -if(Number(photo.width_m) < 500 && photo.url_l) use_url = photo.url_l\n\n                        a(href=use_url_full_size, rel=\"gallery\",title=photo.title)\n                            img(id=photo.id, src=use_url,title=photo.title)\n\n                            \n                \n        \n    -each section in post_content\n        .content-section.copy-container(data-segment=section.section_title[0].raw)\n            h1.big-heading!= section.section_title[0].all_parsed\n            .content!= section.section_body[0].all_parsed\n\n\n    -if(related_posts.length)\n        .content-section.copy-container(data-segment=\"related-posts\")\n            h1.big-heading!= window._i(\"Related Content\")\n            ul.content\n                -each related_post in related_posts\n                    li: a(href=\"#/post/#{related_post._id}\")!= related_post.title[0].all_parsed \n\n\n\n", filename: undefined };
function rethrow(err, str, filename, lineno){
  var context = 3
    , lines = str.split('\n')
    , start = Math.max(lineno - context, 0)
    , end = Math.min(lines.length, lineno + context); 

  // Error context
  var context = lines.slice(start, end).map(function(line, i){
    var curr = i + start + 1;
    return (curr == lineno ? '  > ' : '    ')
      + curr
      + '| '
      + line;
  }).join('\n');

  // Alter exception message
  err.path = filename;
  err.message = (filename || 'Jade') + ':' + lineno 
    + '\n' + context + '\n\n' + err.message;
  throw err;
}
try {
function attrs(obj){
  var buf = []
    , terse = obj.terse;
  delete obj.terse;
  var keys = Object.keys(obj)
    , len = keys.length;
  if (len) {
    buf.push('');
    for (var i = 0; i < len; ++i) {
      var key = keys[i]
        , val = obj[key];
      if ('boolean' == typeof val || null == val) {
        if (val) {
          terse
            ? buf.push(key)
            : buf.push(key + '="' + key + '"');
        }
      } else if ('class' == key && Array.isArray(val)) {
        buf.push(key + '="' + escape(val.join(' ')) + '"');
      } else {
        buf.push(key + '="' + escape(val) + '"');
      }
    }
  }
  return buf.join(' ');
}

function escape(html){
  return String(html)
    .replace(/&(?!\w+;)/g, '&amp;')
    .replace(/</g, '&lt;')
    .replace(/>/g, '&gt;')
    .replace(/"/g, '&quot;');
}

var buf = [];
with (locals || {}) {__.lineno = 1;
__.lineno = 1;
buf.push('<nav');
buf.push(attrs({ "class": ('article-navigation') + ' ' + ('sticky-element') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 2;
buf.push('<div');
buf.push(attrs({ "class": ('inner') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 4;
buf.push('<header>');
__.lineno = undefined;
__.lineno = 5;
buf.push('<!--img.branch-icon(src="/images/icons/special/24/#{branch}.png")-->');
__.lineno = 5;
buf.push('<h1');
buf.push(attrs({ "class": ('medium-heading') }));
buf.push('>');
var __val__ = title[0].all_parsed
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</h1>');
__.lineno = 6;
buf.push('<span');
buf.push(attrs({ "class": ('branch-name') }));
buf.push('>');
var __val__ = window._i(branch_name)
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</span>');
__.lineno = 7;
buf.push('<h2');
buf.push(attrs({ "class": ('sub-title') + ' ' + ('heading5') }));
buf.push('>');
var __val__ = sub_title[0].all_parsed
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</h2>');
buf.push('</header>');
__.lineno = 9;
buf.push('<ul>');
__.lineno = undefined;
__.lineno = 9;
if(flickr_set)
{
__.lineno = 10;
__.lineno = 10;
buf.push('<li');
buf.push(attrs({ 'data-segment':("gallery"), "class": ('segment-anchor') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 11;
buf.push('<a');
buf.push(attrs({ "class": ('segment-label') }));
buf.push('>');
var __val__ = window._i("Gallery") 
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</a>');
__.lineno = 12;
buf.push('<div');
buf.push(attrs({ "class": ('arrow-container') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 13;
buf.push('<div');
buf.push(attrs({ "class": ('inner') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 14;
buf.push('<div');
buf.push(attrs({ "class": ('arrow') }));
buf.push('>');
__.lineno = undefined;
buf.push('</div>');
buf.push('</div>');
buf.push('</div>');
buf.push('</li>');
}
__.lineno = 26;
// iterate post_content
(function(){
  if ('number' == typeof post_content.length) {
    for (var index = 0, $$l = post_content.length; index < $$l; index++) {
      var section = post_content[index];

__.lineno = 18;
__.lineno = 19;
buf.push('<li');
buf.push(attrs({ 'data-segment':(section.section_title[0].raw), "class": ('segment-anchor') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 20;
buf.push('<a');
buf.push(attrs({ "class": ('segment-label') }));
buf.push('>');
var __val__ = section.section_title[0].all_parsed
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</a>');
__.lineno = 21;
buf.push('<div');
buf.push(attrs({ "class": ('arrow-container') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 22;
buf.push('<div');
buf.push(attrs({ "class": ('inner') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 23;
buf.push('<div');
buf.push(attrs({ "class": ('arrow') }));
buf.push('>');
__.lineno = undefined;
buf.push('</div>');
buf.push('</div>');
buf.push('</div>');
buf.push('</li>');
    }
  } else {
    for (var index in post_content) {
      var section = post_content[index];

__.lineno = 18;
__.lineno = 19;
buf.push('<li');
buf.push(attrs({ 'data-segment':(section.section_title[0].raw), "class": ('segment-anchor') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 20;
buf.push('<a');
buf.push(attrs({ "class": ('segment-label') }));
buf.push('>');
var __val__ = section.section_title[0].all_parsed
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</a>');
__.lineno = 21;
buf.push('<div');
buf.push(attrs({ "class": ('arrow-container') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 22;
buf.push('<div');
buf.push(attrs({ "class": ('inner') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 23;
buf.push('<div');
buf.push(attrs({ "class": ('arrow') }));
buf.push('>');
__.lineno = undefined;
buf.push('</div>');
buf.push('</div>');
buf.push('</div>');
buf.push('</li>');
   }
  }
}).call(this);

buf.push('</ul>');
__.lineno = 26;
buf.push('<table');
buf.push(attrs({ "class": ('specification-table') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 28;
buf.push('<tbody>');
__.lineno = undefined;
__.lineno = 34;
// iterate specification_labels
(function(){
  if ('number' == typeof specification_labels.length) {
    for (var specification_name = 0, $$l = specification_labels.length; specification_name < $$l; specification_name++) {
      var specification_label = specification_labels[specification_name];

__.lineno = 28;
__.lineno = 30;
buf.push('<tr>');
__.lineno = undefined;
__.lineno = 30;
buf.push('<th');
buf.push(attrs({ "class": ('micro-heading') }));
buf.push('>');
var __val__ = window._i(specification_label)
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</th>');
__.lineno = 31;
 var tds =  locals[specification_name][0] && locals[specification_name][0].all_parsed  ? locals[specification_name][0].all_parsed : locals[specification_name]
__.lineno = 32;
buf.push('<td>');
var __val__ = window._i(tds) 
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</td>');
buf.push('</tr>');
    }
  } else {
    for (var specification_name in specification_labels) {
      var specification_label = specification_labels[specification_name];

__.lineno = 28;
__.lineno = 30;
buf.push('<tr>');
__.lineno = undefined;
__.lineno = 30;
buf.push('<th');
buf.push(attrs({ "class": ('micro-heading') }));
buf.push('>');
var __val__ = window._i(specification_label)
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</th>');
__.lineno = 31;
 var tds =  locals[specification_name][0] && locals[specification_name][0].all_parsed  ? locals[specification_name][0].all_parsed : locals[specification_name]
__.lineno = 32;
buf.push('<td>');
var __val__ = window._i(tds) 
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</td>');
buf.push('</tr>');
   }
  }
}).call(this);

buf.push('</tbody>');
buf.push('</table>');
buf.push('</div>');
buf.push('</nav>');
__.lineno = 35;
buf.push('<article>');
__.lineno = undefined;
__.lineno = 35;
if(flickr_set)
{
__.lineno = 36;
__.lineno = 36;
buf.push('<div');
buf.push(attrs({ 'data-segment':("gallery"), "class": ('content-section') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 52;
// iterate flickr_set.photo
(function(){
  if ('number' == typeof flickr_set.photo.length) {
    for (var index = 0, $$l = flickr_set.photo.length; index < $$l; index++) {
      var photo = flickr_set.photo[index];

__.lineno = 37;
__.lineno = 38;
 posteronly = /posteronly/
__.lineno = 39;
 is_posteronly = posteronly.test(photo.tags)
__.lineno = 40;
 if (!is_posteronly)
{
__.lineno = 41;
__.lineno = 41;
buf.push('<div');
buf.push(attrs({ "class": ('img-container') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 42;
use_url = photo.url_m
__.lineno = 43;
use_url_full_size = photo.url_l || photo.url_o
__.lineno = 44;
if(Number(photo.width_m) < 500 && photo.url_l) use_url = photo.url_l
__.lineno = 47;
buf.push('<a');
buf.push(attrs({ 'href':(use_url_full_size), 'rel':("gallery"), 'title':(photo.title) }));
buf.push('>');
__.lineno = undefined;
__.lineno = 48;
buf.push('<img');
buf.push(attrs({ 'id':(photo.id), 'src':(use_url), 'title':(photo.title) }));
buf.push('/>');
buf.push('</a>');
buf.push('</div>');
}
    }
  } else {
    for (var index in flickr_set.photo) {
      var photo = flickr_set.photo[index];

__.lineno = 37;
__.lineno = 38;
 posteronly = /posteronly/
__.lineno = 39;
 is_posteronly = posteronly.test(photo.tags)
__.lineno = 40;
 if (!is_posteronly)
{
__.lineno = 41;
__.lineno = 41;
buf.push('<div');
buf.push(attrs({ "class": ('img-container') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 42;
use_url = photo.url_m
__.lineno = 43;
use_url_full_size = photo.url_l || photo.url_o
__.lineno = 44;
if(Number(photo.width_m) < 500 && photo.url_l) use_url = photo.url_l
__.lineno = 47;
buf.push('<a');
buf.push(attrs({ 'href':(use_url_full_size), 'rel':("gallery"), 'title':(photo.title) }));
buf.push('>');
__.lineno = undefined;
__.lineno = 48;
buf.push('<img');
buf.push(attrs({ 'id':(photo.id), 'src':(use_url), 'title':(photo.title) }));
buf.push('/>');
buf.push('</a>');
buf.push('</div>');
}
   }
  }
}).call(this);

buf.push('</div>');
}
__.lineno = 58;
// iterate post_content
(function(){
  if ('number' == typeof post_content.length) {
    for (var index = 0, $$l = post_content.length; index < $$l; index++) {
      var section = post_content[index];

__.lineno = 52;
__.lineno = 53;
buf.push('<div');
buf.push(attrs({ 'data-segment':(section.section_title[0].raw), "class": ('content-section') + ' ' + ('copy-container') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 54;
buf.push('<h1');
buf.push(attrs({ "class": ('big-heading') }));
buf.push('>');
var __val__ = section.section_title[0].all_parsed
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</h1>');
__.lineno = 55;
buf.push('<div');
buf.push(attrs({ "class": ('content') }));
buf.push('>');
var __val__ = section.section_body[0].all_parsed
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</div>');
buf.push('</div>');
    }
  } else {
    for (var index in post_content) {
      var section = post_content[index];

__.lineno = 52;
__.lineno = 53;
buf.push('<div');
buf.push(attrs({ 'data-segment':(section.section_title[0].raw), "class": ('content-section') + ' ' + ('copy-container') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 54;
buf.push('<h1');
buf.push(attrs({ "class": ('big-heading') }));
buf.push('>');
var __val__ = section.section_title[0].all_parsed
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</h1>');
__.lineno = 55;
buf.push('<div');
buf.push(attrs({ "class": ('content') }));
buf.push('>');
var __val__ = section.section_body[0].all_parsed
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</div>');
buf.push('</div>');
   }
  }
}).call(this);

__.lineno = 58;
if(related_posts.length)
{
__.lineno = 59;
__.lineno = 59;
buf.push('<div');
buf.push(attrs({ 'data-segment':("related-posts"), "class": ('content-section') + ' ' + ('copy-container') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 60;
buf.push('<h1');
buf.push(attrs({ "class": ('big-heading') }));
buf.push('>');
var __val__ = window._i("Related Content")
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</h1>');
__.lineno = 61;
buf.push('<ul');
buf.push(attrs({ "class": ('content') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 67;
// iterate related_posts
(function(){
  if ('number' == typeof related_posts.length) {
    for (var index = 0, $$l = related_posts.length; index < $$l; index++) {
      var related_post = related_posts[index];

__.lineno = 62;
__.lineno = 63;
buf.push('<li>');
__.lineno = undefined;
__.lineno = 63;
buf.push('<a');
buf.push(attrs({ 'href':("#/post/" + (related_post._id) + "") }));
buf.push('>');
var __val__ = related_post.title[0].all_parsed 
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</a>');
buf.push('</li>');
    }
  } else {
    for (var index in related_posts) {
      var related_post = related_posts[index];

__.lineno = 62;
__.lineno = 63;
buf.push('<li>');
__.lineno = undefined;
__.lineno = 63;
buf.push('<a');
buf.push(attrs({ 'href':("#/post/" + (related_post._id) + "") }));
buf.push('>');
var __val__ = related_post.title[0].all_parsed 
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</a>');
buf.push('</li>');
   }
  }
}).call(this);

buf.push('</ul>');
buf.push('</div>');
}
buf.push('</article>');}return buf.join("");
} catch (err) {
  rethrow(err, __.input, __.filename, __.lineno);
}
};}, "templates/site_footer": function(exports, require, module) {module.exports = function anonymous(locals) {
var __ = { lineno: 1, input: ".team.copy-container\n    - each member in team\n        -if(member.in_footer)\n            ul\n                li \n                    h1.name.type-title= member.name\n                    a.email.type-title-sub(href=\"mailto:#{member.email}\")= member.email\n                    br\n\n                    span.jobtitle!= member.jobtitle[0].all_parsed\n\n.contact\n    ul.social.icon-links\n        li\n            a(href=\"http://www.linkedin.com/company/kanva\", target=\"_blank\")\n                img(src=\"/images/icons/light/32/linkedin.png\")\n        li\n            a(href=\"http://www.facebook.com/pages/Kanva-Architecture/97050979639\", target=\"_blank\")\n                img(src=\"/images/icons/light/32/facebook.png\")\n        li\n            a(href=\"https://twitter.com/#!/_Kanva\", target=\"_blank\")\n                img(src=\"/images/icons/light/32/twitter.png\")\n\n    address.copy-container\n        h1.name.type-title Bureau\n        a.email.type-title-sub(href=\"mailto:info@kanva.ca\") info@kanva.ca\n        br\n        br\n        .physical.type-title-sub\n            a(href=\"http://maps.google.com/maps?q=4060+ST-LAURENT+%23103+MONTREAL+QUEBEC+CANADA+H2W+1Y9&hl=en&sll=37.0625,-95.677068&sspn=81.286535,79.013672&vpsrc=0&z=17\",target=\"blank\")\n                span.street 4060 St-Laurent #103\n                br\n                span.town Montreal \n                span.province Quebec\n                br\n                span.country Canada \n                span.postal-code H2W 1Y9\n            br\n            br\n            .phone +1 514 844 9779\n            .fax +1 514 844 3858\n", filename: undefined };
function rethrow(err, str, filename, lineno){
  var context = 3
    , lines = str.split('\n')
    , start = Math.max(lineno - context, 0)
    , end = Math.min(lines.length, lineno + context); 

  // Error context
  var context = lines.slice(start, end).map(function(line, i){
    var curr = i + start + 1;
    return (curr == lineno ? '  > ' : '    ')
      + curr
      + '| '
      + line;
  }).join('\n');

  // Alter exception message
  err.path = filename;
  err.message = (filename || 'Jade') + ':' + lineno 
    + '\n' + context + '\n\n' + err.message;
  throw err;
}
try {
function attrs(obj){
  var buf = []
    , terse = obj.terse;
  delete obj.terse;
  var keys = Object.keys(obj)
    , len = keys.length;
  if (len) {
    buf.push('');
    for (var i = 0; i < len; ++i) {
      var key = keys[i]
        , val = obj[key];
      if ('boolean' == typeof val || null == val) {
        if (val) {
          terse
            ? buf.push(key)
            : buf.push(key + '="' + key + '"');
        }
      } else if ('class' == key && Array.isArray(val)) {
        buf.push(key + '="' + escape(val.join(' ')) + '"');
      } else {
        buf.push(key + '="' + escape(val) + '"');
      }
    }
  }
  return buf.join(' ');
}

function escape(html){
  return String(html)
    .replace(/&(?!\w+;)/g, '&amp;')
    .replace(/</g, '&lt;')
    .replace(/>/g, '&gt;')
    .replace(/"/g, '&quot;');
}

var buf = [];
with (locals || {}) {__.lineno = 1;
__.lineno = 1;
buf.push('<div');
buf.push(attrs({ "class": ('team') + ' ' + ('copy-container') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 12;
// iterate team
(function(){
  if ('number' == typeof team.length) {
    for (var index = 0, $$l = team.length; index < $$l; index++) {
      var member = team[index];

__.lineno = 2;
__.lineno = 3;
if(member.in_footer)
{
__.lineno = 4;
__.lineno = 5;
buf.push('<ul>');
__.lineno = undefined;
__.lineno = 5;
buf.push('<li>');
buf.push('');
__.lineno = undefined;
__.lineno = 6;
buf.push('<h1');
buf.push(attrs({ "class": ('name') + ' ' + ('type-title') }));
buf.push('>');
var __val__ = member.name
buf.push(escape(null == __val__ ? "" : __val__));
__.lineno = undefined;
buf.push('</h1>');
__.lineno = 7;
buf.push('<a');
buf.push(attrs({ 'href':("mailto:" + (member.email) + ""), "class": ('email') + ' ' + ('type-title-sub') }));
buf.push('>');
var __val__ = member.email
buf.push(escape(null == __val__ ? "" : __val__));
__.lineno = undefined;
buf.push('</a>');
__.lineno = 9;
buf.push('<br');
buf.push(attrs({  }));
buf.push('/>');
__.lineno = 10;
buf.push('<span');
buf.push(attrs({ "class": ('jobtitle') }));
buf.push('>');
var __val__ = member.jobtitle[0].all_parsed
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</span>');
buf.push('</li>');
buf.push('</ul>');
}
    }
  } else {
    for (var index in team) {
      var member = team[index];

__.lineno = 2;
__.lineno = 3;
if(member.in_footer)
{
__.lineno = 4;
__.lineno = 5;
buf.push('<ul>');
__.lineno = undefined;
__.lineno = 5;
buf.push('<li>');
buf.push('');
__.lineno = undefined;
__.lineno = 6;
buf.push('<h1');
buf.push(attrs({ "class": ('name') + ' ' + ('type-title') }));
buf.push('>');
var __val__ = member.name
buf.push(escape(null == __val__ ? "" : __val__));
__.lineno = undefined;
buf.push('</h1>');
__.lineno = 7;
buf.push('<a');
buf.push(attrs({ 'href':("mailto:" + (member.email) + ""), "class": ('email') + ' ' + ('type-title-sub') }));
buf.push('>');
var __val__ = member.email
buf.push(escape(null == __val__ ? "" : __val__));
__.lineno = undefined;
buf.push('</a>');
__.lineno = 9;
buf.push('<br');
buf.push(attrs({  }));
buf.push('/>');
__.lineno = 10;
buf.push('<span');
buf.push(attrs({ "class": ('jobtitle') }));
buf.push('>');
var __val__ = member.jobtitle[0].all_parsed
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</span>');
buf.push('</li>');
buf.push('</ul>');
}
   }
  }
}).call(this);

buf.push('</div>');
__.lineno = 12;
buf.push('<div');
buf.push(attrs({ "class": ('contact') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 13;
buf.push('<ul');
buf.push(attrs({ "class": ('social') + ' ' + ('icon-links') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 15;
buf.push('<li>');
__.lineno = undefined;
__.lineno = 16;
buf.push('<a');
buf.push(attrs({ 'href':("http://www.linkedin.com/company/kanva"), 'target':("_blank") }));
buf.push('>');
__.lineno = undefined;
__.lineno = 17;
buf.push('<img');
buf.push(attrs({ 'src':("/images/icons/light/32/linkedin.png") }));
buf.push('/>');
buf.push('</a>');
buf.push('</li>');
__.lineno = 18;
buf.push('<li>');
__.lineno = undefined;
__.lineno = 19;
buf.push('<a');
buf.push(attrs({ 'href':("http://www.facebook.com/pages/Kanva-Architecture/97050979639"), 'target':("_blank") }));
buf.push('>');
__.lineno = undefined;
__.lineno = 20;
buf.push('<img');
buf.push(attrs({ 'src':("/images/icons/light/32/facebook.png") }));
buf.push('/>');
buf.push('</a>');
buf.push('</li>');
__.lineno = 21;
buf.push('<li>');
__.lineno = undefined;
__.lineno = 22;
buf.push('<a');
buf.push(attrs({ 'href':("https://twitter.com/#!/_Kanva"), 'target':("_blank") }));
buf.push('>');
__.lineno = undefined;
__.lineno = 23;
buf.push('<img');
buf.push(attrs({ 'src':("/images/icons/light/32/twitter.png") }));
buf.push('/>');
buf.push('</a>');
buf.push('</li>');
buf.push('</ul>');
__.lineno = 24;
buf.push('<address');
buf.push(attrs({ "class": ('copy-container') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 25;
buf.push('<h1');
buf.push(attrs({ "class": ('name') + ' ' + ('type-title') }));
buf.push('>');
buf.push('Bureau');
__.lineno = undefined;
buf.push('</h1>');
__.lineno = 26;
buf.push('<a');
buf.push(attrs({ 'href':("mailto:info@kanva.ca"), "class": ('email') + ' ' + ('type-title-sub') }));
buf.push('>');
buf.push('info@kanva.ca');
__.lineno = undefined;
buf.push('</a>');
__.lineno = 28;
buf.push('<br');
buf.push(attrs({  }));
buf.push('/>');
__.lineno = 29;
buf.push('<br');
buf.push(attrs({  }));
buf.push('/>');
__.lineno = 29;
buf.push('<div');
buf.push(attrs({ "class": ('physical') + ' ' + ('type-title-sub') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 31;
buf.push('<a');
buf.push(attrs({ 'href':("http://maps.google.com/maps?q=4060+ST-LAURENT+%23103+MONTREAL+QUEBEC+CANADA+H2W+1Y9&hl=en&sll=37.0625,-95.677068&sspn=81.286535,79.013672&vpsrc=0&z=17"), 'target':("blank") }));
buf.push('>');
__.lineno = undefined;
__.lineno = 31;
buf.push('<span');
buf.push(attrs({ "class": ('street') }));
buf.push('>');
buf.push('4060 St-Laurent #103');
__.lineno = undefined;
buf.push('</span>');
__.lineno = 33;
buf.push('<br');
buf.push(attrs({  }));
buf.push('/>');
__.lineno = 33;
buf.push('<span');
buf.push(attrs({ "class": ('town') }));
buf.push('>');
buf.push('Montreal ');
__.lineno = undefined;
buf.push('</span>');
__.lineno = 34;
buf.push('<span');
buf.push(attrs({ "class": ('province') }));
buf.push('>');
buf.push('Quebec');
__.lineno = undefined;
buf.push('</span>');
__.lineno = 36;
buf.push('<br');
buf.push(attrs({  }));
buf.push('/>');
__.lineno = 36;
buf.push('<span');
buf.push(attrs({ "class": ('country') }));
buf.push('>');
buf.push('Canada ');
__.lineno = undefined;
buf.push('</span>');
__.lineno = 37;
buf.push('<span');
buf.push(attrs({ "class": ('postal-code') }));
buf.push('>');
buf.push('H2W 1Y9');
__.lineno = undefined;
buf.push('</span>');
buf.push('</a>');
__.lineno = 39;
buf.push('<br');
buf.push(attrs({  }));
buf.push('/>');
__.lineno = 40;
buf.push('<br');
buf.push(attrs({  }));
buf.push('/>');
__.lineno = 40;
buf.push('<div');
buf.push(attrs({ "class": ('phone') }));
buf.push('>');
buf.push('+1 514 844 9779');
__.lineno = undefined;
buf.push('</div>');
__.lineno = 41;
buf.push('<div');
buf.push(attrs({ "class": ('fax') }));
buf.push('>');
buf.push('+1 514 844 3858');
__.lineno = undefined;
buf.push('</div>');
buf.push('</div>');
buf.push('</address>');
buf.push('</div>');}return buf.join("");
} catch (err) {
  rethrow(err, __.input, __.filename, __.lineno);
}
};}, "templates/storyline": function(exports, require, module) {module.exports = function anonymous(locals) {
var __ = { lineno: 1, input: "", filename: undefined };
function rethrow(err, str, filename, lineno){
  var context = 3
    , lines = str.split('\n')
    , start = Math.max(lineno - context, 0)
    , end = Math.min(lines.length, lineno + context); 

  // Error context
  var context = lines.slice(start, end).map(function(line, i){
    var curr = i + start + 1;
    return (curr == lineno ? '  > ' : '    ')
      + curr
      + '| '
      + line;
  }).join('\n');

  // Alter exception message
  err.path = filename;
  err.message = (filename || 'Jade') + ':' + lineno 
    + '\n' + context + '\n\n' + err.message;
  throw err;
}
try {
function attrs(obj){
  var buf = []
    , terse = obj.terse;
  delete obj.terse;
  var keys = Object.keys(obj)
    , len = keys.length;
  if (len) {
    buf.push('');
    for (var i = 0; i < len; ++i) {
      var key = keys[i]
        , val = obj[key];
      if ('boolean' == typeof val || null == val) {
        if (val) {
          terse
            ? buf.push(key)
            : buf.push(key + '="' + key + '"');
        }
      } else if ('class' == key && Array.isArray(val)) {
        buf.push(key + '="' + escape(val.join(' ')) + '"');
      } else {
        buf.push(key + '="' + escape(val) + '"');
      }
    }
  }
  return buf.join(' ');
}

function escape(html){
  return String(html)
    .replace(/&(?!\w+;)/g, '&amp;')
    .replace(/</g, '&lt;')
    .replace(/>/g, '&gt;')
    .replace(/"/g, '&quot;');
}

var buf = [];
with (locals || {}) {__.lineno = 1;}return buf.join("");
} catch (err) {
  rethrow(err, __.input, __.filename, __.lineno);
}
};}, "templates/table_active": function(exports, require, module) {module.exports = function(__obj) {
  if (!__obj) __obj = {};
  var __out = [], __capture = function(callback) {
    var out = __out, result;
    __out = [];
    callback.call(this);
    result = __out.join('');
    __out = out;
    return __safe(result);
  }, __sanitize = function(value) {
    if (value && value.ecoSafe) {
      return value;
    } else if (typeof value !== 'undefined' && value != null) {
      return __escape(value);
    } else {
      return '';
    }
  }, __safe, __objSafe = __obj.safe, __escape = __obj.escape;
  __safe = __obj.safe = function(value) {
    if (value && value.ecoSafe) {
      return value;
    } else {
      if (!(typeof value !== 'undefined' && value != null)) value = '';
      var result = new String(value);
      result.ecoSafe = true;
      return result;
    }
  };
  if (!__escape) {
    __escape = __obj.escape = function(value) {
      return ('' + value)
        .replace(/&/g, '&amp;')
        .replace(/</g, '&lt;')
        .replace(/>/g, '&gt;')
        .replace(/"/g, '&quot;');
    };
  }
  (function() {
    (function() {
      var column_label, column_name, i, j, row, _i, _len, _ref, _ref2, _ref3, _ref4, _ref5;
      __out.push('<header>\n    <h1 class="table-label">\n        ');
      __out.push(window._i(this.table_label));
      __out.push('\n    </h1>\n    ');
      if (this.table_icon_url) {
        __out.push('\n    <img class="table-icon" src=');
        __out.push(this.table_icon_url);
        __out.push('\n    ');
      }
      __out.push('\n</header>\n\n<table class=');
      __out.push(this.table_classes);
      __out.push('>\n    <thead>\n        <tr>\n            ');
      _ref = this.column_names;
      for (column_name in _ref) {
        column_label = _ref[column_name];
        __out.push('\n                <th class="');
        column_name;
        __out.push('-cell">\n                    ');
        __out.push(window._i(column_label));
        __out.push('\n                    <div class="sorted-graphic"></div>\n                </th>\n            ');
      }
      __out.push('\n        </tr>\n    </thead>\n    <tbody>\n        ');
      i = 0;
      __out.push('\n        ');
      _ref2 = this.rows;
      for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
        row = _ref2[_i];
        __out.push('\n        <tr ');
        __out.push(typeof this.row_attributes === "function" ? this.row_attributes(row) : void 0);
        __out.push('>\n\n            ');
        j = 0;
        __out.push('\n            ');
        _ref3 = this.column_names;
        for (column_name in _ref3) {
          column_label = _ref3[column_name];
          __out.push('\n            <td class="');
          __out.push(column_name);
          __out.push('-cell">\n                ');
          if (j === 0 && this.use_row_hanger) {
            __out.push('\n                    <div class="row-hanger ');
            __out.push(this.hanger_classes);
            __out.push('">');
            __out.push(typeof this.hanger_contents === "function" ? this.hanger_contents(row) : void 0);
            __out.push('</div>\n                ');
          }
          __out.push('\n                <a href="');
          __out.push(this.row_url_base);
          __out.push(row._id);
          __out.push('">\n                    ');
          __out.push(window._i(((_ref4 = row[column_name]) != null ? (_ref5 = _ref4[0]) != null ? _ref5.all_parsed : void 0 : void 0) || row[column_name]));
          __out.push('\n                </a>\n            </td>\n            ');
          j += 1;
          __out.push('\n            ');
        }
        __out.push('\n\n        </tr>\n        ');
        i += 1;
        __out.push('\n        ');
      }
      __out.push('\n    </tbody>\n</table>\n');
    }).call(this);
    
  }).call(__obj);
  __obj.safe = __objSafe, __obj.escape = __escape;
  return __out.join('');
}}, "templates/table_branch": function(exports, require, module) {module.exports = function anonymous(locals) {
var __ = { lineno: 1, input: "header\n    h1= window._i(branch)\n    //img(src=\"/images/icons/special/24/#{branch}.png\")\ntable\n    thead\n        tr\n            - each meta_label in meta_labels\n                th(class=\"table-col-#{content.tools.slugify(meta_label)}\")= meta_label\n    tbody\n", filename: undefined };
function rethrow(err, str, filename, lineno){
  var context = 3
    , lines = str.split('\n')
    , start = Math.max(lineno - context, 0)
    , end = Math.min(lines.length, lineno + context); 

  // Error context
  var context = lines.slice(start, end).map(function(line, i){
    var curr = i + start + 1;
    return (curr == lineno ? '  > ' : '    ')
      + curr
      + '| '
      + line;
  }).join('\n');

  // Alter exception message
  err.path = filename;
  err.message = (filename || 'Jade') + ':' + lineno 
    + '\n' + context + '\n\n' + err.message;
  throw err;
}
try {
function attrs(obj){
  var buf = []
    , terse = obj.terse;
  delete obj.terse;
  var keys = Object.keys(obj)
    , len = keys.length;
  if (len) {
    buf.push('');
    for (var i = 0; i < len; ++i) {
      var key = keys[i]
        , val = obj[key];
      if ('boolean' == typeof val || null == val) {
        if (val) {
          terse
            ? buf.push(key)
            : buf.push(key + '="' + key + '"');
        }
      } else if ('class' == key && Array.isArray(val)) {
        buf.push(key + '="' + escape(val.join(' ')) + '"');
      } else {
        buf.push(key + '="' + escape(val) + '"');
      }
    }
  }
  return buf.join(' ');
}

function escape(html){
  return String(html)
    .replace(/&(?!\w+;)/g, '&amp;')
    .replace(/</g, '&lt;')
    .replace(/>/g, '&gt;')
    .replace(/"/g, '&quot;');
}

var buf = [];
with (locals || {}) {__.lineno = 1;
__.lineno = 2;
buf.push('<header>');
__.lineno = undefined;
__.lineno = 2;
buf.push('<h1>');
var __val__ = window._i(branch)
buf.push(escape(null == __val__ ? "" : __val__));
__.lineno = undefined;
buf.push('</h1>');
__.lineno = 4;
buf.push('<!--img(src="/images/icons/special/24/#{branch}.png")-->');
buf.push('</header>');
__.lineno = 5;
buf.push('<table>');
__.lineno = undefined;
__.lineno = 6;
buf.push('<thead>');
__.lineno = undefined;
__.lineno = 7;
buf.push('<tr>');
__.lineno = undefined;
__.lineno = 9;
// iterate meta_labels
(function(){
  if ('number' == typeof meta_labels.length) {
    for (var index = 0, $$l = meta_labels.length; index < $$l; index++) {
      var meta_label = meta_labels[index];

__.lineno = 7;
__.lineno = 8;
buf.push('<th');
buf.push(attrs({ "class": ("table-col-" + (content.tools.slugify(meta_label)) + "") }));
buf.push('>');
var __val__ = meta_label
buf.push(escape(null == __val__ ? "" : __val__));
__.lineno = undefined;
buf.push('</th>');
    }
  } else {
    for (var index in meta_labels) {
      var meta_label = meta_labels[index];

__.lineno = 7;
__.lineno = 8;
buf.push('<th');
buf.push(attrs({ "class": ("table-col-" + (content.tools.slugify(meta_label)) + "") }));
buf.push('>');
var __val__ = meta_label
buf.push(escape(null == __val__ ? "" : __val__));
__.lineno = undefined;
buf.push('</th>');
   }
  }
}).call(this);

buf.push('</tr>');
buf.push('</thead>');
__.lineno = 10;
buf.push('<tbody>');
__.lineno = undefined;
buf.push('</tbody>');
buf.push('</table>');}return buf.join("");
} catch (err) {
  rethrow(err, __.input, __.filename, __.lineno);
}
};}, "templates/table_row": function(exports, require, module) {module.exports = function anonymous(locals) {
var __ = { lineno: 1, input: "- each meta_field_name,i in meta_field_names\n    td(class=\"#{meta_field_name}-cell table-col-#{meta_field_name}\")\n        -if(i == 0)\n            .permalink\n                a(href=\"/#/post/#{_id}\")\n                    img(src=\"/images/icons/dark/24/preview.png\")\n        != locals[meta_field_name]\n", filename: undefined };
function rethrow(err, str, filename, lineno){
  var context = 3
    , lines = str.split('\n')
    , start = Math.max(lineno - context, 0)
    , end = Math.min(lines.length, lineno + context); 

  // Error context
  var context = lines.slice(start, end).map(function(line, i){
    var curr = i + start + 1;
    return (curr == lineno ? '  > ' : '    ')
      + curr
      + '| '
      + line;
  }).join('\n');

  // Alter exception message
  err.path = filename;
  err.message = (filename || 'Jade') + ':' + lineno 
    + '\n' + context + '\n\n' + err.message;
  throw err;
}
try {
function attrs(obj){
  var buf = []
    , terse = obj.terse;
  delete obj.terse;
  var keys = Object.keys(obj)
    , len = keys.length;
  if (len) {
    buf.push('');
    for (var i = 0; i < len; ++i) {
      var key = keys[i]
        , val = obj[key];
      if ('boolean' == typeof val || null == val) {
        if (val) {
          terse
            ? buf.push(key)
            : buf.push(key + '="' + key + '"');
        }
      } else if ('class' == key && Array.isArray(val)) {
        buf.push(key + '="' + escape(val.join(' ')) + '"');
      } else {
        buf.push(key + '="' + escape(val) + '"');
      }
    }
  }
  return buf.join(' ');
}

function escape(html){
  return String(html)
    .replace(/&(?!\w+;)/g, '&amp;')
    .replace(/</g, '&lt;')
    .replace(/>/g, '&gt;')
    .replace(/"/g, '&quot;');
}

var buf = [];
with (locals || {}) {__.lineno = 1;
__.lineno = 8;
// iterate meta_field_names
(function(){
  if ('number' == typeof meta_field_names.length) {
    for (var i = 0, $$l = meta_field_names.length; i < $$l; i++) {
      var meta_field_name = meta_field_names[i];

__.lineno = 1;
__.lineno = 3;
buf.push('<td');
buf.push(attrs({ "class": ("" + (meta_field_name) + "-cell table-col-" + (meta_field_name) + "") }));
buf.push('>');
__.lineno = undefined;
__.lineno = 3;
if(i == 0)
{
__.lineno = 4;
__.lineno = 4;
buf.push('<div');
buf.push(attrs({ "class": ('permalink') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 6;
buf.push('<a');
buf.push(attrs({ 'href':("/#/post/" + (_id) + "") }));
buf.push('>');
__.lineno = undefined;
__.lineno = 7;
buf.push('<img');
buf.push(attrs({ 'src':("/images/icons/dark/24/preview.png") }));
buf.push('/>');
buf.push('</a>');
buf.push('</div>');
}
__.lineno = 7;
var __val__ = locals[meta_field_name]
buf.push(null == __val__ ? "" : __val__);
buf.push('</td>');
    }
  } else {
    for (var i in meta_field_names) {
      var meta_field_name = meta_field_names[i];

__.lineno = 1;
__.lineno = 3;
buf.push('<td');
buf.push(attrs({ "class": ("" + (meta_field_name) + "-cell table-col-" + (meta_field_name) + "") }));
buf.push('>');
__.lineno = undefined;
__.lineno = 3;
if(i == 0)
{
__.lineno = 4;
__.lineno = 4;
buf.push('<div');
buf.push(attrs({ "class": ('permalink') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 6;
buf.push('<a');
buf.push(attrs({ 'href':("/#/post/" + (_id) + "") }));
buf.push('>');
__.lineno = undefined;
__.lineno = 7;
buf.push('<img');
buf.push(attrs({ 'src':("/images/icons/dark/24/preview.png") }));
buf.push('/>');
buf.push('</a>');
buf.push('</div>');
}
__.lineno = 7;
var __val__ = locals[meta_field_name]
buf.push(null == __val__ ? "" : __val__);
buf.push('</td>');
   }
  }
}).call(this);
}return buf.join("");
} catch (err) {
  rethrow(err, __.input, __.filename, __.lineno);
}
};}, "templates/writing_box": function(exports, require, module) {module.exports = function anonymous(locals) {
var __ = { lineno: 1, input: "//.type-dot(data-target=branch)\n//  img(src=\"/images/#{branch}_dot.png\")\n\na(href=\"#/post/#{_id}\")\n    .inner\n        .copy-container\n            h1!= title[0].all_parsed\n            -if(post_summary[0].raw)\n                .post_summary.post-intro!= post_summary.localized\n            -else if(post_content[0].section_body[0].raw)\n                .post_excerpt.post-intro!= post_content[0].section_body[0].all_parsed\n            -else\n                .post-intro: p No content for this post yet.\n            //a(href=\"#/post/#{_id}\").read-more &rarr;\n", filename: undefined };
function rethrow(err, str, filename, lineno){
  var context = 3
    , lines = str.split('\n')
    , start = Math.max(lineno - context, 0)
    , end = Math.min(lines.length, lineno + context); 

  // Error context
  var context = lines.slice(start, end).map(function(line, i){
    var curr = i + start + 1;
    return (curr == lineno ? '  > ' : '    ')
      + curr
      + '| '
      + line;
  }).join('\n');

  // Alter exception message
  err.path = filename;
  err.message = (filename || 'Jade') + ':' + lineno 
    + '\n' + context + '\n\n' + err.message;
  throw err;
}
try {
function attrs(obj){
  var buf = []
    , terse = obj.terse;
  delete obj.terse;
  var keys = Object.keys(obj)
    , len = keys.length;
  if (len) {
    buf.push('');
    for (var i = 0; i < len; ++i) {
      var key = keys[i]
        , val = obj[key];
      if ('boolean' == typeof val || null == val) {
        if (val) {
          terse
            ? buf.push(key)
            : buf.push(key + '="' + key + '"');
        }
      } else if ('class' == key && Array.isArray(val)) {
        buf.push(key + '="' + escape(val.join(' ')) + '"');
      } else {
        buf.push(key + '="' + escape(val) + '"');
      }
    }
  }
  return buf.join(' ');
}

function escape(html){
  return String(html)
    .replace(/&(?!\w+;)/g, '&amp;')
    .replace(/</g, '&lt;')
    .replace(/>/g, '&gt;')
    .replace(/"/g, '&quot;');
}

var buf = [];
with (locals || {}) {__.lineno = 1;
__.lineno = 2;
buf.push('<!--.type-dot(data-target=branch)-->');
__.lineno = 3;
buf.push('<!--  img(src="/images/#{branch}_dot.png")-->');
__.lineno = 5;
buf.push('<a');
buf.push(attrs({ 'href':("#/post/" + (_id) + "") }));
buf.push('>');
__.lineno = undefined;
__.lineno = 5;
buf.push('<div');
buf.push(attrs({ "class": ('inner') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 6;
buf.push('<div');
buf.push(attrs({ "class": ('copy-container') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 7;
buf.push('<h1>');
var __val__ = title[0].all_parsed
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</h1>');
__.lineno = 8;
if(post_summary[0].raw)
{
__.lineno = 9;
__.lineno = 9;
buf.push('<div');
buf.push(attrs({ "class": ('post_summary') + ' ' + ('post-intro') }));
buf.push('>');
var __val__ = post_summary.localized
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</div>');
}
else if(post_content[0].section_body[0].raw)
{
__.lineno = 11;
__.lineno = 11;
buf.push('<div');
buf.push(attrs({ "class": ('post_excerpt') + ' ' + ('post-intro') }));
buf.push('>');
var __val__ = post_content[0].section_body[0].all_parsed
buf.push(null == __val__ ? "" : __val__);
__.lineno = undefined;
buf.push('</div>');
}
else
{
__.lineno = 13;
__.lineno = 13;
buf.push('<div');
buf.push(attrs({ "class": ('post-intro') }));
buf.push('>');
__.lineno = undefined;
__.lineno = 13;
buf.push('<p>');
buf.push('No content for this post yet.');
__.lineno = undefined;
buf.push('</p>');
buf.push('</div>');
}
__.lineno = 15;
buf.push('<!--a(href="#/post/#{_id}").read-more &rarr;-->');
buf.push('</div>');
buf.push('</div>');
buf.push('</a>');}return buf.join("");
} catch (err) {
  rethrow(err, __.input, __.filename, __.lineno);
}
};}, "views/admin/admin_table": function(exports, require, module) {(function() {
  var AdminTable;
  var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) {
    for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
    function ctor() { this.constructor = child; }
    ctor.prototype = parent.prototype;
    child.prototype = new ctor;
    child.__super__ = parent.prototype;
    return child;
  };
  AdminTable = (function() {
    __extends(AdminTable, require("views/table_active"));
    function AdminTable() {
      this.onRowHangerDblClick = __bind(this.onRowHangerDblClick, this);
      AdminTable.__super__.constructor.apply(this, arguments);
    }
    AdminTable.prototype.tagName = "section";
    AdminTable.prototype.className = "branch-table";
    AdminTable.prototype.initialize = function(options) {
      AdminTable.__super__.initialize.call(this, options);
      this.collection.bind("change", this.render);
      this.collection.bind("destroy", this.render);
      this.collection.bind("refresh", this.render);
      this.collection.bind("add", this.render);
      this.collection.bind("remove", this.render);
      return Object.merge(this.content, {
        table_classes: "light-theme-table",
        row_attributes: function(row) {
          return " id=" + row._id + " ";
        },
        hanger_contents: function(row) {
          return '<a class="delete-row">&times;</a>';
        }
      });
    };
    AdminTable.prototype.onRowHangerDblClick = function(e) {
      var model_id;
      model_id = $(e.target).parents("tr").first().attr("id");
      return this.collection.get(model_id).destroy();
    };
    return AdminTable;
  })();
  module.exports = AdminTable;
}).call(this);
}, "views/admin/crud": function(exports, require, module) {(function() {
  var Create;
  var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) {
    for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
    function ctor() { this.constructor = child; }
    ctor.prototype = parent.prototype;
    child.prototype = new ctor;
    child.__super__ = parent.prototype;
    return child;
  };
  Create = (function() {
    __extends(Create, Backbone.View);
    function Create() {
      this.beforeSendForm = __bind(this.beforeSendForm, this);
      this.render = __bind(this.render, this);
      Create.__super__.constructor.apply(this, arguments);
    }
    Create.prototype.initialize = function(options) {
      var _ref;
      this.$el = $(this.el);
      this.complex_selector = ".multisection-field, .markItUp, .localized-form-field";
      this.parsed_selector = ".markItUp,.localized-form-field";
      this.section_selector = ".multisection-field";
      this.simple_fields_selector = " :not(.multisection-field) :input:not(button):not([name*=\"localized-field\"]) ";
      this.parsed_fields_selector = " div:not(.multisection-field) .markItUp :input:not(button), div:not(.multisection-field) :input:not(button)[name*=\"localized-field\"] ";
      this.form_data = {};
      this.redirect_url = (_ref = options.redirect_url) != null ? _ref : '';
      return this.data = {
        form_fields: options.form_fields
      };
    };
    Create.prototype.render = function() {
      this.$el = $(this.el);
      $(this.el).html(this.template(this.data));
      this.$form = $(this.el).find("form");
      this.$inputs = this.$form.find(":input:not(:button)");
      this.$("textarea").markItUp(content.settings.markit_markdown);
      this.applyClientInteractions();
      return this;
    };
    Create.prototype.beforeSendForm = function(e) {
      e.preventDefault();
      this.prepareInputDefaults();
      interchangeFrenchAndEnglish();
      this.prepareMarkdownFields();
      this.groupMultisectionFields();
      this.buildSimpleFields();
      this.groupRemainingFields();
      return this.traverseData(this.form_data);
    };
    Create.prototype.applyClientInteractions = function() {
      return this.$("button").click(this.beforeSendForm);
    };
    Create.prototype.prepareInputDefaults = function() {
      var $input, field_name, field_value, _ref, _results;
      _ref = this.defaults;
      _results = [];
      for (field_name in _ref) {
        field_value = _ref[field_name];
        $input = this.$inputs.filter("[data-name=\"" + field_name + "\"]");
        _results.push($input.val($input.val() || field_value));
      }
      return _results;
    };
    Create.prototype.prepareMarkdownFields = function() {
      var mdFields;
      mdFields = this.$form.find(".markItUp textarea");
      return mdFields.each(function(i, el) {
        return $(el).attr("data-markdown", mdParse($(el).val()));
      });
    };
    Create.prototype.groupMultisectionFields = function() {
      var $multisection_fields, multisection_fields;
      $multisection_fields = this.$form.find(".multisection-field");
      multisection_fields = {};
      $multisection_fields.each(__bind(function(i, el) {
        var $multisection_parts, field_name;
        field_name = $(el).data("field-name");
        $multisection_parts = $(el).find(".multisection-part");
        return multisection_fields[field_name] = this.groupPostContentParts($multisection_parts, field_name);
      }, this));
      return Object.merge(this.form_data, multisection_fields);
    };
    Create.prototype.groupPostContentParts = function($fields, field_name) {
      var part_el, parts;
      if (field_name === "post_content") {
        return parts = (function() {
          var _i, _len, _results;
          _results = [];
          for (_i = 0, _len = $fields.length; _i < _len; _i++) {
            part_el = $fields[_i];
            _results.push({
              section_title: $(part_el).find('[name*="section_title"]'),
              section_body: $(part_el).find('[name*="section_body"]')
            });
          }
          return _results;
        })();
      }
    };
    Create.prototype.groupRemainingFields = function() {
      var $remaining_fields, grouped;
      $remaining_fields = this.$inputs.filter(__bind(function(i, el) {
        return $(el).parents(this.parsed_selector).length > 0 && $(el).parents(this.section_selector).length === 0;
      }, this));
      grouped = this.groupLocalizedFields($remaining_fields);
      Object.merge(this.form_data, grouped);
      return grouped;
    };
    Create.prototype.groupLocalizedFields = function($fields) {
      var grouped;
      grouped = _.groupBy($fields, __bind(function(el) {
        return $(el).localizedFieldName();
      }, this));
      return Object.each(grouped, function(field_name, els) {
        return grouped[field_name] = $(els);
      });
    };
    Create.prototype.traverseData = function(data) {
      if (Object.isArray(data)) {
        return data.each(__bind(function(item) {
          return this.traverseData(item);
        }, this));
      } else if (Object.isObject(data)) {
        return Object.each(data, __bind(function(field_name, v) {
          var $els, all_parsed, el;
          if (v instanceof jQuery) {
            $els = v;
            data[field_name] = (function() {
              var _i, _len, _results;
              _results = [];
              for (_i = 0, _len = $els.length; _i < _len; _i++) {
                el = $els[_i];
                _results.push($(el).parseFormField());
              }
              return _results;
            })();
            all_parsed = _.pluck(data[field_name], "parsed");
            all_parsed = all_parsed.join(" ").padRight(1, "</div>").padLeft(1, "<div class=\"localized-content localized-" + field_name + "\">");
            return data[field_name].each(function(item) {
              return item.all_parsed = all_parsed;
            });
          } else if (Object.isArray(v)) {
            return this.traverseData(v);
          } else if (Object.isObject(v)) {
            return this.traverseData(v);
          }
        }, this));
      }
    };
    Create.prototype.buildSimpleFields = function() {
      var $simple_fields;
      $simple_fields = this.$inputs.not(__bind(function(i, el) {
        return $(el).parents(this.complex_selector).length;
      }, this));
      return $simple_fields.each(__bind(function(i, el) {
        var field_name;
        field_name = $(el).attr("name");
        return this.form_data[field_name] = $(el).val();
      }, this));
    };
    return Create;
  })();
  module.exports = Create;
}).call(this);
}, "views/admin/crud_post": function(exports, require, module) {(function() {
  var CreatePost;
  var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) {
    for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
    function ctor() { this.constructor = child; }
    ctor.prototype = parent.prototype;
    child.prototype = new ctor;
    child.__super__ = parent.prototype;
    return child;
  };
  CreatePost = (function() {
    __extends(CreatePost, require("views/admin/crud"));
    function CreatePost() {
      this.beforeSendForm = __bind(this.beforeSendForm, this);
      CreatePost.__super__.constructor.apply(this, arguments);
    }
    CreatePost.prototype.template = require("templates/admin/post");
    CreatePost.prototype.defaults = {
      title: "Untitled"
    };
    CreatePost.prototype.initialize = function(options) {
      var _ref;
      CreatePost.__super__.initialize.call(this, options);
      this.has_errors = false;
      this.type = options.type;
      this.data = Object.merge(this.data, {
        form_submit_label: "" + (this.type.capitalize()) + " this post",
        values: ((_ref = this.model) != null ? _ref.toJSON() : void 0) || null
      });
      if (this.type === "create") {
        this.data.extra_fields = "<input type=\"hidden\" value=\"" + options.branch_name + "\" name=\"branch\">\n";
      } else if (this.type === "update") {
        this.data.extra_fields = "<input type=\"hidden\" name=\"_method\" value=\"PUT\">";
      }
      return this;
    };
    CreatePost.prototype.applyClientInteractions = function() {
      CreatePost.__super__.applyClientInteractions.call(this);
      if (this.type === "create") {
        return this.$(".form-field-branch").remove();
      }
    };
    CreatePost.prototype.beforeSendForm = function(e) {
      CreatePost.__super__.beforeSendForm.call(this, e);
      this.prepareCheckboxSelection();
      this.prepareBoxSelection();
      return this.dbAction();
    };
    CreatePost.prototype.dbAction = function() {
      var post;
      if (this.type === "create") {
        post = new (require("models/post"))(this.form_data);
        post.save();
        this.collection.add(post);
      } else {
        this.model.save(this.form_data);
      }
      return window.location.hash = "/list/posts";
    };
    CreatePost.prototype.prepareCheckboxSelection = function() {
      this.form_data.in_table = this.$form.find('[name="in_table"]').is(":checked");
      return this.form_data.in_storyboard = this.$form.find('[name="in_storyboard"]').is(":checked");
    };
    CreatePost.prototype.prepareBoxSelection = function() {
      if (this.form_data.in_storyboard) {
        if (this.form_data.box_type === "automatic") {
          if (this.form_data.flickr_set_id) {
            this.form_data.box_type = "photo";
          } else {
            this.form_data.box_type = "writing";
          }
        }
        if (this.form_data.box_type === "photo" && !this.form_data.flickr_set_id) {
          return this.form_data.box_type = "writing";
        }
      }
    };
    return CreatePost;
  })();
  module.exports = CreatePost;
}).call(this);
}, "views/admin/crud_team": function(exports, require, module) {(function() {
  var CrudTeam;
  var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) {
    for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
    function ctor() { this.constructor = child; }
    ctor.prototype = parent.prototype;
    child.prototype = new ctor;
    child.__super__ = parent.prototype;
    return child;
  };
  CrudTeam = (function() {
    __extends(CrudTeam, require("views/admin/crud"));
    function CrudTeam() {
      this.beforeSendForm = __bind(this.beforeSendForm, this);
      CrudTeam.__super__.constructor.apply(this, arguments);
    }
    CrudTeam.prototype.template = require("templates/admin/create_team_member");
    CrudTeam.prototype.defaults = {
      "first_name": "unknown"
    };
    CrudTeam.prototype.initialize = function(options) {
      var _ref;
      CrudTeam.__super__.initialize.call(this, options);
      this.type = options.type;
      this.redirection_url = options.redirection_url;
      return Object.merge(this.data, {
        values: ((_ref = this.model) != null ? _ref.toJSON() : void 0) || null,
        form_submit_label: "" + (this.type.capitalize()) + " this team member"
      });
    };
    CrudTeam.prototype.beforeSendForm = function(e) {
      CrudTeam.__super__.beforeSendForm.call(this, e);
      this.prepareCheckboxSelection();
      return this.dbAction();
    };
    CrudTeam.prototype.prepareCheckboxSelection = function() {
      this.form_data.in_about = this.$form.find('[name="in_about"]').is(":checked");
      return this.form_data.in_footer = this.$form.find('[name="in_footer"]').is(":checked");
    };
    CrudTeam.prototype.dbAction = function() {
      var team_member;
      if (this.type === "create") {
        team_member = new (require("models/team_member"))(this.form_data);
        team_member.save();
        this.collection.add(team_member);
      } else {
        this.model.save(this.form_data);
      }
      return window.location.hash = this.redirect_url;
    };
    return CrudTeam;
  })();
  module.exports = CrudTeam;
}).call(this);
}, "views/admin/table_branch": function(exports, require, module) {(function() {
  var TableBranch;
  var __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) {
    for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
    function ctor() { this.constructor = child; }
    ctor.prototype = parent.prototype;
    child.prototype = new ctor;
    child.__super__ = parent.prototype;
    return child;
  }, __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
  TableBranch = (function() {
    __extends(TableBranch, require("views/admin/admin_table"));
    function TableBranch() {
      TableBranch.__super__.constructor.apply(this, arguments);
    }
    TableBranch.prototype.tagName = "section";
    TableBranch.prototype.className = "branch-table";
    TableBranch.prototype.initialize = function(options) {
      TableBranch.__super__.initialize.call(this, options);
      this.branch_name = options.branch_name;
      this.$el.addClass("" + this.branch_name + "-table");
      this.$el.attr("data-branch", this.branch_name);
      Object.merge(this.content, {
        table_label: this.branch_name,
        column_names: content.sets["" + this.branch_name + "_tabular_order"],
        row_url_base: "#/update/post/"
      });
      this.content.column_names.in_table = "table";
      return this.content.column_names.in_storyboard = "storyboard";
    };
    TableBranch.prototype.updateRowData = function() {
      var models, row_data;
      models = this.collection.select(__bind(function(model) {
        return model.get("branch") === this.branch_name;
      }, this));
      row_data = models.map(function(model) {
        return model.toJSON();
      });
      return this.content.rows = row_data;
    };
    return TableBranch;
  })();
  module.exports = TableBranch;
}).call(this);
}, "views/box_list": function(exports, require, module) {(function() {
  var BoxList;
  var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) {
    for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
    function ctor() { this.constructor = child; }
    ctor.prototype = parent.prototype;
    child.prototype = new ctor;
    child.__super__ = parent.prototype;
    return child;
  };
  BoxList = (function() {
    __extends(BoxList, Backbone.View);
    function BoxList() {
      this.add = __bind(this.add, this);
      this.render = __bind(this.render, this);
      BoxList.__super__.constructor.apply(this, arguments);
    }
    BoxList.prototype.tagName = 'ul';
    BoxList.prototype.className = "box-list";
    BoxList.prototype.initialize = function() {
      return this.$el = $(this.el);
    };
    BoxList.prototype.render = function() {
      this.$el.empty();
      this.collection.each(this.add);
      return this;
    };
    BoxList.prototype.add = function(model) {
      var box_type, box_type_class, view;
      box_type = model.get("box_type");
      box_type_class = (function() {
        switch (box_type) {
          case "photo":
            return "photo_box";
          case "photo_plain":
            return "photo_plain_box";
          case "writing":
            return "writing_box";
          case "tweet":
            return "tweet_box";
          default:
            return "writing_box";
        }
      })();
      view = new (require("views/boxes/" + box_type_class))({
        model: model
      });
      return this.$el.append(view.render().el);
    };
    return BoxList;
  })();
  module.exports = BoxList;
}).call(this);
}, "views/boxes/generic_box": function(exports, require, module) {(function() {
  var GenericBoxView;
  var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) {
    for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
    function ctor() { this.constructor = child; }
    ctor.prototype = parent.prototype;
    child.prototype = new ctor;
    child.__super__ = parent.prototype;
    return child;
  };
  GenericBoxView = (function() {
    __extends(GenericBoxView, Backbone.View);
    function GenericBoxView() {
      this.render = __bind(this.render, this);
      GenericBoxView.__super__.constructor.apply(this, arguments);
    }
    GenericBoxView.prototype.template = require("templates/generic_box");
    GenericBoxView.prototype.tagName = "li";
    GenericBoxView.prototype.initialize = function() {
      this.$el = $(this.el);
      this.$el.attr("data-branch", this.model.get("branch"));
      return this.$el.addClass("box");
    };
    GenericBoxView.prototype.render = function() {
      this.$el.html(this.template(this.model.toJSON()));
      return this;
    };
    return GenericBoxView;
  })();
  module.exports = GenericBoxView;
}).call(this);
}, "views/boxes/photo_box": function(exports, require, module) {(function() {
  var PhotoBox;
  var __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) {
    for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
    function ctor() { this.constructor = child; }
    ctor.prototype = parent.prototype;
    child.prototype = new ctor;
    child.__super__ = parent.prototype;
    return child;
  };
  PhotoBox = (function() {
    __extends(PhotoBox, require("views/boxes/generic_box"));
    function PhotoBox() {
      PhotoBox.__super__.constructor.apply(this, arguments);
    }
    PhotoBox.prototype.template = require("templates/photo_box");
    PhotoBox.prototype.className = "photo-box";
    PhotoBox.prototype.initialize = function() {
      var is_posteronly, pphoto, pphoto_url;
      PhotoBox.__super__.initialize.call(this);
      pphoto = this.model.get("primary_photo");
      is_posteronly = /posteronly/.test(pphoto.tags);
      pphoto_url = is_posteronly ? pphoto.url_o : pphoto.url_m;
      if (!pphoto.url_m) {
        pphoto_url = pphoto.url_o;
      }
      return this.model.set({
        "primary_photo_poster_url": pphoto_url
      });
    };
    return PhotoBox;
  })();
  module.exports = PhotoBox;
}).call(this);
}, "views/boxes/photo_plain_box": function(exports, require, module) {(function() {
  var PhotoPlainBox;
  var __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) {
    for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
    function ctor() { this.constructor = child; }
    ctor.prototype = parent.prototype;
    child.prototype = new ctor;
    child.__super__ = parent.prototype;
    return child;
  };
  PhotoPlainBox = (function() {
    __extends(PhotoPlainBox, require("views/boxes/generic_box"));
    function PhotoPlainBox() {
      PhotoPlainBox.__super__.constructor.apply(this, arguments);
    }
    PhotoPlainBox.prototype.template = require("templates/photo_plain_box");
    PhotoPlainBox.prototype.className = "photo-plain-box";
    PhotoPlainBox.prototype.initialize = function() {
      var is_posteronly, pphoto, pphoto_url;
      PhotoPlainBox.__super__.initialize.call(this);
      pphoto = this.model.get("primary_photo");
      is_posteronly = /posteronly/.test(pphoto.tags);
      pphoto_url = is_posteronly ? pphoto.url_o : pphoto.url_m;
      if (!pphoto.url_m) {
        pphoto_url = pphoto.url_o;
      }
      return this.model.set({
        "primary_photo_poster_url": pphoto_url,
        "url_target": this.model.get("custom_storyboard_url")
      });
    };
    return PhotoPlainBox;
  })();
  module.exports = PhotoPlainBox;
}).call(this);
}, "views/boxes/tweet_box": function(exports, require, module) {(function() {
  var TweetBox;
  var __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) {
    for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
    function ctor() { this.constructor = child; }
    ctor.prototype = parent.prototype;
    child.prototype = new ctor;
    child.__super__ = parent.prototype;
    return child;
  };
  TweetBox = (function() {
    __extends(TweetBox, Backbone.View);
    function TweetBox() {
      TweetBox.__super__.constructor.apply(this, arguments);
    }
    TweetBox.prototype.tagName = "li";
    TweetBox.prototype.template = "<a href=\"http://twitter.com/#!/_Kanva\", target=\"_blank\"></a>";
    TweetBox.prototype.initialize = function() {
      this.$el = $(this.el);
      return this.$el.addClass("box tweet-box");
    };
    TweetBox.prototype.render = function() {
      this.$el.html(this.template);
      this.$el.find('a').tweet({
        username: "_kanva",
        join_text: "auto",
        count: 1,
        loading_text: "loading tweets...",
        auto_join_text_url: '',
        auto_join_text_default: '',
        auto_join_text_ed: '',
        auto_join_text_reply: '',
        auto_join_text_ing: '',
        intro_text: false,
        outro_text: false
      });
      return this;
    };
    return TweetBox;
  })();
  module.exports = TweetBox;
}).call(this);
}, "views/boxes/writing_box": function(exports, require, module) {(function() {
  var WritingBox;
  var __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) {
    for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
    function ctor() { this.constructor = child; }
    ctor.prototype = parent.prototype;
    child.prototype = new ctor;
    child.__super__ = parent.prototype;
    return child;
  };
  WritingBox = (function() {
    __extends(WritingBox, require("views/boxes/generic_box"));
    function WritingBox() {
      WritingBox.__super__.constructor.apply(this, arguments);
    }
    WritingBox.prototype.template = require("templates/writing_box");
    WritingBox.prototype.className = "writing-box dark-theme";
    return WritingBox;
  })();
  module.exports = WritingBox;
}).call(this);
}, "views/canvas": function(exports, require, module) {(function() {
  var Canvas;
  var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) {
    for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
    function ctor() { this.constructor = child; }
    ctor.prototype = parent.prototype;
    child.prototype = new ctor;
    child.__super__ = parent.prototype;
    return child;
  };
  Canvas = (function() {
    __extends(Canvas, require("views/story"));
    function Canvas() {
      this.renderIsotope = __bind(this.renderIsotope, this);
      Canvas.__super__.constructor.apply(this, arguments);
    }
    Canvas.prototype.className = 'canvas';
    Canvas.prototype.initialize = function(options) {
      var collection_has_tweet_box;
      Canvas.__super__.initialize.call(this, options);
      this.isotope_options = {
        layoutMode: "masonry"
      };
      collection_has_tweet_box = this.box_list.collection.any(function(model) {
        return model.get("box_type") === "tweet";
      });
      if (!collection_has_tweet_box) {
        return this.box_list.collection.add(new Backbone.Model({
          box_type: "tweet"
        }));
      }
    };
    Canvas.prototype.renderIsotope = function() {
      Canvas.__super__.renderIsotope.call(this);
      return this.$box_list.isotope("shuffle");
    };
    return Canvas;
  })();
  module.exports = Canvas;
}).call(this);
}, "views/menus/list_menu": function(exports, require, module) {(function() {
  var BoxListFilterMenu, buildCSSSelector;
  var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) {
    for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
    function ctor() { this.constructor = child; }
    ctor.prototype = parent.prototype;
    child.prototype = new ctor;
    child.__super__ = parent.prototype;
    return child;
  };
  buildCSSSelector = function(array, builder) {
    var css_selector;
    css_selector = "";
    _(array).each(function(value, i) {
      if (i !== 0) {
        css_selector += ",";
      }
      return css_selector += builder(value);
    });
    return css_selector;
  };
  BoxListFilterMenu = (function() {
    __extends(BoxListFilterMenu, require("views/menus/menu"));
    function BoxListFilterMenu() {
      this.onMenuItemClick = __bind(this.onMenuItemClick, this);
      this.addMenuItem = __bind(this.addMenuItem, this);
      BoxListFilterMenu.__super__.constructor.apply(this, arguments);
    }
    BoxListFilterMenu.prototype.events = {
      "click .menu-item": "onMenuItemClick"
    };
    BoxListFilterMenu.prototype.initialize = function() {
      return BoxListFilterMenu.__super__.initialize.apply(this, arguments);
    };
    BoxListFilterMenu.prototype.addMenuItem = function(menu_item) {
      return BoxListFilterMenu.__super__.addMenuItem.call(this, menu_item);
    };
    BoxListFilterMenu.prototype.onMenuItemClick = function(e) {
      var $current_target, css_selector, filters;
      $current_target = $(e.currentTarget);
      this.toggleMenuItem($current_target);
      filters = [];
      this.$$menu_items.filter(".on").each(__bind(function(i, menu_item) {
        return filters.push($(menu_item).attr("data-target"));
      }, this));
      css_selector = buildCSSSelector(filters, function(branch_name) {
        return "[data-branch=\"" + branch_name + "\"]";
      });
      return this.trigger("filter", {
        css_selector: css_selector,
        names: filters
      });
    };
    BoxListFilterMenu.prototype.updateMenuSelection = function(selection_name) {
      var $$unselected_menu_items, $selected_menu_item;
      $$unselected_menu_items = this.getMenuItemsExcept(selection_name);
      $selected_menu_item = this.getMenuItems(selection_name);
      $$unselected_menu_items.addClass(this.classes.off).removeClass(this.classes.on);
      $selected_menu_item.addClass(this.classes.on).removeClass(this.classes.off);
      return this.checkForOneLeft();
    };
    return BoxListFilterMenu;
  })();
  module.exports = BoxListFilterMenu;
}).call(this);
}, "views/menus/menu": function(exports, require, module) {(function() {
  var Menu;
  var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) {
    for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
    function ctor() { this.constructor = child; }
    ctor.prototype = parent.prototype;
    child.prototype = new ctor;
    child.__super__ = parent.prototype;
    return child;
  };
  Menu = (function() {
    __extends(Menu, Backbone.View);
    function Menu() {
      this.addMenuItem = __bind(this.addMenuItem, this);
      this.enableMenu = __bind(this.enableMenu, this);
      this.disableMenu = __bind(this.disableMenu, this);
      this.render = __bind(this.render, this);
      Menu.__super__.constructor.apply(this, arguments);
    }
    Menu.prototype.template = "<ul></ul>";
    Menu.prototype.initialize = function(options) {
      var _ref;
      this.$el = $(this.el);
      this.$el.addClass("menu white-hmenu").addClass("" + (this.model.get("name")) + "-menu");
      this.force_at_least_one_selection = options.force_at_least_one_selection || true;
      this.menu_item_template = require("templates/menu_item");
      this.use_tooltips = (_ref = options.use_tooltips) != null ? _ref : false;
      this.tooltip_options = options.tooltip_options || {};
      return this.classes = {
        "on": "on",
        "off": "off"
      };
    };
    Menu.prototype.render = function() {
      this.$el.html(this.template);
      this.model.get("menu_items").each(this.addMenuItem);
      this.$menu_items = this.$(".menu-item");
      this.$menu_items.addClass(this.classes.on);
      this.applyClientInteractions();
      return this;
    };
    Menu.prototype.applyClientInteractions = function() {
      if (this.use_tooltips) {
        return this.renderTooltips();
      }
    };
    Menu.prototype.renderTooltips = function() {
      return this.$menu_items.qtip(this.tooltip_options);
    };
    Menu.prototype.changeMenuItemsState = function(names, to_state) {
      var $to_change_menu_items;
      $to_change_menu_items = this.$menu_items.filter(__bind(function(i, item) {
        var has_name;
        has_name = new RegExp($(item).data("target"));
        return has_name.test(names);
      }, this));
      if (to_state === false) {
        return $to_change_menu_items.addClass("off").removeClass("on");
      } else if (to_state === true) {
        return $to_change_menu_items.removeClass("off").addClass("on");
      }
    };
    Menu.prototype.disableMenuItems = function(names) {
      return this.changeMenuItemsState(names, false);
    };
    Menu.prototype.enableMenuItems = function(names) {
      return this.changeMenuItemsState(names, true);
    };
    Menu.prototype.disableMenu = function() {
      return this.$el.addClass("off").removeClass("on");
    };
    Menu.prototype.enableMenu = function() {
      return this.$el.removeClass("off").addClass("on");
    };
    Menu.prototype.addMenuItem = function(menu_item) {
      var $menu_item, menu_item_html;
      menu_item_html = this.menu_item_template(menu_item);
      this.$el.find('ul').append(menu_item_html);
      $menu_item = this.$(".menu-item-" + menu_item.slug);
      return _(menu_item.attributes).each(function(attr_value, attr_name) {
        return $menu_item.attr(attr_name, attr_value);
      });
    };
    Menu.prototype.checkForOneLeft = function() {
      this.$active_menu_items = this.$menu_items.filter(function(i, item_el) {
        return $(item_el).hasClass("on");
      });
      if (this.$active_menu_items.length === 1) {
        return this.$active_menu_items.addClass("last-one");
      } else {
        return this.$menu_items.removeClass("last-one");
      }
    };
    Menu.prototype.getMenuItemsExcept = function(selection_name) {
      return this.$menu_items.filter(__bind(function(i, menu_item) {
        return $(menu_item).data("target") !== selection_name;
      }, this));
    };
    Menu.prototype.getMenuItems = function(selection_name) {
      return this.$menu_items.filter(__bind(function(i, menu_item) {
        return $(menu_item).data("target") === selection_name;
      }, this));
    };
    Menu.prototype.toggleMenuItem = function(selection_name) {
      var $menu_item;
      if (typeof selection_name === 'object') {
        $menu_item = selection_name;
      } else {
        $menu_item = this.getMenuItems(selection_name);
      }
      $menu_item.toggleClass("on off");
      return this.checkForOneLeft();
    };
    return Menu;
  })();
  module.exports = Menu;
}).call(this);
}, "views/menus/pagination_menu": function(exports, require, module) {(function() {
  var PaginationMenu;
  var __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) {
    for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
    function ctor() { this.constructor = child; }
    ctor.prototype = parent.prototype;
    child.prototype = new ctor;
    child.__super__ = parent.prototype;
    return child;
  };
  PaginationMenu = (function() {
    __extends(PaginationMenu, require("views/menus/menu"));
    function PaginationMenu() {
      PaginationMenu.__super__.constructor.apply(this, arguments);
    }
    PaginationMenu.prototype.events = {
      "click .menu-item": "onClick"
    };
    PaginationMenu.prototype.onClick = function(e) {
      var direction;
      direction = $(e.currentTarget).attr("data-target");
      return this.trigger("page", direction);
    };
    return PaginationMenu;
  })();
  module.exports = PaginationMenu;
}).call(this);
}, "views/menus/radio_filter_menu": function(exports, require, module) {(function() {
  var RadioFilteMenu;
  var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) {
    for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
    function ctor() { this.constructor = child; }
    ctor.prototype = parent.prototype;
    child.prototype = new ctor;
    child.__super__ = parent.prototype;
    return child;
  };
  RadioFilteMenu = (function() {
    __extends(RadioFilteMenu, require("views/menus/radio_menu"));
    function RadioFilteMenu() {
      this.onMenuItemClick = __bind(this.onMenuItemClick, this);
      RadioFilteMenu.__super__.constructor.apply(this, arguments);
    }
    RadioFilteMenu.prototype.template = "<ul>\n    <li class=\"menu-item menu-item-all\" data-target=\"all\">\n        <a class=\"the-button typo-brand thin-menu-item\">\n            <span class=\"the-label\">\n                " + (window._i("All")) + "\n            </span>\n        </a>\n    </li>\n</ul>\n";
    RadioFilteMenu.prototype.initialize = function(options) {
      return RadioFilteMenu.__super__.initialize.call(this, options);
    };
    RadioFilteMenu.prototype.applyClientInteractions = function() {
      RadioFilteMenu.__super__.applyClientInteractions.call(this);
      return this.$menu_items.filter('[data-target="updates"]').remove();
    };
    RadioFilteMenu.prototype.onMenuItemClick = function(e) {
      var target, _ref;
      RadioFilteMenu.__super__.onMenuItemClick.call(this, e);
      target = (_ref = $(e.currentTarget).data("target")) != null ? _ref : '';
      if (target === "all") {
        return this.trigger("unfilter");
      } else {
        return this.trigger("filter", {
          target: target
        });
      }
    };
    return RadioFilteMenu;
  })();
  module.exports = RadioFilteMenu;
}).call(this);
}, "views/menus/radio_menu": function(exports, require, module) {(function() {
  var RadioMenu;
  var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) {
    for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
    function ctor() { this.constructor = child; }
    ctor.prototype = parent.prototype;
    child.prototype = new ctor;
    child.__super__ = parent.prototype;
    return child;
  };
  RadioMenu = (function() {
    __extends(RadioMenu, require("views/menus/menu"));
    function RadioMenu() {
      this.onMenuItemClick = __bind(this.onMenuItemClick, this);
      RadioMenu.__super__.constructor.apply(this, arguments);
    }
    RadioMenu.prototype.initialize = function(options) {
      RadioMenu.__super__.initialize.call(this, options);
      return this.$el.addClass("radio-menu");
    };
    RadioMenu.prototype.applyClientInteractions = function() {
      RadioMenu.__super__.applyClientInteractions.call(this);
      this.turnAllMenuItems(false);
      this.turnMenuItem(this.$menu_items.first(), true);
      return this.$menu_items.click(this.onMenuItemClick);
    };
    RadioMenu.prototype.onMenuItemClick = function(e) {
      return this.radioTo($(e.currentTarget));
    };
    RadioMenu.prototype.radioTo = function($menu_item) {
      if (typeof $menu_item === "string") {
        $menu_item = $($menu_item);
      }
      if (!$menu_item.hasClass("on")) {
        this.turnAllMenuItems(false);
        return this.turnMenuItem($menu_item, true);
      }
    };
    RadioMenu.prototype.turnAllMenuItems = function(state) {
      return this.$menu_items.each(__bind(function(i, el) {
        return this.turnMenuItem($(el), state);
      }, this));
    };
    RadioMenu.prototype.turnMenuItem = function($menu_item, state) {
      if (state === false) {
        return $menu_item.removeClass("on").addClass("off");
      } else if (state === true) {
        return $menu_item.removeClass("off").addClass("on");
      }
    };
    return RadioMenu;
  })();
  module.exports = RadioMenu;
}).call(this);
}, "views/nexus": function(exports, require, module) {(function() {
  var Nexus;
  var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) {
    for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
    function ctor() { this.constructor = child; }
    ctor.prototype = parent.prototype;
    child.prototype = new ctor;
    child.__super__ = parent.prototype;
    return child;
  };
  Nexus = (function() {
    __extends(Nexus, Backbone.View);
    function Nexus() {
      this.viewChange = __bind(this.viewChange, this);
      this.onViewChange = __bind(this.onViewChange, this);
      this.render = __bind(this.render, this);
      Nexus.__super__.constructor.apply(this, arguments);
    }
    Nexus.prototype.initialize = function(config) {
      this.collection.bind('refresh', this.render);
      this.$el = $(this.el);
      this.current_view = config.default_view || "storyboard";
      this.$injection_el = '';
      this.table = new (require("views/table_mode"))({
        collection: this.collection,
        $menu_injection_container: ".menus-container",
        table_constructor: require("views/table_sectioned")
      });
      this.storyboard = new (require("views/canvas"))({
        collection: app.collections.in_storyboard_posts,
        menu: false
      });
      this.storyboard_waypoint = void 0;
      return this.view_modes = {
        table: {
          is_rendered: false,
          view: this.table
        },
        storyboard: {
          is_rendered: false,
          view: this.storyboard
        }
      };
    };
    Nexus.prototype.render = function() {
      this.$el.empty();
      app.menus.view_menu.$el.find(".menu-item").click(this.onViewChange);
      return this;
    };
    Nexus.prototype.onViewChange = function(e) {
      var view_name;
      view_name = $(e.currentTarget).attr("data-target");
      return window.location.hash = "/home/" + view_name;
    };
    Nexus.prototype.viewChange = function(to_view_name) {
      var $selected_menu_item, target;
      this.current_view = to_view_name;
      if (!this.view_modes[this.current_view].is_rendered) {
        this.$el.append(this.view_modes[this.current_view].view.render().el);
        this.view_modes[this.current_view].is_rendered = true;
      }
      if (this.current_view === "storyboard") {
        $selected_menu_item = app.menus.canvas_filter_menu.$el.find(".on");
        target = $selected_menu_item.data("target");
        if (target === "all") {
          target = "*";
        }
        this.storyboard.filter({
          target: target
        });
        $(window).scrollTop(0);
      }
      if (this.current_view === "table") {
        if (app.menus.canvas_filter_menu.$el.find(".on").data("target") === "all") {
          app.menus.canvas_filter_menu.radioTo(".menu-item-architecture");
        }
        $selected_menu_item = app.menus.canvas_filter_menu.$el.find(".on");
        return this.table.jumpToTable($selected_menu_item.data("target"));
      }
    };
    Nexus.prototype.trackMenu = function(which) {
      if (which === "table") {
        this.trackListMenu();
        return this.untrackCanvasMenu();
      } else if (which === "storyboard") {
        this.trackCanvasMenu();
        return this.untrackListMenu();
      }
    };
    Nexus.prototype.untrackMenu = function(which) {
      if ("all") {
        this.untrackCanvasMenu();
        return this.untrackListMenu();
      } else if ("storyboard") {
        return this.untrackCanvasMenu();
      } else if ("table") {
        return this.untrackListMenu();
      }
    };
    Nexus.prototype.trackCanvasMenu = function() {
      app.menus.canvas_filter_menu.bind("filter", this.storyboard.filter);
      return app.menus.canvas_filter_menu.bind("unfilter", this.storyboard.unfilter);
    };
    Nexus.prototype.untrackCanvasMenu = function() {
      app.menus.canvas_filter_menu.unbind("filter", this.storyboard.filter);
      return app.menus.canvas_filter_menu.unbind("unfilter", this.storyboard.unfilter);
    };
    Nexus.prototype.trackListMenu = function() {
      return app.menus.canvas_filter_menu.$menu_items.bind("click", this.table.onScrollToTable);
    };
    Nexus.prototype.untrackListMenu = function() {
      return app.menus.canvas_filter_menu.$menu_items.unbind("click", this.table.onScrollToTable);
    };
    return Nexus;
  })();
  module.exports = Nexus;
}).call(this);
}, "views/post": function(exports, require, module) {(function() {
  var Post;
  var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) {
    for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
    function ctor() { this.constructor = child; }
    ctor.prototype = parent.prototype;
    child.prototype = new ctor;
    child.__super__ = parent.prototype;
    return child;
  };
  Post = (function() {
    __extends(Post, Backbone.View);
    function Post() {
      this.render = __bind(this.render, this);
      Post.__super__.constructor.apply(this, arguments);
    }
    Post.prototype.tagName = 'li';
    Post.prototype.initialize = function() {
      this.$el = $(this.el);
      this.$el.addClass(this.model.get('branch'));
      if (!this.model.get("flickr_set")) {
        return this.$el.addClass("sans-photo");
      } else {
        return this.$el.addClass("photo-post");
      }
    };
    Post.prototype.className = 'post';
    Post.prototype.template = require("templates/post");
    Post.prototype.render = function() {
      $(this.el).html(this.template(this.model.toJSON()));
      return this;
    };
    return Post;
  })();
  module.exports = Post;
}).call(this);
}, "views/posts_list": function(exports, require, module) {(function() {
  var PostsList;
  var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) {
    for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
    function ctor() { this.constructor = child; }
    ctor.prototype = parent.prototype;
    child.prototype = new ctor;
    child.__super__ = parent.prototype;
    return child;
  };
  PostsList = (function() {
    __extends(PostsList, Backbone.View);
    function PostsList() {
      this.createBranchTable = __bind(this.createBranchTable, this);
      this.render = __bind(this.render, this);
      PostsList.__super__.constructor.apply(this, arguments);
    }
    PostsList.prototype.className = "posts-list";
    PostsList.prototype.initialize = function(options) {
      this.$el = $(this.el);
      if (options.className) {
        this.$el.addClass(options.className);
      }
      this.TableConstructor = options.table_constructor;
      this.tables = {};
      this.available_branches = _.uniq(this.collection.pluck("branch"));
      this.available_branches.sortBy(function(branch_name) {
        return content.sets.branches.indexOf(branch_name);
      });
      this.available_branches.each(this.createBranchTable);
      return this;
    };
    PostsList.prototype.render = function() {
      this.$el.empty();
      Object.each(this.tables, __bind(function(branch_name, table_view) {
        return this.$el.append(table_view.render().el);
      }, this));
      this.applyClientInteractions();
      return this;
    };
    PostsList.prototype.applyClientInteractions = function() {};
    PostsList.prototype.createBranchTable = function(branch_name) {
      this.tables[branch_name] = new this.TableConstructor({
        collection: this.collection,
        branch_name: branch_name
      });
      return this;
    };
    return PostsList;
  })();
  module.exports = PostsList;
}).call(this);
}, "views/site/about": function(exports, require, module) {(function() {
  var About;
  var __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) {
    for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
    function ctor() { this.constructor = child; }
    ctor.prototype = parent.prototype;
    child.prototype = new ctor;
    child.__super__ = parent.prototype;
    return child;
  };
  About = (function() {
    __extends(About, Backbone.View);
    function About() {
      About.__super__.constructor.apply(this, arguments);
    }
    About.prototype.template = require("templates/about");
    About.prototype.initialize = function(config) {
      this.$el = $(this.el);
      return this.content = {
        team: app.collections.team.toJSON()
      };
    };
    About.prototype.render = function() {
      this.$el.html(this.template(this.content));
      return this.$("table").tablesorter2({
        sortList: [[1, 0]]
      });
    };
    return About;
  })();
  module.exports = About;
}).call(this);
}, "views/site/footer": function(exports, require, module) {(function() {
  var SiteFooter;
  var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) {
    for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
    function ctor() { this.constructor = child; }
    ctor.prototype = parent.prototype;
    child.prototype = new ctor;
    child.__super__ = parent.prototype;
    return child;
  };
  SiteFooter = (function() {
    __extends(SiteFooter, Backbone.View);
    function SiteFooter() {
      this.render = __bind(this.render, this);
      SiteFooter.__super__.constructor.apply(this, arguments);
    }
    SiteFooter.prototype.template = require("templates/site_footer");
    SiteFooter.prototype.tagName = "footer";
    SiteFooter.prototype.className = "site-footer dark-zone";
    SiteFooter.prototype.initialize = function() {
      this.data = {};
      return this.$el = $(this.el);
    };
    SiteFooter.prototype.render = function() {
      this.data.team = this.collection.toJSON();
      this.$el.html(this.template(this.data));
      return this;
    };
    return SiteFooter;
  })();
  module.exports = SiteFooter;
}).call(this);
}, "views/site/single": function(exports, require, module) {(function() {
  var Single;
  var __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) {
    for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
    function ctor() { this.constructor = child; }
    ctor.prototype = parent.prototype;
    child.prototype = new ctor;
    child.__super__ = parent.prototype;
    return child;
  }, __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
  Single = (function() {
    __extends(Single, Backbone.View);
    function Single() {
      Single.__super__.constructor.apply(this, arguments);
    }
    Single.prototype.template = require("templates/single");
    Single.prototype.initialize = function(config) {
      var branch_name, specification_labels, specifications, storyline_boxes, storyline_collection;
      this.$el = $(this.el);
      specifications = {};
      branch_name = this.model.get("branch");
      specification_labels = Object.clone(content.sets["" + branch_name + "_tabular_order"]);
      delete specification_labels.title;
      this.model.set({
        branch_name: branch_name,
        related_posts: this.getRelatedPosts(),
        specification_labels: specification_labels
      });
      storyline_boxes = app.collections.in_storyboard_posts.filter(__bind(function(model) {
        return model.get("_id") !== this.model.get("_id");
      }, this));
      return storyline_collection = new Backbone.Collection(storyline_boxes);
    };
    Single.prototype.render = function() {
      this.$el.empty();
      this.$el.append(this.template(this.model.toJSON()));
      this.applyClientInteractions();
      return this;
    };
    Single.prototype.applyClientInteractions = function() {
      var $article, $driver, article_margin_bottom, end_offset, header_height, menu_height, menu_margin_top;
      $article = this.$("article");
      $driver = this.$(".article-navigation");
      $article.css({
        "margin-left": $driver.outerWidth() + 100
      });
      $driver.find(".segment-anchor").addClass("off").first().removeClass("off").addClass("on");
      $("article a:has(img)").fancybox({
        transitionIn: "elastic",
        transitionOut: "elastic",
        overlayOpacity: 0.8,
        overlayColor: "#000",
        changeSpeed: 500,
        hideOnContentClick: true,
        titlePosition: "over"
      });
      header_height = 174;
      menu_height = $(".article-navigation").outerHeight(true);
      menu_margin_top = 50;
      article_margin_bottom = 140;
      end_offset = header_height + menu_height + menu_margin_top + article_margin_bottom;
      return this.lsw = new LegendSegmentsWaypoints({
        segments: this.$(".content-section"),
        menu_container: $driver,
        menu_items: this.$(".article-navigation .segment-anchor"),
        start_el: $("#page-content"),
        end_el: $(".site-footer"),
        waypoint_options: {
          menu_end: {
            offset: end_offset
          },
          segments: {
            offset: 250
          },
          menu_start: {
            offset: 160
          }
        },
        jumpto_options: {
          offset: -140
        }
      });
    };
    Single.prototype.getRelatedPosts = function() {
      var other_posts, related_posts, self_tags, self_tests;
      related_posts = [];
      self_tags = this.model.get("tags")[0];
      if (self_tags !== '') {
        if (typeof self_tags === "string") {
          self_tags = self_tags.split(",");
        }
        self_tests = _(self_tags).map(__bind(function(item) {
          return new RegExp(item.trim());
        }, this));
        other_posts = app.collections.posts.filter(__bind(function(model, i) {
          return model.get("_id") !== this.model.get("_id");
        }, this));
        _(other_posts).each(__bind(function(model) {
          var is_related;
          if (model.attributes.tags) {
            is_related = false;
            _(self_tests).each(__bind(function(a_test) {
              if (a_test.test(model.attributes.tags)) {
                return is_related = true;
              }
            }, this));
            if (is_related) {
              return related_posts.push(model.attributes);
            }
          }
        }, this));
      }
      return related_posts;
    };
    return Single;
  })();
  module.exports = Single;
}).call(this);
}, "views/story": function(exports, require, module) {(function() {
  var Story;
  var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) {
    for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
    function ctor() { this.constructor = child; }
    ctor.prototype = parent.prototype;
    child.prototype = new ctor;
    child.__super__ = parent.prototype;
    return child;
  };
  Story = (function() {
    __extends(Story, Backbone.View);
    function Story() {
      this.filter = __bind(this.filter, this);
      this.unfilter = __bind(this.unfilter, this);
      this.renderIsotope = __bind(this.renderIsotope, this);
      Story.__super__.constructor.apply(this, arguments);
    }
    Story.prototype.template = "<div class=\"menus-container\"></div>";
    Story.prototype.initialize = function(options) {
      var branch_names, _ref, _ref2;
      this.$el = $(this.el);
      this.$el.addClass('story');
      this.box_list = new (require("views/box_list"))({
        collection: this.collection
      });
      branch_names = _.uniq(app.collections.in_storyboard_posts.pluck("branch"));
      this.menu = options.menu;
      this.filter_menu = {};
      if (this.menu !== false) {
        this.filter_menu = (_ref = options.menu) != null ? _ref : new (require("views/menus/radio_filter_menu"))({
          model: new (require("models/menu_items"))({
            menu_items: branch_names,
            name: "box-list-filter"
          }),
          tooltip_options: driver_qtip_options({
            textFunction: function() {
              var is_on, prefix, title;
              is_on = $(this).hasClass('on');
              prefix = is_on ? "Remove" : "Include";
              title = $(this).attr("data-target");
              return "" + prefix + " " + title;
            }
          })
        });
        this.filter_menu.bind("filter", this.filter);
        this.filter_menu.bind("unfilter", this.unfilter);
      }
      this.menus_container_selector = (_ref2 = options.menus_container_selector) != null ? _ref2 : ".story .menus-container";
      this.$box_list_container = this.$el;
      this.img_count = 0;
      this.img_loaded = 0;
      return this;
    };
    Story.prototype.render = function() {
      this.$el.html(this.template);
      if (this.menu === void 0) {
        this.renderMenus();
      }
      this.renderBoxList();
      return this;
    };
    Story.prototype.renderMenus = function() {
      this.$menus_container = $(this.menus_container_selector);
      this.$menus_container.append(this.filter_menu.render().el);
      this.$filter_menu = this.$menus_container(".box-list-filter-menu");
      return this;
    };
    Story.prototype.renderBoxList = function() {
      var $img;
      this.$box_list_container.append(this.box_list.render().el);
      this.$box_list = this.$box_list_container.find(".box-list");
      $img = this.$box_list.find("img.post-primary-photo");
      this.img_count = $img.length;
      this.renderIsotope();
      $img.load(__bind(function() {
        this.img_loaded += 1;
        if (this.img_loaded === this.img_count) {
          this.onAllImagesLoaded();
        }
        return this.$box_list.isotope("reLayout");
      }, this));
      return this;
    };
    Story.prototype.onAllImagesLoaded = function() {};
    Story.prototype.renderIsotope = function() {
      return this.$box_list.isotope(this.isotope_options);
    };
    Story.prototype.unfilter = function() {
      return this.$box_list.isotope({
        filter: '*'
      });
    };
    Story.prototype.filter = function(e) {
      if (e.target === "*") {
        return this.unfilter();
      } else {
        return this.$box_list.isotope({
          filter: " [data-branch=\"" + e.target + "\"] "
        });
      }
    };
    return Story;
  })();
  module.exports = Story;
}).call(this);
}, "views/storyboard": function(exports, require, module) {(function() {
  var Storyboard;
  var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) {
    for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
    function ctor() { this.constructor = child; }
    ctor.prototype = parent.prototype;
    child.prototype = new ctor;
    child.__super__ = parent.prototype;
    return child;
  };
  Storyboard = (function() {
    __extends(Storyboard, require("views/story"));
    function Storyboard() {
      this.filter = __bind(this.filter, this);
      Storyboard.__super__.constructor.apply(this, arguments);
    }
    Storyboard.prototype.className = 'storyboard';
    Storyboard.prototype.initialize = function() {
      Storyboard.__super__.initialize.apply(this, arguments);
      this.possible_classes = "inter-col only-col last-col first-col inter-row first-row last-row only-row under-top over-bottom";
      return this.isotope_options = {
        layoutMode: "fitRows",
        itemPositionDataEnabled: true
      };
    };
    Storyboard.prototype.renderMenus = function() {
      this.$menus_container = $(".driver .menus-container");
      this.$menus_container.append(this.filter_menu.render().el);
      this.$filter_menu = $(".box-list-filter-menu");
      return this;
    };
    Storyboard.prototype.onAllImagesLoaded = function() {
      return this.applyPositionalCSS();
    };
    Storyboard.prototype.filter = function(filter) {
      var $isotope_items;
      $isotope_items = this.$box_list.find(".isotope-item").removeClass(this.possible_classes).css("zIndex", '');
      this.$box_list.isotope("reLayout");
      Storyboard.__super__.filter.call(this, filter);
      return this.applyPositionalCSS();
    };
    Storyboard.prototype.applyPositionalCSS = function() {
      var $isotope_items, $visible_isotope_items, row_count, row_numbers, rows, z_counter;
      $isotope_items = this.$box_list.find(".isotope-item").removeClass(this.possible_classes).css("zIndex", '');
      $isotope_items = this.$box_list.find(".isotope-item").removeClass(this.possible_classes);
      $visible_isotope_items = $isotope_items.filter(":not(.isotope-hidden)");
      row_numbers = [];
      $visible_isotope_items.each(__bind(function(i, iso_el) {
        var pos;
        pos = $(iso_el).data('isotope-item-position');
        $(iso_el).attr("data-x", pos.x).attr("data-y", pos.y);
        return row_numbers.push(pos.y);
      }, this));
      row_numbers = _.uniq(row_numbers);
      rows = _.groupBy($visible_isotope_items, function(iso_el) {
        var pos, this_row;
        pos = $(iso_el).data('isotope-item-position');
        this_row = _.select(row_numbers, function(row) {
          return row === pos.y;
        });
        return this_row[0];
      });
      rows = _.map(rows, function(row_items, row_name) {
        return _.sortBy(row_items, function(iso_el) {
          var pos;
          pos = $(iso_el).data('isotope-item-position');
          return pos.x;
        });
      });
      _.each(rows, function(row, i) {
        var $last_row_el, row_extent;
        $last_row_el = $(row).filter(":last");
        row_extent = parseFloat($last_row_el.attr("data-x")) + parseFloat($last_row_el.outerWidth());
        return $(row).attr("data-row-extent", row_extent);
      });
      z_counter = 1000;
      row_count = rows.length;
      _.each(rows, function(row, i) {
        var $prev_row, $this_row, col_count, prev_row_extent, this_row_extent;
        col_count = row.length;
        if (i !== 0) {
          $prev_row = $(rows[i - 1]);
          $this_row = $(row);
          prev_row_extent = parseFloat($prev_row.filter(":last").attr("data-row-extent"));
          this_row_extent = parseFloat($this_row.filter(":last").attr("data-row-extent"));
          if (this_row_extent > prev_row_extent) {
            $prev_row.css({
              "zIndex": (z_counter -= 10)
            });
            $this_row.css({
              "zIndex": (z_counter -= 10)
            });
            $prev_row.addClass("over-bottom");
            $this_row.addClass("under-top");
          } else if ($prev_row.hasClass("under-top")) {
            $this_row.css({
              "zIndex": (z_counter = 1000)
            });
          }
        }
        return _.each(row, function(iso_el, j) {
          var col_label, row_label;
          row_label = (function() {
            switch (i) {
              case 0:
                return "first-row";
              case row_count - 1:
                return "last-row";
              default:
                return "inter-row";
            }
          })();
          if (i === 0 && row_count === 1) {
            col_label = "only-row";
          }
          col_label = (function() {
            switch (j) {
              case 0:
                return "first-col";
              case col_count - 1:
                return "last-col";
              default:
                return "inter-col";
            }
          })();
          if (j === 0 && col_count === 1) {
            col_label = "only-col";
          }
          return $(iso_el).addClass("isotope-row-" + (i + 1) + " isotope-col-" + (j + 1) + " " + col_label + " " + row_label);
        });
      });
      return this.$box_list.isotope("reLayout");
    };
    return Storyboard;
  })();
  module.exports = Storyboard;
}).call(this);
}, "views/storyline": function(exports, require, module) {(function() {
  var Storyline;
  var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) {
    for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
    function ctor() { this.constructor = child; }
    ctor.prototype = parent.prototype;
    child.prototype = new ctor;
    child.__super__ = parent.prototype;
    return child;
  };
  Storyline = (function() {
    __extends(Storyline, require('views/story'));
    function Storyline() {
      this.onPaginate = __bind(this.onPaginate, this);
      this.filter = __bind(this.filter, this);
      Storyline.__super__.constructor.apply(this, arguments);
    }
    Storyline.prototype.className = "storyline";
    Storyline.prototype.template = "<div class=\"menus-container\"><div class=\"row\"></div></div><div class=\"scroller\"></div>";
    Storyline.prototype.initialize = function(options) {
      Storyline.__super__.initialize.apply(this, arguments);
      this.isotope_options = {
        layoutMode: "straightAcross"
      };
      this.pagination_menu_view = new (require("views/menus/pagination_menu"))({
        model: new (require("models/menu_items"))({
          menu_items: ["previous", "next"],
          name: "pagination"
        })
      });
      return this.pagination_menu_view.bind("page", this.onPaginate);
    };
    Storyline.prototype.renderMenus = function() {
      this.$menus_container = this.$(".menus-container");
      this.$menus_container.find(".row").append(this.filter_menu.render().el);
      this.$filter_menu = this.$(".box-list-filter-menu");
      this.$menus_container.find(".row").append(this.pagination_menu_view.render().el);
      return this.$pagination_menu = this.$(".pagination-menu");
    };
    Storyline.prototype.renderBoxList = function() {
      this.$scroller = this.$(".scroller").attr("data-location", "start");
      this.$box_list_container = this.$scroller;
      return this.$scroller.serialScroll({
        step: 1,
        stop: true,
        items: ".box:not(.isotope-hidden)",
        duration: 125,
        cycle: false,
        lazy: true,
        onAfter: __bind(function() {
          var at_end, at_start, location, scroll_left, scroll_limit, scroll_location;
          scroll_left = this.$scroller.scrollLeft();
          scroll_location = scroll_left + this.$scroller.outerWidth();
          scroll_limit = this.$scroller[0].scrollWidth;
          at_end = scroll_location === scroll_limit ? true : false;
          at_start = scroll_left === 0;
          location = "inbetween";
          if (at_end) {
            location = "end";
          } else if (at_start) {
            location = "start";
          }
          this.$scroller.attr("data-location", location);
          switch (location) {
            case "end":
              this.pagination_menu_view.disableMenuItems("next");
              return this.pagination_menu_view.enableMenuItems("previous");
            case "start":
              this.pagination_menu_view.disableMenuItems("previous");
              return this.pagination_menu_view.enableMenuItems("next");
            default:
              this.pagination_menu_view.enableMenuItems("next");
              return this.pagination_menu_view.enableMenuItems("previous");
          }
        }, this)
      }, Storyline.__super__.renderBoxList.call(this));
    };
    Storyline.prototype.filter = function(filter) {
      var scroll_amount;
      Storyline.__super__.filter.call(this, filter);
      scroll_amount = this.$scroller[0].scrollWidth - this.$scroller.outerWidth();
      if (scroll_amount === 0) {
        return this.pagination_menu_view.disableMenu();
      } else {
        return this.pagination_menu_view.enableMenu();
      }
    };
    Storyline.prototype.onPaginate = function(direction) {
      var location;
      location = this.$scroller.attr("data-location");
      switch (direction) {
        case "previous":
          if (location !== "start") {
            return this.$scroller.trigger("prev");
          }
          break;
        case "next":
          if (location !== "end") {
            return this.$scroller.trigger(direction);
          }
          break;
        default:
          throw "direction is not next or previous?";
      }
    };
    return Storyline;
  })();
  module.exports = Storyline;
}).call(this);
}, "views/table_active": function(exports, require, module) {(function() {
  var ActiveTable;
  var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) {
    for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
    function ctor() { this.constructor = child; }
    ctor.prototype = parent.prototype;
    child.prototype = new ctor;
    child.__super__ = parent.prototype;
    return child;
  };
  ActiveTable = (function() {
    __extends(ActiveTable, require("views/table_base"));
    function ActiveTable() {
      this.onRowHangerDblClick = __bind(this.onRowHangerDblClick, this);
      ActiveTable.__super__.constructor.apply(this, arguments);
    }
    ActiveTable.prototype.template = require("templates/table_active");
    ActiveTable.prototype.initialize = function(options) {
      var _ref, _ref2;
      ActiveTable.__super__.initialize.call(this, options);
      this.$el.addClass("active-table light-theme-table");
      if (options.branch_name) {
        this.$el.addClass("" + options.branch_name + "-table");
      }
      this.content.use_table_sorter = (_ref = options.use_table_sorter) != null ? _ref : true;
      this.content.use_row_hanger = (_ref2 = options.use_row_hanger) != null ? _ref2 : true;
      this.tablesorter_options = {
        cssHeader: "sortable-column",
        cssDesc: "order-descending",
        cssAsc: "order-ascending"
      };
      if (options.tablesorter_options) {
        Object.merge(this.tablsorter_options, options.tablesorter_options);
      }
      return this;
    };
    ActiveTable.prototype.applyClientInteractions = function() {
      if (this.content.use_row_hanger) {
        this.$(".row-hanger").dblclick(this.onRowHangerDblClick);
      }
      if (this.content.use_table_sorter) {
        this.$("table").tablesorter2(this.tablesorter_options);
      }
      return this;
    };
    ActiveTable.prototype.onRowHangerDblClick = function(e) {};
    return ActiveTable;
  })();
  module.exports = ActiveTable;
}).call(this);
}, "views/table_base": function(exports, require, module) {(function() {
  var TableBase;
  var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) {
    for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
    function ctor() { this.constructor = child; }
    ctor.prototype = parent.prototype;
    child.prototype = new ctor;
    child.__super__ = parent.prototype;
    return child;
  };
  TableBase = (function() {
    __extends(TableBase, Backbone.View);
    function TableBase() {
      this.render = __bind(this.render, this);
      TableBase.__super__.constructor.apply(this, arguments);
    }
    TableBase.prototype.template = require("templates/base_table");
    TableBase.prototype.initialize = function(options) {
      var _ref, _ref2;
      this.$el = $(this.el);
      this.rows = (_ref = (_ref2 = this.collection) != null ? _ref2 : options != null ? options.rows : void 0) != null ? _ref : {};
      this.$el.addClass(options.classes || '');
      return this.content = (options != null ? options.content : void 0) || {};
    };
    TableBase.prototype.render = function() {
      this.updateRowData();
      this.$el.html(this.template(this.content));
      this.$table = this.$el.find("table");
      this.applyClientInteractions();
      return this;
    };
    TableBase.prototype.applyClientInteractions = function() {};
    TableBase.prototype.updateRowData = function() {
      if (this.rows.toJSON) {
        return this.content.rows = this.rows.toJSON();
      } else {
        return this.content.rows = this.rows.map(__bind(function(model) {
          return model.toJSON();
        }, this));
      }
    };
    return TableBase;
  })();
  module.exports = TableBase;
}).call(this);
}, "views/table_branch": function(exports, require, module) {(function() {
  var TableBranch;
  var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) {
    for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
    function ctor() { this.constructor = child; }
    ctor.prototype = parent.prototype;
    child.prototype = new ctor;
    child.__super__ = parent.prototype;
    return child;
  };
  TableBranch = (function() {
    __extends(TableBranch, Backbone.View);
    function TableBranch() {
      this.add = __bind(this.add, this);
      this.render = __bind(this.render, this);
      TableBranch.__super__.constructor.apply(this, arguments);
    }
    TableBranch.prototype.template = require("templates/table_branch");
    TableBranch.prototype.tagName = "section";
    TableBranch.prototype.className = "branch-table";
    TableBranch.prototype.initialize = function() {
      this.$el = $(this.el);
      this.$injection_el = this.$el;
      return this.branch = this.collection[0].get('branch');
    };
    TableBranch.prototype.render = function() {
      var $table, branch_model, i, label, meta_labels, n, v;
      this.$el.addClass("" + this.branch + "-table");
      this.$el.attr("data-branch", this.branch);
      meta_labels = [];
      branch_model = content.blueprints[this.branch];
      for (n in branch_model) {
        v = branch_model[n];
        if (v.tabular) {
          meta_labels.push(n);
        }
      }
      meta_labels = _.sortBy(meta_labels, function(label) {
        return content.sets["" + this.branch + "_tabular_order"].indexOf(label);
      });
      for (i in meta_labels) {
        v = meta_labels[i];
        label = content.tools.unslugify(v);
        label = (function() {
          switch (label) {
            case "date completed":
              return "date";
            case "date occurred":
              return "date";
            case "number of units":
              return "unit #";
            case "square feet":
              return "feet(2)";
            case "floors":
              return "flrs";
            default:
              return label;
          }
        })();
        meta_labels[i] = label;
        this.collection[0].set({
          meta_labels: meta_labels
        });
        this.$el.html(this.template(this.collection[0].toJSON()));
      }
      this.$injection_el = this.$("tbody");
      _.each(this.collection, this.add);
      $table = this.$("table");
      $table.tablesorter2({
        cssHeader: "sortable-column",
        cssDesc: "order-descending",
        cssAsc: "order-ascending",
        sortForce: [[1, 0]],
        sortList: [[1, 0], [0, 0]]
      });
      $table.columnHover();
      return this;
    };
    TableBranch.prototype.add = function(model) {
      return this;
    };
    return TableBranch;
  })();
  module.exports = TableBranch;
}).call(this);
}, "views/table_building_row": function(exports, require, module) {(function() {
  var TableBuildingRow;
  var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) {
    for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
    function ctor() { this.constructor = child; }
    ctor.prototype = parent.prototype;
    child.prototype = new ctor;
    child.__super__ = parent.prototype;
    return child;
  };
  TableBuildingRow = (function() {
    __extends(TableBuildingRow, Backbone.View);
    function TableBuildingRow() {
      this.render = __bind(this.render, this);
      TableBuildingRow.__super__.constructor.apply(this, arguments);
    }
    TableBuildingRow.prototype.tagName = "tr";
    TableBuildingRow.prototype.template = require("templates/table_row");
    TableBuildingRow.prototype.initialize = function() {
      var flickr_set, photo, _i, _len, _ref, _results;
      this.$el = $(this.el);
      this.$el.attr("data-id", this.model.get("_id"));
      flickr_set = this.model.get("flickr_set");
      this.$el.attr("data-title", this.model.get("title"));
      this.$el.attr("data-summary", this.model.get("post_summary").localized);
      if (flickr_set) {
        _ref = flickr_set.photo;
        _results = [];
        for (_i = 0, _len = _ref.length; _i < _len; _i++) {
          photo = _ref[_i];
          _results.push(photo.id === flickr_set.primary ? (this.$el.attr("data-primary-photo", photo.url_m), this.$el.addClass("has-image")) : void 0);
        }
        return _results;
      } else {
        return this.$el.addClass("no-image");
      }
    };
    TableBuildingRow.prototype.render = function() {
      var branch, meta_field_names, n, v, _ref;
      branch = this.model.get("branch");
      meta_field_names = [];
      _ref = content.blueprints[branch];
      for (n in _ref) {
        v = _ref[n];
        if (v.tabular) {
          meta_field_names.push(n);
        }
      }
      meta_field_names = _.sortBy(meta_field_names, function(label) {
        return content.sets["" + branch + "_tabular_order"].indexOf(label);
      });
      this.model.set({
        meta_field_names: meta_field_names
      });
      this.$el.html(this.template(this.model.toJSON()));
      return this;
    };
    return TableBuildingRow;
  })();
  module.exports = TableBuildingRow;
}).call(this);
}, "views/table_client": function(exports, require, module) {(function() {
  var ClientTable;
  var __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) {
    for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
    function ctor() { this.constructor = child; }
    ctor.prototype = parent.prototype;
    child.prototype = new ctor;
    child.__super__ = parent.prototype;
    return child;
  };
  ClientTable = (function() {
    __extends(ClientTable, require("views/table_active"));
    function ClientTable() {
      ClientTable.__super__.constructor.apply(this, arguments);
    }
    ClientTable.prototype.initialize = function(options) {
      return ClientTable.__super__.initialize.call(this, options);
    };
    ClientTable.prototype.applyClientInteractions = function() {
      ClientTable.__super__.applyClientInteractions.call(this);
      return this;
    };
    return ClientTable;
  })();
  module.exports = ClientTable;
}).call(this);
}, "views/table_mode": function(exports, require, module) {(function() {
  var TableMode;
  var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) {
    for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
    function ctor() { this.constructor = child; }
    ctor.prototype = parent.prototype;
    child.prototype = new ctor;
    child.__super__ = parent.prototype;
    return child;
  };
  TableMode = (function() {
    __extends(TableMode, require("views/posts_list"));
    function TableMode() {
      this.jumpToTable = __bind(this.jumpToTable, this);
      this.scrollToTable = __bind(this.scrollToTable, this);
      this.onScrollToTable = __bind(this.onScrollToTable, this);
      this.createBranchTable = __bind(this.createBranchTable, this);
      TableMode.__super__.constructor.apply(this, arguments);
    }
    TableMode.prototype.initialize = function(options) {
      TableMode.__super__.initialize.call(this, options);
      this.el.id = "table-mode";
      return this;
    };
    TableMode.prototype.createBranchTable = function(branch_name) {
      if (branch_name !== "management") {
        this.tables[branch_name] = new this.TableConstructor({
          collection: this.collection,
          branch_name: branch_name
        });
      } else {
        this.tables[branch_name] = new (require("views/table_active"))({
          rows: this.collection.filter(function(model) {
            return model.get("branch") === "management" && model.get("in_table") === true;
          }),
          className: "light-theme-table",
          branch_name: branch_name,
          use_row_hanger: false,
          content: {
            row_url_base: "#/post/",
            row_attributes: function(row) {
              return "data-id=\"" + row._id + "\" data-title-fr=\"" + row.title[1].raw + "\" data-title-en=\"" + row.title[0].raw + "\" data-primary-photo=\"" + row.primary_photo.url_l + "\"";
            },
            table_label: "Management",
            column_names: content.sets["management_tabular_order"]
          }
        });
      }
      return this;
    };
    TableMode.prototype.applyClientInteractions = function() {
      return this.$(".table-sections tr").click(function(e) {
        var id;
        id = $(e.currentTarget).data("id");
        window.location.hash = "/post/" + id;
        return e.preventDefault();
      });
    };
    TableMode.prototype.onScrollToTable = function(e) {
      var jumpto_target_name;
      jumpto_target_name = $(e.currentTarget).data("target");
      return this.scrollToTable(jumpto_target_name);
    };
    TableMode.prototype.scrollToTable = function(jumpto_target_name) {
      var $jumpto_target, offset;
      $jumpto_target = $("." + jumpto_target_name + "-table");
      offset = jumpto_target_name === "architecture" ? -250 : -50;
      return $.scrollTo($jumpto_target, {
        duration: 500,
        offset: offset
      });
    };
    TableMode.prototype.jumpToTable = function(jumpto_target_name) {
      var $jumpto_target, to;
      $jumpto_target = $("." + jumpto_target_name + "-table");
      to = $jumpto_target.position().top;
      return $(window).scrollTop(to);
    };
    return TableMode;
  })();
  module.exports = TableMode;
}).call(this);
}, "views/table_sectioned": function(exports, require, module) {(function() {
  var TableSectioned;
  var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) {
    for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
    function ctor() { this.constructor = child; }
    ctor.prototype = parent.prototype;
    child.prototype = new ctor;
    child.__super__ = parent.prototype;
    return child;
  };
  TableSectioned = (function() {
    __extends(TableSectioned, Backbone.View);
    function TableSectioned() {
      this.render = __bind(this.render, this);
      TableSectioned.__super__.constructor.apply(this, arguments);
    }
    TableSectioned.prototype.template = require("templates/sectioned_table");
    TableSectioned.prototype.className = "sectioned-table";
    TableSectioned.prototype.initialize = function(options) {
      var branch_group, row_groups, rows, usage_label;
      this.$el = $(this.el);
      this.branch_name = options.branch_name;
      this.$el.addClass("" + this.branch_name + " " + this.branch_name + "-table");
      branch_group = this.collection.filter(__bind(function(model) {
        return model.get("branch") === this.branch_name && model.get("in_table") === true;
      }, this));
      row_groups = branch_group.groupBy(__bind(function(model) {
        return model.get(content.sets.tables_split_on[this.branch_name]);
      }, this));
      this.tables = (function() {
        var _results;
        _results = [];
        for (usage_label in row_groups) {
          rows = row_groups[usage_label];
          _results.push(new (require("views/table_active"))({
            rows: rows,
            use_row_hanger: false,
            classes: "table-section",
            content: {
              row_url_base: "#/post/",
              row_attributes: function(row) {
                return "data-id=\"" + row._id + "\" data-title-fr=\"" + row.title[1].raw + "\" data-title-en=\"" + row.title[0].raw + "\" data-primary-photo=\"" + row.primary_photo.url_l + "\"";
              },
              hanger_contents: function(row) {
                return " <a class=\"permalink\" href=\"#/post/" + row._id + "\">\n<img src=\"images/icons/dark/24/preview.png\">\n</a> ";
              },
              table_label: usage_label,
              column_names: content.sets["" + this.branch_name + "_tabular_order"]
            }
          }));
        }
        return _results;
      }).call(this);
      return this.content = {
        column_names: content.sets["" + this.branch_name + "_tabular_order"],
        table_label: this.branch_name
      };
    };
    TableSectioned.prototype.render = function() {
      this.$el.html(this.template(this.content));
      this.$tables_container = this.$el.find(".table-sections");
      this.tables.each(__bind(function(table) {
        return this.$tables_container.append(table.render().el);
      }, this));
      this.$tables = this.$tables_container.find("table");
      this.applyClientInteractions();
      return this;
    };
    TableSectioned.prototype.applyClientInteractions = function() {
      this.$(".common-table-header th").click(__bind(function(e) {
        var $target, col, dir, sorton;
        $target = $(e.currentTarget);
        $target.siblings().removeClass("order-descending order-ascending sorted-on");
        this.$tables.find("td.sorted-on").removeClass("sorted-on");
        if ($target.hasClass("sorted-on")) {
          $target.toggleClass("order-descending order-ascending");
        } else {
          $target.addClass("order-descending sorted-on");
        }
        col = $target.index();
        dir = $target.hasClass("order-descending") ? 1 : 0;
        sorton = [[col, dir]];
        this.$tables.trigger("sorton", [sorton]);
        return this.$tables.find("td:nth-child(" + (col + 1) + ")").addClass("sorted-on");
      }, this));
      this.$(".common-table-header th:nth-child(2)").trigger("click");
      return this;
    };
    return TableSectioned;
  })();
  module.exports = TableSectioned;
}).call(this);
}, "views/updating_collection_view": function(exports, require, module) {(function() {
  var UpdatingCollectionView;
  var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) {
    for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
    function ctor() { this.constructor = child; }
    ctor.prototype = parent.prototype;
    child.prototype = new ctor;
    child.__super__ = parent.prototype;
    return child;
  };
  UpdatingCollectionView = (function() {
    __extends(UpdatingCollectionView, Backbone.View);
    function UpdatingCollectionView() {
      this.remove = __bind(this.remove, this);
      this.add = __bind(this.add, this);
      this.refresh = __bind(this.refresh, this);
      this.render = __bind(this.render, this);
      UpdatingCollectionView.__super__.constructor.apply(this, arguments);
    }
    UpdatingCollectionView.prototype.initialize = function(options) {
      if (!options.child_view_constructor) {
        throw "no Child view constructor passed";
      }
      this.is_rendered = false;
      this.$el = $(this.el);
      this._child_view_constructor = options.child_view_constructor;
      this._child_views = [];
      this.$injection_el = this.$el;
      this.collection.bind("refresh", this.refresh);
      this.collection.bind("add", this.add);
      this.collection.bind("remove", this.remove);
      this.collection.each(this.add);
      return this;
    };
    UpdatingCollectionView.prototype.render = function() {
      var child_view, _i, _len, _ref;
      this.is_rendered = true;
      this.renderTemplate();
      _ref = this._child_views;
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
        child_view = _ref[_i];
        this.$injection_el.append(child_view.render().el);
      }
      return this;
    };
    UpdatingCollectionView.prototype.renderTemplate = function() {
      if (this.template && this.model) {
        this.$el.html(this.template(this.model.toJSON()));
      } else {
        this.$el.empty();
      }
      if (this.injetion_selector) {
        this.$injection_el = this.$(this.injection_selector);
      }
      return this;
    };
    UpdatingCollectionView.prototype.refresh = function() {
      this.collection.each(this.add);
      return this;
    };
    UpdatingCollectionView.prototype.add = function(model) {
      var child_view;
      child_view = new this._child_view_constructor({
        model: model
      });
      this._child_views.push(child_view);
      if (this.is_rendered) {
        this.$injection_el.append(child_view.render().el);
      }
      return this;
    };
    UpdatingCollectionView.prototype.remove = function(model_to_remove) {
      var view_to_remove;
      view_to_remove = _(this._child_views).select(function(child_view) {
        return child_view.model === model_to_remove;
      });
      this._child_views = _(this._child_views).without(_(view_to_remove).first());
      if (this.is_rendered) {
        $(view_to_remove.el).remove();
      }
      return this;
    };
    return UpdatingCollectionView;
  })();
  module.exports = UpdatingCollectionView;
}).call(this);
}, "waypoints": function(exports, require, module) {(function() {
  var ob;
  ob = {
    begin: function() {
      var $driver, driverEndPoint, driverStartPoint, end_class, end_offset, state_class;
      $.waypoints.settings.scrollThrottle = 30;
      $driver = $(".driver");
      state_class = "sticky";
      end_class = "sticky-end";
      end_offset = $(".driver").outerHeight();
      driverStartPoint = function(e, d) {
        if (e.target === e.currentTarget) {
          if (d === "down") {
            return $driver.addClass(state_class);
          } else if (d === "up") {
            return $driver.removeClass(state_class);
          }
        }
      };
      driverEndPoint = function(e, d) {
        if (e.target === e.currentTarget) {
          if (d === "down") {
            $driver.addClass(end_class);
            return $driver.removeClass(state_class);
          } else if (d === "up") {
            $driver.removeClass(end_class);
            return $driver.addClass(state_class);
          }
        }
      };
      $("#page-content").waypoint(driverStartPoint);
      return $(".site-footer").waypoint(driverEndPoint, {
        offset: end_offset
      });
    },
    end: function() {
      $("#page-content").waypoint("destroy");
      return $(".site-footer").waypoint("destroy");
    }
  };
  module.exports = ob;
}).call(this);
}, "waypoints2": function(exports, require, module) {(function() {

}).call(this);
}});


var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-26530555-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);
})();



