// Let's kick off by broadcasting that we've got JS enabled
(function() {var h = document.getElementsByTagName('html')[0]; if(h)h.className=h.className.replace(/\bun(?=scripted\b)/,'');})();

/*@cc_on
var ie_rv = (function(){
	var undef, v = 3, div = document.createElement('div'), all = div.getElementsByTagName('i');
	while (div.innerHTML = '<!--[if gt IE ' + (++v) + ']><i></i><![endif]-->', all[0]);
	return v > 4 ? v : undef;
}());
@*/

/*!
  * Ender: open module JavaScript framework
  * copyright Dustin Diaz & Jacob Thornton 2011 (@ded @fat)
  * https://ender.no.de
  * License MIT
  * Build: ender build jeesh
  */
!function(a){function d(a,b){return c(a,b)}function c(a,e){var f;d._select&&typeof a=="string"||a.nodeName||a.length&&"item"in a||a==window?(f=d._select(a,e),f.selector=a):f=isFinite(a.length)?a:[a];return b(f,c)}function b(a,b){for(var c in b)c!="noConflict"&&c!="_VERSION"&&(a[c]=b[c]);return a}b(d,{_VERSION:"0.2.0",ender:function(a,e){b(e?c:d,a)}}),b(c,{forEach:function(a,b){for(var c=0,d=this.length;c<d;++c)c in this&&a.call(b||this[c],this[c],c,this);return this}});var e=a.$;d.noConflict=function(){a.$=e;return this},typeof module!="undefined"&&module.exports&&(module.exports=d),a.ender=a.$=d}(this),!function(){var a={exports:{}};!function(b){function k(){c=1;for(var a=0,b=d.length;a<b;a++)d[a]()}var c=0,d=[],e,f=!1,g=b.createElement("a"),h="DOMContentLoaded",i="addEventListener",j="onreadystatechange";/^loade|c/.test(b.readyState)&&(c=1),b[i]&&b[i](h,function l(){b.removeEventListener(h,l,f),k()},f),g.doScroll&&b.attachEvent(j,e=function e(){/^c/.test(b.readyState)&&(b.detachEvent(j,e),k())});var m=g.doScroll?function(a){self!=top?c?a():d.push(a):!function(){try{g.doScroll("left")}catch(b){return setTimeout(function(){m(a)},50)}a()}()}:function(a){c?a():d.push(a)};typeof a!="undefined"&&a.exports?a.exports={domReady:m}:window.domReady=m}(document),$.ender(a.exports)}(),!function(){var a={exports:{}};(function(){var b=this,c=b._,d={},e=Array.prototype,f=Object.prototype,g=Function.prototype,h=e.slice,i=e.unshift,j=f.toString,k=f.hasOwnProperty,l=e.forEach,m=e.map,n=e.reduce,o=e.reduceRight,p=e.filter,q=e.every,r=e.some,s=e.indexOf,t=e.lastIndexOf,u=Array.isArray,v=Object.keys,w=g.bind,x=function(a){return new C(a)};typeof a!="undefined"&&a.exports?(a.exports=x,x._=x):b._=x,x.VERSION="1.1.6";var y=x.each=x.forEach=function(a,b,c){if(a!=null)if(l&&a.forEach===l)a.forEach(b,c);else if(x.isNumber(a.length)){for(var e=0,f=a.length;e<f;e++)if(b.call(c,a[e],e,a)===d)return}else for(var g in a)if(k.call(a,g)&&b.call(c,a[g],g,a)===d)return};x.map=function(a,b,c){var d=[];if(a==null)return d;if(m&&a.map===m)return a.map(b,c);y(a,function(a,e,f){d[d.length]=b.call(c,a,e,f)});return d},x.reduce=x.foldl=x.inject=function(a,b,c,d){var e=c!==void 0;a==null&&(a=[]);if(n&&a.reduce===n){d&&(b=x.bind(b,d));return e?a.reduce(b,c):a.reduce(b)}y(a,function(a,f,g){!e&&f===0?(c=a,e=!0):c=b.call(d,c,a,f,g)});if(!e)throw new TypeError("Reduce of empty array with no initial value");return c},x.reduceRight=x.foldr=function(a,b,c,d){a==null&&(a=[]);if(o&&a.reduceRight===o){d&&(b=x.bind(b,d));return c!==void 0?a.reduceRight(b,c):a.reduceRight(b)}var e=(x.isArray(a)?a.slice():x.toArray(a)).reverse();return x.reduce(e,b,c,d)},x.find=x.detect=function(a,b,c){var d;z(a,function(a,e,f){if(b.call(c,a,e,f)){d=a;return!0}});return d},x.filter=x.select=function(a,b,c){var d=[];if(a==null)return d;if(p&&a.filter===p)return a.filter(b,c);y(a,function(a,e,f){b.call(c,a,e,f)&&(d[d.length]=a)});return d},x.reject=function(a,b,c){var d=[];if(a==null)return d;y(a,function(a,e,f){b.call(c,a,e,f)||(d[d.length]=a)});return d},x.every=x.all=function(a,b,c){var e=!0;if(a==null)return e;if(q&&a.every===q)return a.every(b,c);y(a,function(a,f,g){if(!(e=e&&b.call(c,a,f,g)))return d});return e};var z=x.some=x.any=function(a,b,c){b||(b=x.identity);var e=!1;if(a==null)return e;if(r&&a.some===r)return a.some(b,c);y(a,function(a,f,g){if(e=b.call(c,a,f,g))return d});return e};x.include=x.contains=function(a,b){var c=!1;if(a==null)return c;if(s&&a.indexOf===s)return a.indexOf(b)!=-1;z(a,function(a){if(c=a===b)return!0});return c},x.invoke=function(a,b){var c=h.call(arguments,2);return x.map(a,function(a){return(b.call?b||a:a[b]).apply(a,c)})},x.pluck=function(a,b){return x.map(a,function(a){return a[b]})},x.max=function(a,b,c){if(!b&&x.isArray(a))return Math.max.apply(Math,a);var d={computed:-Infinity};y(a,function(a,e,f){var g=b?b.call(c,a,e,f):a;g>=d.computed&&(d={value:a,computed:g})});return d.value},x.min=function(a,b,c){if(!b&&x.isArray(a))return Math.min.apply(Math,a);var d={computed:Infinity};y(a,function(a,e,f){var g=b?b.call(c,a,e,f):a;g<d.computed&&(d={value:a,computed:g})});return d.value},x.sortBy=function(a,b,c){return x.pluck(x.map(a,function(a,d,e){return{value:a,criteria:b.call(c,a,d,e)}}).sort(function(a,b){var c=a.criteria,d=b.criteria;return c<d?-1:c>d?1:0}),"value")},x.sortedIndex=function(a,b,c){c||(c=x.identity);var d=0,e=a.length;while(d<e){var f=d+e>>1;c(a[f])<c(b)?d=f+1:e=f}return d},x.toArray=function(a){if(!a)return[];if(a.toArray)return a.toArray();if(x.isArray(a))return a;if(x.isArguments(a))return h.call(a);return x.values(a)},x.size=function(a){return x.toArray(a).length},x.first=x.head=function(a,b,c){return b!=null&&!c?h.call(a,0,b):a[0]},x.rest=x.tail=function(a,b,c){return h.call(a,b==null||c?1:b)},x.last=function(a){return a[a.length-1]},x.compact=function(a){return x.filter(a,function(a){return!!a})},x.flatten=function(a){return x.reduce(a,function(a,b){if(x.isArray(b))return a.concat(x.flatten(b));a[a.length]=b;return a},[])},x.without=function(a){var b=h.call(arguments,1);return x.filter(a,function(a){return!x.include(b,a)})},x.uniq=x.unique=function(a,b){return x.reduce(a,function(a,c,d){if(0==d||(b===!0?x.last(a)!=c:!x.include(a,c)))a[a.length]=c;return a},[])},x.intersect=function(a){var b=h.call(arguments,1);return x.filter(x.uniq(a),function(a){return x.every(b,function(b){return x.indexOf(b,a)>=0})})},x.zip=function(){var a=h.call(arguments),b=x.max(x.pluck(a,"length")),c=Array(b);for(var d=0;d<b;d++)c[d]=x.pluck(a,""+d);return c},x.indexOf=function(a,b,c){if(a==null)return-1;var d,e;if(c){d=x.sortedIndex(a,b);return a[d]===b?d:-1}if(s&&a.indexOf===s)return a.indexOf(b);for(d=0,e=a.length;d<e;d++)if(a[d]===b)return d;return-1},x.lastIndexOf=function(a,b){if(a==null)return-1;if(t&&a.lastIndexOf===t)return a.lastIndexOf(b);var c=a.length;while(c--)if(a[c]===b)return c;return-1},x.range=function(a,b,c){arguments.length<=1&&(b=a||0,a=0),c=arguments[2]||1;var d=Math.max(Math.ceil((b-a)/c),0),e=0,f=Array(d);while(e<d)f[e++]=a,a+=c;return f},x.bind=function(a,b){if(a.bind===w&&w)return w.apply(a,h.call(arguments,1));var c=h.call(arguments,2);return function(){return a.apply(b,c.concat(h.call(arguments)))}},x.bindAll=function(a){var b=h.call(arguments,1);b.length==0&&(b=x.functions(a)),y(b,function(b){a[b]=x.bind(a[b],a)});return a},x.memoize=function(a,b){var c={};b||(b=x.identity);return function(){var d=b.apply(this,arguments);return k.call(c,d)?c[d]:c[d]=a.apply(this,arguments)}},x.delay=function(a,b){var c=h.call(arguments,2);return setTimeout(function(){return a.apply(a,c)},b)},x.defer=function(a){return x.delay.apply(x,[a,1].concat(h.call(arguments,1)))};var A=function(a,b,c){var d;return function(){var e=this,f=arguments,g=function(){d=null,a.apply(e,f)};c&&clearTimeout(d);if(c||!d)d=setTimeout(g,b)}};x.throttle=function(a,b){return A(a,b,!1)},x.debounce=function(a,b){return A(a,b,!0)},x.once=function(a){var b=!1,c;return function(){if(b)return c;b=!0;return c=a.apply(this,arguments)}},x.wrap=function(a,b){return function(){var c=[a].concat(h.call(arguments));return b.apply(this,c)}},x.compose=function(){var a=h.call(arguments);return function(){var b=h.call(arguments);for(var c=a.length-1;c>=0;c--)b=[a[c].apply(this,b)];return b[0]}},x.after=function(a,b){return function(){if(--a<1)return b.apply(this,arguments)}},x.keys=v||function(a){if(a!==Object(a))throw new TypeError("Invalid object");var b=[];for(var c in a)k.call(a,c)&&(b[b.length]=c);return b},x.values=function(a){return x.map(a,x.identity)},x.functions=x.methods=function(a){return x.filter(x.keys(a),function(b){return x.isFunction(a[b])}).sort()},x.extend=function(a){y(h.call(arguments,1),function(b){for(var c in b)b[c]!==void 0&&(a[c]=b[c])});return a},x.defaults=function(a){y(h.call(arguments,1),function(b){for(var c in b)a[c]==null&&(a[c]=b[c])});return a},x.clone=function(a){return x.isArray(a)?a.slice():x.extend({},a)},x.tap=function(a,b){b(a);return a},x.isEqual=function(a,b){if(a===b)return!0;var c=typeof a,d=typeof b;if(c!=d)return!1;if(a==b)return!0;if(!a&&b||a&&!b)return!1;a._chain&&(a=a._wrapped),b._chain&&(b=b._wrapped);if(a.isEqual)return a.isEqual(b);if(x.isDate(a)&&x.isDate(b))return a.getTime()===b.getTime();if(x.isNaN(a)&&x.isNaN(b))return!1;if(x.isRegExp(a)&&x.isRegExp(b))return a.source===b.source&&a.global===b.global&&a.ignoreCase===b.ignoreCase&&a.multiline===b.multiline;if(c!=="object")return!1;if(a.length&&a.length!==b.length)return!1;var e=x.keys(a),f=x.keys(b);if(e.length!=f.length)return!1;for(var g in a)if(!(g in b)||!x.isEqual(a[g],b[g]))return!1;return!0},x.isEmpty=function(a){if(x.isArray(a)||x.isString(a))return a.length===0;for(var b in a)if(k.call(a,b))return!1;return!0},x.isElement=function(a){return!!a&&a.nodeType==1},x.isArray=u||function(a){return j.call(a)==="[object Array]"},x.isArguments=function(a){return!!a&&!!k.call(a,"callee")},x.isFunction=function(a){return!!(a&&a.constructor&&a.call&&a.apply)},x.isString=function(a){return!!(a===""||a&&a.charCodeAt&&a.substr)},x.isNumber=function(a){return!!(a===0||a&&a.toExponential&&a.toFixed)},x.isNaN=function(a){return a!==a},x.isBoolean=function(a){return a===!0||a===!1},x.isDate=function(a){return!!(a&&a.getTimezoneOffset&&a.setUTCFullYear)},x.isRegExp=function(a){return!(!(a&&a.test&&a.exec)||!a.ignoreCase&&a.ignoreCase!==!1)},x.isNull=function(a){return a===null},x.isUndefined=function(a){return a===void 0},x.noConflict=function(){b._=c;return this},x.identity=function(a){return a},x.times=function(a,b,c){for(var d=0;d<a;d++)b.call(c,d)},x.mixin=function(a){y(x.functions(a),function(b){E(b,x[b]=a[b])})};var B=0;x.uniqueId=function(a){var b=B++;return a?a+b:b},x.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g},x.template=function(a,b){var c=x.templateSettings,d="var __p=[],print=function(){__p.push.apply(__p,arguments);};with(obj||{}){__p.push('"+a.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(c.interpolate,function(a,b){return"',"+b.replace(/\\'/g,"'")+",'"}).replace(c.evaluate||null,function(a,b){return"');"+b.replace(/\\'/g,"'").replace(/[\r\n\t]/g," ")+"__p.push('"}).replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/\t/g,"\\t")+"');}return __p.join('');",e=new Function("obj",d);return b?e(b):e};var C=function(a){this._wrapped=a};x.prototype=C.prototype;var D=function(a,b){return b?x(a).chain():a},E=function(a,b){C.prototype[a]=function(){var a=h.call(arguments);i.call(a,this._wrapped);return D(b.apply(x,a),this._chain)}};x.mixin(x),y(["pop","push","reverse","shift","sort","splice","unshift"],function(a){var b=e[a];C.prototype[a]=function(){b.apply(this._wrapped,arguments);return D(this._wrapped,this._chain)}}),y(["concat","join","slice"],function(a){var b=e[a];C.prototype[a]=function(){return D(b.apply(this._wrapped,arguments),this._chain)}}),C.prototype.chain=function(){this._chain=!0;return this},C.prototype.value=function(){return this._wrapped}})(),$.ender(a.exports)}(),!function(a,b){function j(a,c){d[e]=this[e];var g=this,h=new d,j=typeof a==b,k=j?a:this,l=j?{}:a,m=function(){this.initialize?this.initialize.apply(this,arguments):(c||f(a)&&g.apply(this,arguments),k.apply(this,arguments))};m.methods=function(a){i(h,a,g),m[e]=h;return this},m.methods.call(m,l).prototype.constructor=m,m.extend=arguments.callee,m[e].implement=m.statics=function(a,b){a=typeof a=="string"?function(){var c={};c[a]=b;return c}():a,i(this,a,g);return this};return m}function i(a,d,f){for(var g in d)d.hasOwnProperty(g)&&(a[g]=typeof d[g]==b&&typeof f[e][g]==b&&c.test(d[g])?h(g,d[g],f):d[g])}function h(a,b,c){return function(){var d=this.supr;this.supr=c[e][a];var f=b.apply(this,arguments);this.supr=d;return f}}function g(a){return j.call(typeof a==b?a:d,a,1)}var c=/xyz/.test(function(){xyz})?/\bsupr\b/:/.*/,d=function(){},e="prototype",f=function(a){return typeof a===b};if(typeof module!="undefined"&&module.exports)module.exports=g;else{var k=a.klass;g.noConflict=function(){a.klass=k;return this},a.klass=g}}(this,"function"),$.ender({klass:klass.noConflict()}),!function(a,b,c){function t(a,c){var e=b.createElement("script"),f=j;e.onload=e.onerror=e[o]=function(){e[m]&&!/^c|loade/.test(e[m])||f||(e.onload=e[o]=null,f=1,c())},e.async=1,e.src=a,d.insertBefore(e,d.firstChild)}function q(a,b){p(a,function(a){return!b(a)})}var d=b.getElementsByTagName("head")[0],e={},f={},g={},h={},i="string",j=!1,k="push",l="DOMContentLoaded",m="readyState",n="addEventListener",o="onreadystatechange",p=function(a,b){for(var c=0,d=a.length;c<d;++c)if(!b(a[c]))return j;return 1};!b[m]&&b[n]&&(b[n](l,function r(){b.removeEventListener(l,r,j),b[m]="complete"},j),b[m]="loading");var s=function(a,b,d){function o(){if(!--m){e[l]=1,j&&j();for(var a in g)p(a.split("|"),n)&&!q(g[a],n)&&(g[a]=[])}}function n(a){return a.call?a():e[a]}a=a[k]?a:[a];var i=b&&b.call,j=i?b:d,l=i?a.join(""):b,m=a.length;c(function(){q(a,function(a){h[a]?(l&&(f[l]=1),o()):(h[a]=1,l&&(f[l]=1),t(s.path?s.path+a+".js":a,o))})},0);return s};s.get=t,s.ready=function(a,b,c){a=a[k]?a:[a];var d=[];!q(a,function(a){e[a]||d[k](a)})&&p(a,function(a){return e[a]})?b():!function(a){g[a]=g[a]||[],g[a][k](b),c&&c(d)}(a.join("|"));return s};var u=a.$script;s.noConflict=function(){a.$script=u;return this},typeof module!="undefined"&&module.exports?module.exports=s:a.$script=s}(this,document,setTimeout),ender.ender({script:$script,ready:$script.ready,require:$script,getScript:$script.get}),!function(a,b){function V(a,c){var d=typeof c=="string"?V(c)[0]:c||b;if(!d||!a)return[];if(h=S(a,c,V))return h;return X(a,d)}function U(a){var b=[],c,d;label:for(c=0;c<a.length;c++){for(d=0;d<b.length;d++)if(b[d]==a[c])continue label;b[b.length]=a[c]}return b}function T(a){return a&&a.nodeType&&(a.nodeType==1||a.nodeType==9)}function S(a,c,d){var e=typeof c=="string"?d(c)[0]:c||b;if(a===window||T(a))return!c||a!==window&&T(e)&&W(a,e)?[a]:[];if(a&&typeof a=="object"&&isFinite(a.length))return G(a);if(h=a.match(w))return(m=b.getElementById(h[1]))?[m]:[];if(h=a.match(y))return G(e.getElementsByTagName(h[1]));return!1}function R(a){var b=[],c=[],d,g,h=L.g(a)||L.s(a,a.split(B));h=h.slice(0);if(!h.length)return b;b=O(h);if(!h.length)return b;for(e=0,g=b.length,f=0;e<g;e++){n=b[e],j=n;for(d=h.length;d--;)z:while(j!==A&&(j=j.parentNode))if(p=N.apply(j,M(h[d])))break z;p&&(c[f++]=n)}return c}function Q(a,b,c){switch(a){case"=":return b==c;case"^=":return b.match(K.g("^="+c)||K.s("^="+c,new RegExp("^"+P(c))));case"$=":return b.match(K.g("$="+c)||K.s("$="+c,new RegExp(P(c)+"$")));case"*=":return b.match(K.g(c)||K.s(c,new RegExp(P(c))));case"~=":return b.match(K.g("~="+c)||K.s("~="+c,new RegExp("(?:^|\\s+)"+P(c)+"(?:\\s+|$)")));case"|=":return b.match(K.g("|="+c)||K.s("|="+c,new RegExp("^"+P(c)+"(-|$)")))}return!1}function P(a){return J.g(a)||J.s(a,a.replace(C,"\\$1"))}function O(a){var c=[],d=a.pop(),e=M(d),f=e[1]||"*",g,i,j,k=a.length&&(h=a[0].match(w))?b.getElementById(h[1]):b;if(!k)return c;j=k.getElementsByTagName(f);for(g=0,i=j.length;g<i;g++)m=j[g],(r=N.apply(m,e))&&c.push(r);return c}function N(a,b,c,e,f,g,h){var j,k,l;if(b&&this.tagName.toLowerCase()!==b)return!1;if(c&&(j=c.match(u))&&j[1]!==this.id)return!1;if(c&&(q=c.match(v)))for(d=q.length;d--;){k=q[d].slice(1);if(!(I.g(k)||I.s(k,new RegExp("(^|\\s+)"+k+"(\\s+|$)"))).test(this.className))return!1}if(e&&!h){i=this.attributes;for(l in i)if(Object.prototype.hasOwnProperty.call(i,l)&&(i[l].name||l)==f)return this}if(e&&!Q(g,this.getAttribute(f)||"",h))return!1;return this}function M(a){return a.match(F)}function G(a){k=[];for(d=0,o=a.length;d<o;d++)k[d]=a[d];return k}var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u=/#([\w\-]+)/,v=/\.[\w\-]+/g,w=/^#([\w\-]+$)/,x=/^\.([\w\-]+)$/,y=/^([\w\-]+)$/,z=/^([\w]+)?\.([\w\-]+)$/,A=b.documentElement,B=/\s(?![\s\w\-\/\?\&\=\:\.\(\)\!,@#%<>\{\}\$\*\^'"]*\])/,C=/([.*+?\^=!:${}()|\[\]\/\\])/g,D=/^([a-z0-9]+)?(?:([\.\#]+[\w\-\.#]+)?)/,E=/\[([\w\-]+)(?:([\|\^\$\*\~]?\=)['"]?([ \w\-\/\?\&\=\:\.\(\)\!,@#%<>\{\}\$\*\^]+)["']?)?\]/,F=new RegExp(D.source+"("+E.source+")?"),H=function(){this.c={}};H.prototype={g:function(a){return this.c[a]||undefined},s:function(a,b){this.c[a]=b;return b}};var I=new H,J=new H,K=new H,L=new H,W="compareDocumentPosition"in A?function(a,b){return(b.compareDocumentPosition(a)&16)==16}:"contains"in A?function(a,c){c=c==b||c==window?A:c;return c!==a&&c.contains(a)}:function(a,b){while(a=a.parentNode)if(a===b)return 1;return 0},X=b.querySelector&&b.querySelectorAll?function(a,c){if(b.getElementsByClassName&&(h=a.match(x)))return G(c.getElementsByClassName(h[1]));return G(c.querySelectorAll(a))}:function(a,c){var d=[],f,i=[],j;if(h=a.match(z)){s=c.getElementsByTagName(h[1]||"*"),k=I.g(h[2])||I.s(h[2],new RegExp("(^|\\s+)"+h[2]+"(\\s+|$)"));for(j=0,g=s.length,e=0;j<g;j++)k.test(s[j].className)&&(d[e++]=s[j]);return d}for(j=0,s=a.split(","),g=s.length;j<g;j++)i[j]=R(s[j]);for(j=0,g=i.length;j<g&&(f=i[j]);j++){var l=f;if(c!==b){l=[];for(e=0,h=f.length;e<h&&(element=f[e]);e++)W(element,c)&&l.push(element)}d=d.concat(l)}return U(d)};V.uniq=U;var Y=a.qwery;V.noConflict=function(){a.qwery=Y;return this},a.qwery=V}(this,document),!function(a){function c(b,c){var d=(c||a).createElement("div"),e=[];d.innerHTML=b;var f=d.childNodes;d=d.firstChild,e.push(d);while(d=d.nextSibling)d.nodeType==1&&e.push(d);return e}var b=qwery.noConflict();$._select=function(a,d){return/^\s*</.test(a)?c(a,d):b(a,d)},$.ender({find:function(a){var c=[],d,e,f,g,h;for(d=0,e=this.length;d<e;d++){h=b(a,this[d]);for(f=0,g=h.length;f<g;f++)c.push(h[f])}return $(b.uniq(c))},and:function(a){var b=$(a);for(var c=this.length,d=0,e=this.length+b.length;c<e;c++,d++)this[c]=b[d];return this}},!0)}(document),!function(a){function G(a,b){return new B(a,b)}function F(){return{x:window.pageXOffset||c.scrollLeft,y:window.pageYOffset||c.scrollTop}}function E(a){return a===window||/^(?:body|html)$/i.test(a.tagName)}function D(a,b,c){var d=this[0];if(a==null&&b==null)return(E(d)?F():{x:d.scrollLeft,y:d.scrollTop})[c];E(d)?window.scrollTo(a,b):(a!=null&&(d.scrollLeft=a),b!=null&&(d.scrollTop=b));return this}function C(a,b){return typeof a=="string"?G.create(a,b):w(a)?[a]:a}function B(a){this.length=0,this.original=a;if(a){a=typeof a!="string"&&!a.nodeType&&typeof a.length!="undefined"?a:[a],this.length=a.length;for(var b=0;b<a.length;b++)this[b]=a[b]}}function A(a,b,c){var d=G(a),e=d.css("position"),f=d.offset(),g="relative",h=e==g,i=[parseInt(d.css("left"),10),parseInt(d.css("top"),10)];e=="static"&&(d.css("position",g),e=g),isNaN(i[0])&&(i[0]=h?0:a.offsetLeft),isNaN(i[1])&&(i[1]=h?0:a.offsetTop),b!==null&&(a.style.left=b-f.left+i[0]+"px"),c!==null&&(a.style.top=c-f.top+i[1]+"px")}function z(a,b,c){var e=0,f=b||this,g=[];t(C(d?d(a):a),function(a){t(f,function(b){var d=b.cloneNode(!0);c(a,d),g[e]=d,e++})},this),t(g,function(a,b){f[b]=a}),f.length=e;return f}function x(a,b,c){for(var d=0,e=a.length;d<e;++d)if(b.call(c,a[d],d,a))return!0;return!1}function w(a){return a&&a.nodeName&&a.nodeType==1}function v(a){return a.replace(/-(.)/g,function(a,b){return b.toUpperCase()})}function t(a,b,c){for(var d=0,e=a.length;d<e;d++)b.call(c||a[d],a[d],d,a);return a}function s(a){return new RegExp("(^|\\s+)"+a+"(\\s+|$)")}var b=a.document,c=b.documentElement,d=null,e="getElementsByTagName",f=/^checked|value|selected$/,g=/select|map|fieldset|table|tbody|tr|colgroup/i,h={select:"option",table:"tbody",tr:"td"},i=/^checked|selected$/,j=/msie/i.test(navigator.userAgent),k=[],l=0,m=/^-?[\d\.]+$/,n="px",o="setAttribute",p="getAttribute",q=/(^\s*|\s*$)/g,r={lineHeight:1,zoom:1,zIndex:1,opacity:1},u=String.prototype.trim?function(a){return a.trim()}:function(a){return a.replace(q,"")},y=b.defaultView&&b.defaultView.getComputedStyle?function(a,c){var d=null;c=="float"&&(c="cssFloat");var e=b.defaultView.getComputedStyle(a,"");e&&(d=e[v(c)]);return a.style[c]||d}:j&&c.currentStyle?function(a,b){b=v(b),b=b=="float"?"styleFloat":b;if(b=="opacity"){var c=100;try{c=a.filters["DXImageTransform.Microsoft.Alpha"].opacity}catch(d){try{c=a.filters("alpha").opacity}catch(e){}}return c/100}var f=a.currentStyle?a.currentStyle[b]:null;return a.style[b]||f}:function(a,b){return a.style[v(b)]};B.prototype={each:function(a,b){return t(this,a,b)},map:function(a,b){var c=[],d,e;for(e=0;e<this.length;e++)d=a.call(this,this[e]),b?b(d)&&c.push(d):c.push(d);return c},first:function(){return G(this[0])},last:function(){return G(this[this.length-1])},html:function(a,b){function f(b,c){while(b.firstChild)b.removeChild(b.firstChild);t(C(a,c),function(a){b.appendChild(a)})}var d=b?c.textContent==null?"innerText":"textContent":"innerHTML",e;return typeof a!="undefined"?this.each(function(b){(e=b.tagName.match(g))?f(b,e[0]):b[d]=a}):this[0]?this[0][d]:""},text:function(a){return this.html(a,1)},addClass:function(a){return this.each(function(b){this.hasClass(b,a)||(b.className=u(b.className+" "+a))},this)},removeClass:function(a){return this.each(function(b){this.hasClass(b,a)&&(b.className=u(b.className.replace(s(a)," ")))},this)},hasClass:function(a,b){return typeof b=="undefined"?x(this,function(b){return s(a).test(b.className)}):s(b).test(a.className)},toggleClass:function(a,b){if(typeof b!="undefined"&&!b)return this;return this.each(function(b){this.hasClass(b,a)?b.className=u(b.className.replace(s(a)," ")):b.className=u(b.className+" "+a)},this)},show:function(a){return this.each(function(b){b.style.display=a||""})},hide:function(a){return this.each(function(a){a.style.display="none"})},append:function(a){return this.each(function(b){t(C(a),function(a){b.appendChild(a)})})},prepend:function(a){return this.each(function(b){var c=b.firstChild;t(C(a),function(a){b.insertBefore(a,c)})})},appendTo:function(a,b){return z.call(this,a,b,function(a,b){a.appendChild(b)})},prependTo:function(a,b){return z.call(this,a,b,function(a,b){a.insertBefore(b,a.firstChild)})},next:function(){return this.related("nextSibling")},previous:function(){return this.related("previousSibling")},related:function(a){return this.map(function(b){b=b[a];while(b&&b.nodeType!==1)b=b[a];return b||0},function(a){return a})},before:function(a){return this.each(function(b){t(G.create(a),function(a){b.parentNode.insertBefore(a,b)})})},after:function(a){return this.each(function(b){t(G.create(a),function(a){b.parentNode.insertBefore(a,b.nextSibling)})})},insertBefore:function(a,b){return z.call(this,a,b,function(a,b){a.parentNode.insertBefore(b,a)})},insertAfter:function(a,b){return z.call(this,a,b,function(a,b){var c=a.nextSibling;c?a.parentNode.insertBefore(b,c):a.parentNode.appendChild(b)})},css:function(a,b){if(b===undefined&&typeof a=="string")return y(this[0],a);var c=a;typeof a=="string"&&(c={},c[a]=b),j&&c.opacity&&(c.filter="alpha(opacity="+c.opacity*100+")",c.zoom=a.zoom||1,delete c.opacity);if(b=c["float"])j?c.styleFloat=b:c.cssFloat=b,delete c["float"];var d=function(a,b,d){for(var e in c)c.hasOwnProperty(e)&&(d=c[e],(b=v(e))&&m.test(d)&&!(b in r)&&(d+=n),a.style[b]=d)};return this.each(d)},offset:function(a,b){if(a||b)return this.each(function(c){A(c,a,b)});var c=this[0],d=c.offsetWidth,e=c.offsetHeight,f=c.offsetTop,g=c.offsetLeft;while(c=c.offsetParent)f=f+c.offsetTop,g=g+c.offsetLeft;return{top:f,left:g,height:e,width:d}},attr:function(a,b){var c=this[0];return typeof b=="undefined"?f.test(a)?i.test(a)&&typeof c[a]=="string"?!0:c[a]:c[p](a):this.each(function(c){a=="value"?c.value=b:c[o](a,b)})},val:function(a){return typeof a=="string"?this.attr("value",a):this[0].value},removeAttr:function(a){return this.each(function(b){b.removeAttribute(a)})},data:function(a,b){var c=this[0];if(typeof b=="undefined"){c[p]("data-node-uid")||c[o]("data-node-uid",++l);var d=c[p]("data-node-uid");k[d]||(k[d]={});return k[d][a]}return this.each(function(c){c[p]("data-node-uid")||c[o]("data-node-uid",++l);var d=c[p]("data-node-uid"),e={};e[a]=b,k[d]=e})},remove:function(){return this.each(function(a){a.parentNode&&a.parentNode.removeChild(a)})},empty:function(){return this.each(function(a){while(a.firstChild)a.removeChild(a.firstChild)})},detach:function(){return this.map(function(a){return a.parentNode.removeChild(a)})},scrollTop:function(a){return D.call(this,null,a,"y")},scrollLeft:function(a){return D.call(this,a,null,"x")}},G.setQueryEngine=function(a){d=a,delete G.setQueryEngine},G.aug=function(a,b){for(var c in a)a.hasOwnProperty(c)&&((b||B.prototype)[c]=a[c])},G.create=function(a,c){return typeof a=="string"?function(){var d=c?h[c.toLowerCase()]:null,e=b.createElement(d||"div"),f=[];if(c){var g=a.match(new RegExp("<"+d+">.+?<\\/"+d+">","g"));t(g,function(a){a=a.replace(/<(.+)>(.+?)<\/\1>/,"$2");var c=b.createElement(d);c.appendChild(b.createDocumentFragment(a)),e.appendChild(c)})}else e.innerHTML=a;var i=e.childNodes;e=e.firstChild,f.push(e);while(e=e.nextSibling)e.nodeType==1&&f.push(e);return f}():w(a)?[a.cloneNode(!0)]:[]},G.doc=function(){var a=c.scrollWidth,b=c.scrollHeight,d=this.viewport();return{width:Math.max(a,d.width),height:Math.max(b,d.height)}},G.firstChild=function(a){for(var b=a.childNodes,c=0,d=b&&b.length||0,e;c<d;c++)b[c].nodeType===1&&(e=b[d=c]);return e},G.viewport=function(){var a=self.innerHeight,b=self.innerWidth;j&&(a=c.clientHeight)&&(b=c.clientWidth);return{width:b,height:a}},G.isAncestor="compareDocumentPosition"in c?function(a,b){return(a.compareDocumentPosition(b)&16)==16}:"contains"in c?function(a,b){return a!==b&&a.contains(b)}:function(a,b){while(b=b.parentNode)if(b===a)return!0;return!1};var H=a.bonzo;G.noConflict=function(){a.bonzo=H;return this},a.bonzo=G}(this),!function(a){function d(a){var b=[],c,d;label:for(c=0;c<a.length;c++){for(d=0;d<b.length;d++)if(b[d]==a[c])continue label;b[b.length]=a[c]}return b}function c(a,b){for(var c=0;c<a.length;c++)if(a[c]===b)return c;return-1}var b=bonzo;b.setQueryEngine(a),a.ender(b),a.ender(b(),!0),a.ender({create:function(c){return a(b.create(c))}}),a.id=function(b){return a([document.getElementById(b)])},a.ender({parents:function(b,e){var f=a(b),g,h,i,j=[];for(g=0,h=this.length;g<h;g++){i=this[g];while(i=i.parentNode)if(c(f,i)!==-1){j.push(i);if(e)break}}return a(d(j))},closest:function(a){return this.parents(a,!0)},first:function(){return a(this[0])},last:function(){return a(this[this.length-1])},next:function(){return a(b(this).next())},previous:function(){return a(b(this).previous())},appendTo:function(a){return b(this.selector).appendTo(a,this)},prependTo:function(a){return b(this.selector).prependTo(a,this)},insertAfter:function(a){return b(this.selector).insertAfter(a,this)},insertBefore:function(a){return b(this.selector).insertBefore(a,this)},siblings:function(){var b,c,d,e=[];for(b=0,c=this.length;b<c;b++){d=this[b];while(d=d.previousSibling)d.nodeType==1&&e.push(d);d=this[b];while(d=d.nextSibling)d.nodeType==1&&e.push(d)}return a(e)},children:function(){var c,e=[];for(i=0,l=this.length;i<l;i++){if(!(c=b.firstChild(this[i])))continue;e.push(c);while(c=c.nextSibling)c.nodeType==1&&e.push(c)}return a(d(e))},height:function(a){return a?this.css("height",a):parseInt(this.css("height"),10)},width:function(a){return a?this.css("width",a):parseInt(this.css("width"),10)}},!0)}(ender||$),!function(a){function F(a){var b=a.relatedTarget;if(!b)return b==null;return b!=this&&b.prefix!="xul"&&!/document/.test(this.toString())&&!p(this,b)}var b=1,c={},d={},e=/over|out/,f=/[^\.]*(?=\..*)\.|.*/,g=/\..*/,h="addEventListener",i="attachEvent",j="removeEventListener",k="detachEvent",l=a.document||{},m=l.documentElement||{},n=m[h],o=n?h:i,p=function(a,b){var c=b.parentNode;while(c!=null){if(c==a)return!0;c=c.parentNode}},q=function(a,c){return a.__uid=c||a.__uid||b++},r=function(a){var b=q(a);return c[b]=c[b]||{}},s=n?function(a,b,c,d){a[d?h:j](b,c,!1)}:function(a,b,c,d,e){e&&d&&(a["_on"+e]=a["_on"+e]||0),a[d?i:k]("on"+b,c)},t=function(b,c,d){return function(e){e=D(e||((this.ownerDocument||this.document||this).parentWindow||a).event);return c.apply(b,[e].concat(d))}},u=function(a,b,c,d,e){return function(f){(d?d.call(this,f):n?!0:f&&f.propertyName=="_on"+c||!f)&&b.apply(a,[f].concat(e))}},v=function(a,b,c,e){var h=b.replace(g,""),i=r(a),j=i[h]||(i[h]={}),k=q(c,b.replace(f,""));if(j[k])return a;var l=G[h];l&&(c=l.condition?u(a,c,h,l.condition):c,h=l.base||h);var m=E[h];c=m?t(a,c,e):u(a,c,h,!1,e),m=n||m;if(h=="unload"){var p=c;c=function(){w(a,h,c)&&p()}}a[o]&&s(a,m?h:"propertychange",c,!0,!m&&h),j[k]=c,c.__uid=k;return h=="unload"?a:d[q(a)]=a},w=function(a,b,c){var d,e,h,i,j=r(a),k=b.replace(g,"");if(!j||!j[k])return a;e=b.replace(f,""),h=e?e.split("."):[c.__uid];for(i=h.length;i--;){d=h[i],c=j[k][d],delete j[k][d];if(a[o]){k=G[k]?G[k].base:k;var l=n||E[k];s(a,l?k:"propertychange",c,!1,!l&&k)}}return a},x=function(a,b,c){return function(d){var e=typeof a=="string"?c(a,this):a;for(var f=d.target;f&&f!=this;f=f.parentNode)for(var g=e.length;g--;)if(e[g]==f)return b.apply(f,arguments)}},y=function(a,b,c,d,e){if(typeof b=="object"&&!c)for(var f in b)b.hasOwnProperty(f)&&y(a,f,b[f]);else{var g=typeof c=="string",h=(g?c:b).split(" ");c=g?x(b,d,e):c;for(var i=h.length;i--;)v(a,h[i],c,Array.prototype.slice.call(arguments,g?4:3))}return a},z=function(a,b,c){var d,e,h,i=typeof b=="string",j=i&&b.replace(f,""),k=w,l=r(a);if(i&&/\s/.test(b)){b=b.split(" ");var m=b.length-1;while(z(a,b[m])&&m--);return a}h=i?b.replace(g,""):b;if(!l||i&&!l[h])return a;if(typeof c=="function")k(a,h,c);else if(j)k(a,b);else{k=h?k:z,e=i&&h,h=h?c||l[h]||h:l;for(d in h)h.hasOwnProperty(d)&&k(a,e||d,h[d])}return a},A=function(a,b,c){var d,e,h,i=b.split(" ");for(h=i.length;h--;){b=i[h].replace(g,"");var j=E[b],k=i[h].replace(f,""),l=r(a)[b];if(k){k=k.split(".");for(e=k.length;e--;)l[k[e]]&&l[k[e]].apply(a,c)}else if(!c&&a[o])B(j,b,a);else for(e in l)l.hasOwnProperty(e)&&l[e].apply(a,c)}return a},B=n?function(b,c,d){evt=document.createEvent(b?"HTMLEvents":"UIEvents"),evt[b?"initEvent":"initUIEvent"](c,!0,!0,a,1),d.dispatchEvent(evt)}:function(a,b,c){a?c.fireEvent("on"+b,document.createEventObject()):c["_on"+b]++},C=function(a,b,c){var d=r(b),e,f;e=c?d[c]:d;for(f in e)e.hasOwnProperty(f)&&(c?y:C)(a,c||b,c?e[f]:f);return a},D=function(a){var b={};if(!a)return b;var c=a.type,d=a.target||a.srcElement;b.preventDefault=D.preventDefault(a),b.stopPropagation=D.stopPropagation(a),b.target=d&&d.nodeType==3?d.parentNode:d;if(~c.indexOf("key"))b.keyCode=a.which||a.keyCode;else if(/click|mouse|menu/i.test(c)){b.rightClick=a.which==3||a.button==2,b.pos={x:0,y:0};if(a.pageX||a.pageY)b.clientX=a.pageX,b.clientY=a.pageY;else if(a.clientX||a.clientY)b.clientX=a.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,b.clientY=a.clientY+document.body.scrollTop+document.documentElement.scrollTop;e.test(c)&&(b.relatedTarget=a.relatedTarget||a[(c=="mouseover"?"from":"to")+"Element"])}for(var f in a)f in b||(b[f]=a[f]);return b};D.preventDefault=function(a){return function(){a.preventDefault?a.preventDefault():a.returnValue=!1}},D.stopPropagation=function(a){return function(){a.stopPropagation?a.stopPropagation():a.cancelBubble=!0}};var E={click:1,dblclick:1,mouseup:1,mousedown:1,contextmenu:1,mousewheel:1,DOMMouseScroll:1,mouseover:1,mouseout:1,mousemove:1,selectstart:1,selectend:1,keydown:1,keypress:1,keyup:1,orientationchange:1,touchstart:1,touchmove:1,touchend:1,touchcancel:1,gesturestart:1,gesturechange:1,gestureend:1,focus:1,blur:1,change:1,reset:1,select:1,submit:1,load:1,unload:1,beforeunload:1,resize:1,move:1,DOMContentLoaded:1,readystatechange:1,error:1,abort:1,scroll:1},G={mouseenter:{base:"mouseover",condition:F},mouseleave:{base:"mouseout",condition:F},mousewheel:{base:/Firefox/.test(navigator.userAgent)?"DOMMouseScroll":"mousewheel"}},H={add:y,remove:z,clone:C,fire:A},I=function(a){var b=z(a).__uid;b&&(delete d[b],delete c[b])};a[i]&&y(a,"unload",function(){for(var b in d)d.hasOwnProperty(b)&&I(d[b]);a.CollectGarbage&&CollectGarbage()});var J=a.bean;H.noConflict=function(){a.bean=J;return this},typeof module!="undefined"&&module.exports?module.exports=H:a.bean=H}(this),!function(a){var b=bean.noConflict(),c=function(c,d,e){var f=d?[d]:[];return function(){for(var e,g=0,h=this.length;g<h;g++)e=[this[g]].concat(f,Array.prototype.slice.call(arguments,0)),e.length==4&&e.push(a),!arguments.length&&c=="add"&&d&&(c="fire"),b[c].apply(this,e);return this}},d=c("add"),e=c("remove"),f=c("fire"),g={on:d,addListener:d,bind:d,listen:d,delegate:d,unbind:e,unlisten:e,removeListener:e,undelegate:e,emit:f,trigger:f,cloneEvents:c("clone"),hover:function(a,c){for(var d=0,e=this.length;d<e;d++)b.add.call(this,this[d],"mouseenter",a),b.add.call(this,this[d],"mouseleave",c);return this}},h=["blur","change","click","dblclick","error","focus","focusin","focusout","keydown","keypress","keyup","load","mousedown","mouseenter","mouseleave","mouseout","mouseover","mouseup","resize","scroll","select","submit","unload"];for(var i=h.length;i--;){var j=h[i];g[j]=c("add",j)}a.ender(g,!0)}(ender),!function(window){function serial(a){var b=a.name;if(a.disabled||!b)return"";b=enc(b);switch(a.tagName.toLowerCase()){case"input":switch(a.type){case"reset":case"button":case"image":case"file":return"";case"checkbox":case"radio":return a.checked?b+"="+(a.value?enc(a.value):!0)+"&":"";default:return b+"="+(a.value?enc(a.value):!0)+"&"}break;case"textarea":return b+"="+enc(a.value)+"&";case"select":return b+"="+enc(a.options[a.selectedIndex].value)+"&"}return""}function enc(a){return encodeURIComponent(a)}function reqwest(a,b){return new Reqwest(a,b)}function init(o,fn){function error(a){o.error&&o.error(a),complete(a)}function success(resp){o.timeout&&clearTimeout(self.timeout)&&(self.timeout=null);var r=resp.responseText;switch(type){case"json":resp=eval("("+r+")");break;case"js":resp=eval(r);break;case"html":resp=r}fn(resp),o.success&&o.success(resp),complete(resp)}function complete(a){o.complete&&o.complete(a)}this.url=typeof o=="string"?o:o.url,this.timeout=null;var type=o.type||setType(this.url),self=this;fn=fn||function(){},o.timeout&&(this.timeout=setTimeout(function(){self.abort(),error()},o.timeout)),this.request=getRequest(o,success,error)}function setType(a){if(/\.json$/.test(a))return"json";if(/\.jsonp$/.test(a))return"jsonp";if(/\.js$/.test(a))return"js";if(/\.html?$/.test(a))return"html";if(/\.xml$/.test(a))return"xml";return"js"}function Reqwest(a,b){this.o=a,this.fn=b,init.apply(this,arguments)}function getRequest(a,b,c){if(a.type!="jsonp"){var f=xhr();f.open(a.method||"GET",typeof a=="string"?a:a.url,!0),setHeaders(f,a),f.onreadystatechange=readyState(f,b,c),a.before&&a.before(f),f.send(a.data||null);return f}var d=doc.createElement("script");window[getCallbackName(a)]=generalCallback,d.type="text/javascript",d.src=a.url,d.async=!0;var e=function(){a.success&&a.success(lastValue),lastValue=undefined,head.removeChild(d)};d.onload=e,d.onreadystatechange=function(){d.readyState=="loaded"&&e()},head.appendChild(d)}function generalCallback(a){lastValue=a}function getCallbackName(a){var b=a.jsonpCallback||"callback";if(a.url.slice(-(b.length+2))==b+"=?"){var c="reqwest_"+uniqid++;a.url=a.url.substr(0,a.url.length-1)+c;return c}var d=new RegExp(b+"=([\\w]+)");return a.url.match(d)[1]}function setHeaders(a,b){var c=b.headers||{};c.Accept="text/javascript, text/html, application/xml, text/xml, */*",c["X-Requested-With"]=c["X-Requested-With"]||"XMLHttpRequest";if(b.data){c["Content-type"]="application/x-www-form-urlencoded";for(var d in c)c.hasOwnProperty(d)&&a.setRequestHeader(d,c[d],!1)}}function readyState(a,b,c){return function(){a&&a.readyState==4&&(twoHundo.test(a.status)?b(a):c(a))}}var twoHundo=/^20\d$/,doc=document,byTag="getElementsByTagName",head=doc[byTag]("head")[0],xhr="XMLHttpRequest"in window?function(){return new XMLHttpRequest}:function(){return new ActiveXObject("Microsoft.XMLHTTP")},uniqid=0,lastValue;Reqwest.prototype={abort:function(){this.request.abort()},retry:function(){init.call(this,this.o,this.fn)}},reqwest.serialize=function(a){var b=a[byTag]("input"),c=a[byTag]("select"),d=a[byTag]("textarea");return(v(b).chain().toArray().map(serial).value().join("")+v(c).chain().toArray().map(serial).value().join("")+v(d).chain().toArray().map(serial).value().join("")).replace(/&$/,"")},reqwest.serializeArray=function(a){for(var b=this.serialize(a).split("&"),c=0,d=b.length,e=[],f;c<d;c++)b[c]&&(f=b[c].split("="))&&e.push({name:f[0],value:f[1]});return e};var old=window.reqwest;reqwest.noConflict=function(){window.reqwest=old;return this},window.reqwest=reqwest}(this),ender.ender({ajax:reqwest}),ender.ender({serialize:function(){return reqwest.serialize(this[0])},serializeArray:function(){return reqwest.serializeArray(this[0])}},!0),!function(a){function A(a,b){a=typeof a=="string"?document.getElementById(a):a,b=z(b);var c={duration:b.duration,easing:b.easing,after:b.after};delete b.duration,delete b.easing,delete b.after;if(e&&typeof c.easing!="function")return y(a,b,c);var d=q(b,function(a,b){a=r(a);return p(a)in h&&g.test(b)?[a,b+"px"]:[a,b]});x(a,d,c)}function z(a){var b={};for(var c in a)b[c]=a[c],c=="after"&&delete a[c];return b}function y(a,b,c){var d=[],f=[],i=c.duration||1e3,j=c.easing||"ease-out",k="";i=i+"ms",a.addEventListener(l,function m(){a.setAttribute("style",k),c.after&&c.after(),a.removeEventListener(l,m,!0)},!0),setTimeout(function(){var c;for(c in b)b.hasOwnProperty(c)&&d.push(r(c)+" "+i+" "+j);for(c in b){var f=p(c)in h&&g.test(b[c])?b[c]+"px":b[c];b.hasOwnProperty(c)&&(a.style[p(c)]=f)}k=a.getAttribute("style"),d=d.join(","),a.style[e+"Transition"]=d},10)}function x(a,b,c,d){c=c||{};var e=w(b),f=a.currentStyle?a.currentStyle:getComputedStyle(a,null),g={},h=+(new Date),i,j=c.duration||200,k=h+j,l,m=c.easing||function(a){return-Math.cos(a*Math.PI)/2+.5};for(i in e)g[i]=v(f[i]);l=setInterval(function(){var b=+(new Date),f,i=b>k?1:(b-h)/j;for(f in e)a.style[f]=e[f].f(g[f].v,e[f].v,m(i))+e[f].u;b>k&&(clearInterval(l),c.after&&c.after(),d&&setTimeout(d,1))},10)}function w(a){var c,d={},e=k.length,f;b.innerHTML='<div style="'+a+'"></div>',c=b.childNodes[0].style;while(e--)(f=c[k[e]])&&(d[k[e]]=v(f));return d}function v(a){var b=parseFloat(a),c=a?a.replace(/^[\-\d\.]+/,""):a;return isNaN(b)?{v:c,f:u,u:""}:{v:b,f:s,u:c}}function u(a,b,c){var d=2,e,f,g,h=[],i=[];while((e=3)&&(f=arguments[d-1])&&d--)if(t(f,0)=="r"){f=f.match(/\d+/g);while(e--)h.push(~~f[e])}else{f.length==4&&(f="#"+t(f,1)+t(f,1)+t(f,2)+t(f,2)+t(f,3)+t(f,3));while(e--)h.push(parseInt(t(f,1+e*2,2),16))}while(e--)g=~~(h[e+3]+(h[e]-h[e+3])*c),i.push(g<0?0:g>255?255:g);return"rgb("+i.join(",")+")"}function t(a,b,c){return a.substr(b,c||1)}function s(a,b,c){return(a+(b-a)*c).toFixed(3)}function r(a){if(a.toUpperCase()===a)return a;return a.replace(/([a-zA-Z0-9])([A-Z])/g,function(a,b,c){return b+"-"+c}).toLowerCase()}function q(a,b){return o(a,function(a,c){var d=b?b(c,a):[c,a];return d[0]+":"+d[1]+";"}).join("")}function p(a){return a.replace(/-(.)/g,function(a,b){return b.toUpperCase()})}function o(a,b,c){var d=[],e;for(e in a)d.push(b.call(c,a[e],e,a));return d}var b=document.createElement("div"),c=["webkit","Moz","O"],d=3,e,f,g=/\d+$/,h={},i="backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color fontWeight lineHeight opacity outlineColor zIndex",j="top bottom left right borderWidth borderBottomWidth borderLeftWidth borderRightWidth borderTopWidth borderSpacing borderRadius marginBottom marginLeft marginRight marginTop width height maxHeight maxWidth minHeight minWidth paddingBottom paddingLeft paddingRight paddingTop fontSize wordSpacing textIndent letterSpacing outlineWidth outlineOffset",k=(i+" "+j).split(" ");while(d--)f=c[d],b.style.cssText="-"+f.toLowerCase()+"-transition-property:opacity;",typeof b.style[f+"TransitionProperty"]!="undefined"&&(e=f);var l=/^w/.test(e)?"webkitTransitionEnd":"transitionend";for(var m=j.split(" "),n=m.length;n--;)h[m[n]]=1;var B=a.emile;A.noConflict=function(){a.emile=B;return this},a.emile=A}(this),!function(){function c(a,c,d){var e=b(a,c);for(var f=0,g=this.length;f<g;f++)this[f].currentStyle||(this[f].style.opacity=d?0:1),this[f].currentStyle&&(this[f].style.filter="alpha(opacity="+(d?0:1)*100+")"),this[f].currentStyle&&!this[f].currentStyle.hasLayout&&(this[f].style.zoom=1),this[f].style.display="";return this.animate({opacity:d,duration:e[0],after:e[1]})}var a=emile.noConflict(),b=function(a,b){var c=typeof a=="number"?a:1e3,d=typeof b=="function"?b:typeof a=="function"?a:function(){};return[c,d]};$.ender({animate:function(b){var c=this;setTimeout(function(){for(var d=0,f=c.length;d<f;d++)a(c[d],b)},0);return this},fadeIn:function(a,b){return c.call(this,a,b,1)},fadeOut:function(a,b){return c.call(this,a,b,0)}},!0)}()

function fnOpenWindow(url,parameters)
{
	parameters=parameters.replace(/\s+/g,'');

	var aParameters=parameters.split(',');
	var data=new Array();
	for (var i=0;i<aParameters.length;i++) {
		var pr=aParameters[i];
		var key = pr.substr(0,pr.indexOf('='));
		var value=pr.substr(pr.indexOf('=')+1);
		data[key]=value;
	}

	if ( (data['hposition'])&&(data['width'])&&(data['hposition']!='system') )
	{
		var posX=null;
		if (data['hposition']=='left')
		{
			posX=0;
		}
		if ( (window.screen)&&(window.screen.availWidth) )
		{
			if (data['hposition']=='center')
				posX=(window.screen.availWidth-data['width'])/2;
			if (data['hposition']=='right')
				posX=window.screen.availWidth-data['width'];
		}

		if (posX!=null)
			parameters+=",left="+parseInt(posX);
	}

	if ( (data['vposition'])&&(data['height'])&&(data['vposition']!='system') )
	{
		var posY=null;
		if (data['vposition']=='top')
		{
			posY=0;
		}
		if ( (window.screen)&&(window.screen.availHeight) )
		{
			if (data['vposition']=='center')
				posY=(window.screen.availHeight-data['height'])/2;
			if (data['vposition']=='bottom')
				posY=window.screen.availHeight-data['height'];
		}

		if (posY!=null)
			parameters+=",top="+parseInt(posY);
	}


	var oWnd=window.open(url,'',parameters);
	oWnd.focus();
}

/* Test CSS properties
----- */
/* Modernizr custom build of 1.7: backgroundsize | csstransforms | csstransforms3d | csstransitions */
;window.Modernizr=function(a,b,c){function G(){}function F(a,b){var c=a.charAt(0).toUpperCase()+a.substr(1),d=(a+" "+p.join(c+" ")+c).split(" ");return!!E(d,b)}function E(a,b){for(var d in a)if(k[a[d]]!==c&&(!b||b(a[d],j)))return!0}function D(a,b){return(""+a).indexOf(b)!==-1}function C(a,b){return typeof a===b}function B(a,b){return A(o.join(a+";")+(b||""))}function A(a){k.cssText=a}var d="1.7",e={},f=!0,g=b.documentElement,h=b.head||b.getElementsByTagName("head")[0],i="modernizr",j=b.createElement(i),k=j.style,l=b.createElement("input"),m=":)",n=Object.prototype.toString,o=" -webkit- -moz- -o- -ms- -khtml- ".split(" "),p="Webkit Moz O ms Khtml".split(" "),q={svg:"http://www.w3.org/2000/svg"},r={},s={},t={},u=[],v,w=function(a){var c=b.createElement("style"),d=b.createElement("div"),e;c.textContent=a+"{#modernizr{height:3px}}",h.appendChild(c),d.id="modernizr",g.appendChild(d),e=d.offsetHeight===3,c.parentNode.removeChild(c),d.parentNode.removeChild(d);return!!e},x=function(){function d(d,e){e=e||b.createElement(a[d]||"div");var f=(d="on"+d)in e;f||(e.setAttribute||(e=b.createElement("div")),e.setAttribute&&e.removeAttribute&&(e.setAttribute(d,""),f=C(e[d],"function"),C(e[d],c)||(e[d]=c),e.removeAttribute(d))),e=null;return f}var a={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return d}(),y=({}).hasOwnProperty,z;C(y,c)||C(y.call,c)?z=function(a,b){return b in a&&C(a.constructor.prototype[b],c)}:z=function(a,b){return y.call(a,b)},r.backgroundsize=function(){return F("backgroundSize")},r.csstransforms=function(){return!!E(["transformProperty","WebkitTransform","MozTransform","OTransform","msTransform"])},r.csstransforms3d=function(){var a=!!E(["perspectiveProperty","WebkitPerspective","MozPerspective","OPerspective","msPerspective"]);a&&"webkitPerspective"in g.style&&(a=w("@media ("+o.join("transform-3d),(")+"modernizr)"));return a},r.csstransitions=function(){return F("transitionProperty")};for(var H in r)z(r,H)&&(v=H.toLowerCase(),e[v]=r[H](),u.push((e[v]?"":"no-")+v));e.input||G(),e.crosswindowmessaging=e.postmessage,e.historymanagement=e.history,e.addTest=function(a,b){a=a.toLowerCase();if(!e[a]){b=!!b(),g.className+=" "+(b?"":"no-")+a,e[a]=b;return e}},A(""),j=l=null,e._enableHTML5=f,e._version=d;return e}(this,this.document);


/* Computed style
----- */
function getStyle(obj,cssRule) {
	if (document.defaultView && document.defaultView.getComputedStyle) {
		getStyle = function(obj,cssRule) {
			return document.defaultView.getComputedStyle(obj, "").getPropertyValue(cssRule);
		};
	}
	else {
		getStyle = function(obj,cssRule) {
			if (obj.currentStyle) {
				cssRule = cssRule.replace(/\-(\w)/g, function (match, p1) {
					return p1.toUpperCase();
				});
				return obj.currentStyle[cssRule];
			}
		};
	}
	return getStyle(obj,cssRule);
}

/* Page width
----- */
function getPageX() {
	var docWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
	// Order maters here as for IE 6 documentElement.clientWidth != body.clientWidth
	var docScrollX = document.documentElement.scrollLeft || document.body.scrollLeft;
	return [docWidth,docScrollX];
}

/* Page height
----- */
function getPageY() {
	var docHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
	// Order maters here as for IE 6 documentElement.clientHeight != body.clientHeight
	var docScrollY = document.documentElement.scrollTop || document.body.scrollTop;
	return [docHeight,docScrollY];
}

/* Let's roll
----- */
$.domReady(function () {
	
	/* Background image
	----- */
		if(!Modernizr.backgroundsize) {
		var bgImage = getStyle($('body')[0],'background-image'), regEx = /url\((.+)\)/;
		bgImage = bgImage.replace(regEx,'$1');
		$('body').append('<div id="bg"><img src='+bgImage+' border="0" /><span class="mask"></span></div>').css({'background':'#000'});
		
		// Heavily inspired by (or should I say pinched from?)
		// Supersized - Fullscreen Slideshow jQuery Plugin
		// www.buildinternet.com/project/supersized

		function resizenow() {
			
			var img = $('#bg img'), w = img.offset().width, h = img.offset().height, ratio = (h/w).toFixed(2), dW = getPageX()[0], dH = getPageY()[0], minW = 1024, minH = 0, landscape = 0, portrait = 1;

			if ((dH <= minH) && (dW <= minW)) { //If window smaller than minimum width and height
				if ((dH/dW) > ratio)
					landscape && ratio <= 1 ? resizeWidth(true) : resizeHeight(true); //If landscapes are set to fit
				else
					portrait && ratio > 1 ? resizeHeight(true) : resizeWidth(true); //If portraits are set to fit
			} else if (dW <= minW) { //If window only smaller than minimum width
				if ((dH/dW) > ratio)
					landscape && ratio <= 1 ? resizeWidth(true) : resizeHeight();	//If landscapes are set to fit
				else
					portrait && ratio > 1 ? resizeHeight() : resizeWidth(true);		//If portraits are set to fit
			} else if (dH <= minH) { //If window only smaller than minimum height
				if ((dH/dW) > ratio)
					landscape && ratio <= 1 ? resizeWidth() : resizeHeight(true);	//If landscapes are set to fit
				else
					portrait && ratio > 1 ? resizeHeight(true) : resizeWidth();		//If portraits are set to fit
			} else { //If larger than minimums
				if ((dH/dW) > ratio)
					landscape && ratio <= 1 ? resizeWidth() : resizeHeight();	//If landscapes are set to fit
				else
					portrait && ratio > 1 ? resizeHeight() : resizeWidth();		//If portraits are set to fit
			}
			
			function resizeWidth(minimum){
				if (minimum){ //If minimum height needs to be considered
					if(img.offset().width < dW || img.offset().width < minW ){
						if (img.offset().width * ratio >= minH){
							img.css({'width': minW});
							img.css({'height': img.offset().width * ratio});
				    	}else{
				    		resizeHeight();
				    	}
				    }
				}else{
					if (minH >= dH && !landscape){	//If minimum height needs to be considered
						if (dW * ratio >= minH || (dW * ratio >= minH && ratio <= 1)){	//If resizing would push below minimum height or image is a landscape
							img.css({'width': dW});
							img.css({'height': dW * ratio});
						} else if (ratio > 1){		//Else the image is portrait
							img.css({'height': minH});
							img.css({'width': img.offset().height / ratio});
						} else if (img.offset().width < dW) {
							img.css({'width': dW});
							img.css({'height': img.offset().width * ratio});
						}
					}else{ //Otherwise, resize as normal
						img.css({'width': dW});
						img.css({'height': dW * ratio});
					}
				}
			};
			
			function resizeHeight(minimum){
				if (minimum){ //If minimum height needs to be considered
					if(img.offset().height < dH){
						if (img.offset().height / ratio >= minW){
							img.css({'height': minH});
							img.css({'width': img.offset().height / ratio});
						}else{
							resizeWidth(true);
						}
					}
				}else{ // Otherwise, resized as normal
					if (minW >= dW){	//If minimum width needs to be considered
						if (dH / ratio >= minW || ratio > 1){	//If resizing would push below minimum width or image is a portrait
							img.css({'height': dH});
							img.css({'width': dH / ratio});
						} else if (ratio <= 1){ //Else the image is landscape
							img.css({'width': minW});
							img.css({'height': img.offset().width * ratio});
						}
					}else{	//Otherwise, resize as normal
						img.css({'height': dH});
						img.css({'width': dH / ratio});
					}
				}
			};
			
		}
		
		resizenow();

		$(window).resize(function(){
    		resizenow();
		});
		
	}
	
	/* Folds
	----- */
	$('.foldCall').each(function(el,index){
		var caller = $(el), group = caller.attr('data-foldgroup'), tgt = $('.inset[data-foldgroup='+group+']');
		if(tgt.length===0) return;

		var labels = ($('html').attr('lang') === 'en') ? {'none':"more info","block":"close"} : {'none':"plus d'infos","block":"fermer"}, label = $.create('<span class="label">'+labels.none+'</label>')[0];
		label = $(label);
		label.appendTo(caller[0]);
		caller.click(function(){
			var d = ($(tgt).css('display') === 'block') ? 'none' : 'block';
			$(tgt).css('display',d);
			label.html(labels[d]);
		});
	});
	
	/* Deco image
	----- */
	$('#navigation > ul ul').each(function(el,index){
		$(el).append('<span class="deco" style="background-image: url('+$(el).attr("data-deco")+');"></span>');
	});
	$('#home > ul > li').each(function(el,index){
		var t = $('ul',el);
		if (t.length === 0) return;
		
		$(el).append('<span class="deco" style="background-image: url('+$(t).attr("data-deco")+');"></span>');
	});
	
	/* Home animated GIF
	----- */
	$('.home #logo').each(function(){
		var prt = $(this), path = '/static/css/i/logos/', max = 15, speed = 7000;
		for(var i = 0; i < max; ++i) {
			var img = path + 'l4borintus-' + i + '.png';
			$('#logo a').append('<span id="logo-'+i+'" style="background-image: url('+img+');" />');
		}
		
		var shiftIt = function(i){
			var n = (i===(max-1)) ? 0 : i+1;
			/*@
				if(ie_rv < 9) {
					$('#logo-'+i).css({'filter':'alpha(opacity=0)', '-ms-filter': 'progid:DXImageTransform.Microsoft.Alpha(Opacity=0)'});
					$('#logo-'+n).css({'filter':'none', '-ms-filter': 'none'});
				}
				else {
			@*/
			$('#logo-'+i).animate({
				opacity: 0,
				duration: 500
			});
			$('#logo-'+n).animate({
				opacity: 1,
				duration: 200
			});
			/*@ } @*/
			
			$.delay(animateGIF, speed, n);
		};
		
		var animateGIF = $.bind(shiftIt,prt);
		$('#logo a').css({'background-image':'none'});
		$.delay(animateGIF, 0, (max-1));
		
	});
	
	/* Handle links
	----- */
	$('body').bind('click', handleLinks);
	
	function handleLinks(e) {
		// e = ( e ) ? e : event;
		var el = e.target || e.srcElement;
		if(el.nodeName.toLowerCase() != 'a') {
			var prt = el.parentNode;
			while(prt&&prt.nodeName.toLowerCase() != 'a')
				prt = prt.parentNode;
			if (!prt) return;
			if (prt.nodeName.toLowerCase() != 'a') return;
			el = prt;
		}
		var rel = $(el).attr('rel');
		if (rel && rel.match( /\bexternal\b/ ) )
			$(el).attr('target','_blank');
		else if (rel && rel.match( /\bzoom\b/ ) )
			zoom($(el),e);
	};
	
	
	/* Zoom
	----- */
	function zoom(el,e){
		e.preventDefault();
		e.stopPropagation();
		var prt = el, url = prt.attr('href');
		if(url) {
			var internal = (url.charAt(0)=='#') ? true : false;
			if(internal==false) url = (url.indexOf('?')>0) ? url+'&js=true' : url+'?js=true';
		}

		$('body').append('<div id="overlay"><div id="overlayContent" style="visibility: hidden;"></div></div>');

		$('#overlay').animate({
			opacity: 1,
			duration: 100
		});
		
		$.ajax({
			url: url,
			type: 'html',
			success: function (resp) {
				$('#overlayContent').html(resp);
				var c = $('#overlayContent > div');
				if(c.length===0) {
					$('#overlayContent').html('<div style="width: 300px; height: 300px;>"<br><br>Unable to load content<br></div>');
					c = $('#overlayContent > div');
				}
				var w = c.offset().width||getStyle(c[0],'width'), h = $('#overlayContent > div').offset().height+26, oH = $('#overlay').offset().height, z = (parseInt(oH,10)-parseInt(h,10))/2;
				$('#overlayContent').css({'visibility':'visible','min-height':h+'px','width':w+'px','margin-top':z+'px'}).animate({
					opacity: 1,
					duration: 100,
					after: function () {
						$('#overlayContent').append('<button type="button" class="closer">X</button>');
						$('#overlayContent .closer').bind('click focus',function(){
							$('#overlay').animate({
								opacity: 0,
								duration: 150,
								after: function () {
									$('#overlay').remove();
								}
							});
						});
					}
				});
			},
			failure: function () {
				$('#overlayContent').html('<br><br>Unable to load content<br>');
				var w = '300', h = '300', oH = getStyle($('#overlay')[0],'height'), z = (parseInt(oH,10)-parseInt(h,10))/2;

				$('#overlayContent').css({'width':w+'px','height':h+'px','margin-top':z+'px'}).animate({
					opacity: 1,
					duration: 100,
					after: function () {
						$('#overlayContent').append('<button type="button" class="closer">X</button>');
						$('#overlayContent .closer').bind('click focus',function(){
							$('#overlay').animate({
								opacity: 0,
								duration: 150,
								after: function () {
									$('#overlay').remove();
								}
							});
						});
					}
				});
			}
		});
		
		return false;
	};
});


