(function(){this.MooTools={version:"1.4.5",build:"ab8ea8824dc3b24b6666867a2c4ed58ebb762cf0"};var a=this.typeOf=function(a){if(null==a)return"null";if(null!=a.$family)return a.$family();if(a.nodeName){if(1==a.nodeType)return"element";if(3==a.nodeType)return/\S/.test(a.nodeValue)?"textnode":"whitespace"}else if("number"==typeof a.length){if(a.callee)return"arguments";if("item"in a)return"collection"}return typeof a};this.instanceOf=function(a,b){if(null==a)return!1;for(var c=a.$constructor||a.constructor;c;){if(c=== b)return!0;c=c.parent}return!a.hasOwnProperty?!1:a instanceof b};var b=this.Function,c=!0,d;for(d in{toString:1})c=null;c&&(c="hasOwnProperty valueOf isPrototypeOf propertyIsEnumerable toLocaleString toString constructor".split(" "));b.prototype.overloadSetter=function(a){var b=this;return function(d,e){if(null==d)return this;if(a||"string"!=typeof d){for(var f in d)b.call(this,f,d[f]);if(c)for(var k=c.length;k--;)f=c[k],d.hasOwnProperty(f)&&b.call(this,f,d[f])}else b.call(this,d,e);return this}}; b.prototype.overloadGetter=function(a){var b=this;return function(c){var d,e;"string"!=typeof c?d=c:1>>0;c>>0;e>>0,d=0>b?Math.max(0,c+b):b||0;d>>0,d=Array(c),e=0;e>>0;cthis.length)return null; if(4==this.length&&0==this[3]&&!a)return"transparent";for(var b=[],c=0;3>c;c++){var d=(this[c]-0).toString(16);b.push(1==d.length?"0"+d:d)}return a?b:"#"+b.join("")}}); String.implement({test:function(a,b){return("regexp"==typeOf(a)?a:RegExp(""+a,b)).test(this)},contains:function(a,b){return b?-1<(b+this+b).indexOf(b+a+b):-1a?-a:0);return Math.round(this*a)/a},times:function(a,b){for(var c=0;c]*>([\s\S]*?)<\/script>/gi, function(a,c){b+=c+"\n";return""});!0===a?f.exec(b):"function"==typeOf(a)&&a(b,c);return c});f.extend({Document:this.Document,Window:this.Window,Element:this.Element,Event:this.Event});this.Window=this.$constructor=new Type("Window",function(){});this.$family=Function.from("window").hide();Window.mirror(function(a,c){b[a]=c});this.Document=a.$constructor=new Type("Document",function(){});a.$family=Function.from("document").hide();Document.mirror(function(b,c){a[b]=c});a.html=a.documentElement;a.head|| (a.head=a.getElementsByTagName("head")[0]);if(a.execCommand)try{a.execCommand("BackgroundImageCache",!1,!0)}catch(j){}if(this.attachEvent&&!this.addEventListener){var k=function(){this.detachEvent("onunload",k);a.head=a.html=a.window=null};this.attachEvent("onunload",k)}var m=Array.from;try{m(a.html.childNodes)}catch(u){Array.from=function(a){if(typeof a!="string"&&Type.isEnumerable(a)&&typeOf(a)!="array"){for(var b=a.length,c=Array(b);b--;)c[b]=a[b];return c}return m(a)};var p=Array.prototype,r= p.slice;"pop push reverse shift sort splice unshift concat join slice".split(" ").each(function(a){var b=p[a];Array[a]=function(a){return b.apply(Array.from(a),r.call(arguments,1))}})}})(); (function(){var a={},b=this.DOMEvent=new Type("DOMEvent",function(b,d){d||(d=window);b=b||d.event;if(b.$extended)return b;this.event=b;this.$extended=!0;this.shift=b.shiftKey;this.control=b.ctrlKey;this.alt=b.altKey;this.meta=b.metaKey;for(var e=this.type=b.type,f=b.target||b.srcElement;f&&3==f.nodeType;)f=f.parentNode;this.target=document.id(f);if(0==e.indexOf("key")){if(f=this.code=b.which||b.keyCode,this.key=a[f],"keydown"==e&&(111f?this.key="f"+(f-111):95f&&(this.key=f-96)),null== this.key)this.key=String.fromCharCode(f).toLowerCase()}else if("click"==e||"dblclick"==e||"contextmenu"==e||"DOMMouseScroll"==e||0==e.indexOf("mouse")){f=d.document;f=!f.compatMode||"CSS1Compat"==f.compatMode?f.html:f.body;this.page={x:null!=b.pageX?b.pageX:b.clientX+f.scrollLeft,y:null!=b.pageY?b.pageY:b.clientY+f.scrollTop};this.client={x:null!=b.pageX?b.pageX-d.pageXOffset:b.clientX,y:null!=b.pageY?b.pageY-d.pageYOffset:b.clientY};if("DOMMouseScroll"==e||"mousewheel"==e)this.wheel=b.wheelDelta? b.wheelDelta/120:-(b.detail||0)/3;this.rightClick=3==b.which||2==b.button;if("mouseover"==e||"mouseout"==e){for(e=b.relatedTarget||b[("mouseover"==e?"from":"to")+"Element"];e&&3==e.nodeType;)e=e.parentNode;this.relatedTarget=document.id(e)}}else if(0==e.indexOf("touch")||0==e.indexOf("gesture"))if(this.rotation=b.rotation,this.scale=b.scale,this.targetTouches=b.targetTouches,this.changedTouches=b.changedTouches,(e=this.touches=b.touches)&&e[0])e=e[0],this.page={x:e.pageX,y:e.pageY},this.client={x:e.clientX, y:e.clientY};this.client||(this.client={});this.page||(this.page={})});b.implement({stop:function(){return this.preventDefault().stopPropagation()},stopPropagation:function(){this.event.stopPropagation?this.event.stopPropagation():this.event.cancelBubble=!0;return this},preventDefault:function(){this.event.preventDefault?this.event.preventDefault():this.event.returnValue=!1;return this}});b.defineKey=function(b,d){a[b]=d;return this};b.defineKeys=b.defineKey.overloadSetter(!0);b.defineKeys({38:"up", 40:"down",37:"left",39:"right",27:"esc",32:"space",8:"backspace",9:"tab",46:"delete",13:"enter"})})(); (function(){var a=this.Class=new Type("Class",function(d){instanceOf(d,Function)&&(d={initialize:d});var f=function(){c(this);if(f.$prototyping)return this;this.$caller=null;var a=this.initialize?this.initialize.apply(this,arguments):this;this.$caller=this.caller=null;return a}.extend(this).implement(d);f.$constructor=a;f.prototype.$constructor=f;f.prototype.parent=b;return f}),b=function(){if(!this.$caller)throw Error('The method "parent" cannot be called.');var a=this.$caller.$name,b=this.$caller.$owner.parent, b=b?b.prototype[a]:null;if(!b)throw Error('The method "'+a+'" has no parent.');return b.apply(this,arguments)},c=function(a){for(var b in a){var d=a[b];switch(typeOf(d)){case "object":var h=function(){};h.prototype=d;a[b]=c(new h);break;case "array":a[b]=d.clone()}}return a},d=function(b,c,d){if(a.Mutators.hasOwnProperty(b)&&(c=a.Mutators[b].call(this,c),null==c))return this;if("function"==typeOf(c)){if(c.$hidden)return this;var h=this.prototype;if(!d){var i=c;i.$origin&&(i=i.$origin);var j=function(){if(i.$protected&& this.$caller==null)throw Error('The method "'+b+'" cannot be called.');var a=this.caller,c=this.$caller;this.caller=c;this.$caller=j;var d=i.apply(this,arguments);this.$caller=c;this.caller=a;return d}.extend({$owner:this,$origin:i,$name:b}),c=j}h[b]=c}else Object.merge(this.prototype,b,c);return this};a.implement("implement",d.overloadSetter());a.Mutators={Extends:function(a){this.parent=a;a.$prototyping=!0;var b=new a;delete a.$prototyping;this.prototype=b},Implements:function(a){Array.from(a).each(function(a){var a= new a,b;for(b in a)d.call(this,b,a[b],!0)},this)}}})(); (function(){this.Chain=new Class({$chain:[],chain:function(){this.$chain.append(Array.flatten(arguments));return this},callChain:function(){return this.$chain.length?this.$chain.shift().apply(this,arguments):!1},clearChain:function(){this.$chain.empty();return this}});var a=function(a){return a.replace(/^on([A-Z])/,function(a,b){return b.toLowerCase()})};this.Events=new Class({$events:{},addEvent:function(b,c,d){b=a(b);this.$events[b]=(this.$events[b]||[]).include(c);d&&(c.internal=!0);return this}, addEvents:function(a){for(var c in a)this.addEvent(c,a[c]);return this},fireEvent:function(b,c,d){b=a(b);b=this.$events[b];if(!b)return this;c=Array.from(c);b.each(function(a){d?a.delay(d,this,c):a.apply(this,c)},this);return this},removeEvent:function(b,c){var b=a(b),d=this.$events[b];if(d&&!c.internal){var e=d.indexOf(c);-1!=e&&delete d[e]}return this},removeEvents:function(b){var c;if("object"==typeOf(b)){for(c in b)this.removeEvent(c,b[c]);return this}b&&(b=a(b));for(c in this.$events)if(!(b&& b!=c))for(var d=this.$events[c],e=d.length;e--;)e in d&&this.removeEvent(c,d[e]);return this}});this.Options=new Class({setOptions:function(){var a=this.options=Object.merge.apply(null,[{},this.options].append(arguments));if(this.addEvent)for(var c in a)"function"==typeOf(a[c])&&/^on[A-Z]/.test(c)&&(this.addEvent(c,a[c]),delete a[c]);return this}})})(); (function(){function a(a,f,m,g,i,u,l,o,y,A,x,z,C,F,E,w){if(f||-1===c)if(b.expressions[++c]=[],d=-1,f)return"";if(m||g||-1===d)m=m||" ",a=b.expressions[c],e&&a[d]&&(a[d].reverseCombinator=j(m)),a[++d]={combinator:m,tag:"*"};m=b.expressions[c][d];if(i)m.tag=i.replace(h,"");else if(u)m.id=u.replace(h,"");else if(l)l=l.replace(h,""),m.classList||(m.classList=[]),m.classes||(m.classes=[]),m.classList.push(l),m.classes.push({value:l,regexp:RegExp("(^|\\s)"+k(l)+"(\\s|$)")});else if(C)w=(w=w||E)?w.replace(h, ""):null,m.pseudos||(m.pseudos=[]),m.pseudos.push({key:C.replace(h,""),value:w,type:1==z.length?"class":"element"});else if(o){var o=o.replace(h,""),x=(x||"").replace(h,""),B,D;switch(y){case "^=":D=RegExp("^"+k(x));break;case "$=":D=RegExp(k(x)+"$");break;case "~=":D=RegExp("(^|\\s)"+k(x)+"(\\s|$)");break;case "|=":D=RegExp("^"+k(x)+"(-|$)");break;case "=":B=function(a){return x==a};break;case "*=":B=function(a){return a&&-1+)\\s*|(\\s+)|(+|\\*)|\\#(+)|\\.(+)|\\[\\s*(+)(?:\\s*([*^$!~|]?=)(?:\\s*(?:([\"']?)(.*?)\\9)))?\\s*\\](?!\\])|(:+)(+)(?:\\((?:(?:([\"'])([^\\13]*)\\13)|((?:\\([^)]+\\)|[^()]*)+))\\))?)".replace(//, "["+k(">+~`!@$%^&={}\\;/g,"(?:[\\w\\u00a1-\\uFFFF-]|\\\\[^\\s0-9a-f])").replace(//g,"(?:[:\\w\\u00a1-\\uFFFF-]|\\\\[^\\s0-9a-f])")),u=this.Slick||{};u.parse=function(a){return i(a)};u.escapeRegExp=k;this.Slick||(this.Slick=u)}).apply("undefined"!=typeof exports?exports:this); (function(){var a={},b={},c=Object.prototype.toString;a.isNativeCode=function(a){return/\{\s*\[native code\]\s*\}/.test(""+a)};a.isXML=function(a){return!!a.xmlVersion||!!a.xml||"[object XMLDocument]"==c.call(a)||9==a.nodeType&&"HTML"!=a.documentElement.nodeName};a.setDocument=function(a){var c=a.nodeType;if(9!=c)if(c)a=a.ownerDocument;else if(a.navigator)a=a.document;else return;if(this.document!==a){this.document=a;var c=a.documentElement,d=this.getUIDXML(c),e=b[d],f;if(!e){e=b[d]={};e.root=c;e.isXMLDocument= this.isXML(a);e.brokenStarGEBTN=e.starSelectsClosedQSA=e.idGetsName=e.brokenMixedCaseQSA=e.brokenGEBCN=e.brokenCheckedQSA=e.brokenEmptyAttributeQSA=e.isHTMLDocument=e.nativeMatchesSelector=!1;var g,h,i,j,l,o=a.createElement("div"),y=a.body||a.getElementsByTagName("body")[0]||c;y.appendChild(o);try{o.innerHTML='',e.isHTMLDocument=!!a.getElementById("slick_uniqueid")}catch(A){}if(e.isHTMLDocument){o.style.display="none";o.appendChild(a.createComment(""));d=1',e.idGetsName=a.getElementById("slick_uniqueid")===o.firstChild}catch(z){}if(o.getElementsByClassName){try{o.innerHTML='',o.getElementsByClassName("b").length,o.firstChild.className="b",i=2!=o.getElementsByClassName("b").length}catch(C){}try{o.innerHTML='', h=2!=o.getElementsByClassName("a").length}catch(F){}e.brokenGEBCN=i||h}if(o.querySelectorAll){try{o.innerHTML="foo",l=o.querySelectorAll("*"),e.starSelectsClosedQSA=l&&!!l.length&&"/"==l[0].nodeName.charAt(0)}catch(E){}try{o.innerHTML='',e.brokenMixedCaseQSA=!o.querySelectorAll(".MiX").length}catch(w){}try{o.innerHTML='',e.brokenCheckedQSA=0==o.querySelectorAll(":checked").length}catch(B){}try{o.innerHTML='', e.brokenEmptyAttributeQSA=0!=o.querySelectorAll('[class*=""]').length}catch(D){}}try{o.innerHTML='
',j="s"!=o.firstChild.getAttribute("action")}catch(G){}e.nativeMatchesSelector=c.matchesSelector||c.mozMatchesSelector||c.webkitMatchesSelector;if(e.nativeMatchesSelector)try{e.nativeMatchesSelector.call(c,":slick"),e.nativeMatchesSelector=null}catch(H){}}try{c.slick_expando=1,delete c.slick_expando,e.getUID=this.getUIDHTML}catch(I){e.getUID=this.getUIDXML}y.removeChild(o); o=l=y=null;e.getAttribute=e.isHTMLDocument&&j?function(a,b){var c=this.attributeGetters[b];return c?c.call(a):(c=a.getAttributeNode(b))?c.nodeValue:null}:function(a,b){var c=this.attributeGetters[b];return c?c.call(a):a.getAttribute(b)};e.hasAttribute=c&&this.isNativeCode(c.hasAttribute)?function(a,b){return a.hasAttribute(b)}:function(a,b){a=a.getAttributeNode(b);return!(!a||!a.specified&&!a.nodeValue)};g=c&&this.isNativeCode(c.contains);h=a&&this.isNativeCode(a.contains);e.contains=g&&h?function(a, b){return a.contains(b)}:g&&!h?function(b,c){return b===c||(b===a?a.documentElement:b).contains(c)}:c&&c.compareDocumentPosition?function(a,b){return a===b||!!(a.compareDocumentPosition(b)&16)}:function(a,b){if(b){do if(b===a)return!0;while(b=b.parentNode)}return!1};e.documentSorter=c.compareDocumentPosition?function(a,b){return!a.compareDocumentPosition||!b.compareDocumentPosition?0:a.compareDocumentPosition(b)&4?-1:a===b?0:1}:"sourceIndex"in c?function(a,b){return!a.sourceIndex||!b.sourceIndex? 0:a.sourceIndex-b.sourceIndex}:a.createRange?function(a,b){if(!a.ownerDocument||!b.ownerDocument)return 0;var c=a.ownerDocument.createRange(),d=b.ownerDocument.createRange();c.setStart(a,0);c.setEnd(a,0);d.setStart(b,0);d.setEnd(b,0);return c.compareBoundaryPoints(Range.START_TO_END,d)}:null;c=null}for(f in e)this[f]=e[f]}};var d=/^([#.]?)((?:[\w-]+|\*))$/,e=/\[.+[*$^]=(?:""|'')?\]/,f={};a.search=function(a,b,c,g){var h=this.found=g?null:c||[];if(a)if(a.navigator)a=a.document;else{if(!a.nodeType)return h}else return h; var i,q,t=this.uniques={},c=!(!c||!c.length),v=9==a.nodeType;this.document!==(v?a:a.ownerDocument)&&this.setDocument(a);if(c)for(q=h.length;q--;)t[this.getUID(h[q])]=!0;if("string"==typeof b){var l=b.match(d);a:if(l){q=l[1];var o=l[2];if(q)if("#"==q){if(!this.isHTMLDocument||!v)break a;l=a.getElementById(o);if(!l)return h;if(this.idGetsName&&l.getAttributeNode("id").nodeValue!=o)break a;if(g)return l||null;(!c||!t[this.getUID(l)])&&h.push(l)}else{if("."==q){if(!this.isHTMLDocument||(!a.getElementsByClassName|| this.brokenGEBCN)&&a.querySelectorAll)break a;if(a.getElementsByClassName&&!this.brokenGEBCN){i=a.getElementsByClassName(o);if(g)return i[0]||null;for(q=0;l=i[q++];)(!c||!t[this.getUID(l)])&&h.push(l)}else{var y=RegExp("(^|\\s)"+j.escapeRegExp(o)+"(\\s|$)");i=a.getElementsByTagName("*");for(q=0;l=i[q++];)if((className=l.className)&&y.test(className)){if(g)return l;(!c||!t[this.getUID(l)])&&h.push(l)}}}}else{if("*"==o&&this.brokenStarGEBTN)break a;i=a.getElementsByTagName(o);if(g)return i[0]||null; for(q=0;l=i[q++];)(!c||!t[this.getUID(l)])&&h.push(l)}c&&this.sort(h);return g?null:h}a:if(a.querySelectorAll&&this.isHTMLDocument&&!f[b]&&!this.brokenMixedCaseQSA&&!(this.brokenCheckedQSA&&-1g)return!1}else if(g!=b)return!1}if(c&&a.getAttribute("id")!=c)return!1;if(d)for(b=d.length;b--;)if(c=this.getAttribute(a,"class"),!c||!d[b].regexp.test(c))return!1;if(e)for(b=e.length;b--;)if(d=e[b],d.operator?!d.test(this.getAttribute(a, d.key)):!this.hasAttribute(a,d.key))return!1;if(f)for(b=f.length;b--;)if(d=f[b],!this.matchPseudo(a,d.key,d.value))return!1;return!0};var g={" ":function(a,b,c,d,e,f,g){var h;if(this.isHTMLDocument){if(c){h=this.document.getElementById(c);if(!h&&a.all||this.idGetsName&&h&&h.getAttributeNode("id").nodeValue!=c){g=a.all[c];if(!g)return;g[0]||(g=[g]);for(a=0;h=g[a++];){var i=h.getAttributeNode("id");if(i&&i.nodeValue==c){this.push(h,b,null,d,e,f);break}}return}if(h){if(this.document!==a&&!this.contains(a, h))return;this.push(h,b,null,d,e,f);return}if(this.contains(this.root,a))return}if(d&&a.getElementsByClassName&&!this.brokenGEBCN&&(g=a.getElementsByClassName(g.join(" ")))&&g.length){for(a=0;h=g[a++];)this.push(h,b,c,null,e,f);return}}if((g=a.getElementsByTagName(b))&&g.length){this.brokenStarGEBTN||(b=null);for(a=0;h=g[a++];)this.push(h,b,c,d,e,f)}},">":function(a,b,c,d,e,f){if(a=a.firstChild){do 1==a.nodeType&&this.push(a,b,c,d,e,f);while(a=a.nextSibling)}},"+":function(a,b,c,d,e,f){for(;a=a.nextSibling;)if(1== a.nodeType){this.push(a,b,c,d,e,f);break}},"^":function(a,b,c,d,e,f){if(a=a.firstChild)if(1==a.nodeType)this.push(a,b,c,d,e,f);else this["combinator:+"](a,b,c,d,e,f)},"~":function(a,b,c,d,e,f){for(;a=a.nextSibling;)if(1==a.nodeType){var g=this.getUID(a);if(this.bitUniques[g])break;this.bitUniques[g]=!0;this.push(a,b,c,d,e,f)}},"++":function(a,b,c,d,e,f){this["combinator:+"](a,b,c,d,e,f);this["combinator:!+"](a,b,c,d,e,f)},"~~":function(a,b,c,d,e,f){this["combinator:~"](a,b,c,d,e,f);this["combinator:!~"](a, b,c,d,e,f)},"!":function(a,b,c,d,e,f){for(;a=a.parentNode;)a!==this.document&&this.push(a,b,c,d,e,f)},"!>":function(a,b,c,d,e,f){a=a.parentNode;a!==this.document&&this.push(a,b,c,d,e,f)},"!+":function(a,b,c,d,e,f){for(;a=a.previousSibling;)if(1==a.nodeType){this.push(a,b,c,d,e,f);break}},"!^":function(a,b,c,d,e,f){if(a=a.lastChild)if(1==a.nodeType)this.push(a,b,c,d,e,f);else this["combinator:!+"](a,b,c,d,e,f)},"!~":function(a,b,c,d,e,f){for(;a=a.previousSibling;)if(1==a.nodeType){var g=this.getUID(a); if(this.bitUniques[g])break;this.bitUniques[g]=!0;this.push(a,b,c,d,e,f)}}},h;for(h in g)a["combinator:"+h]=g[h];var g={empty:function(a){var b=a.firstChild;return!(b&&1==b.nodeType)&&!(a.innerText||a.textContent||"").length},not:function(a,b){return!this.matchNode(a,b)},contains:function(a,b){return-1<(a.innerText||a.textContent||"").indexOf(b)},"first-child":function(a){for(;a=a.previousSibling;)if(1==a.nodeType)return!1;return!0},"last-child":function(a){for(;a=a.nextSibling;)if(1==a.nodeType)return!1; return!0},"only-child":function(a){for(var b=a;b=b.previousSibling;)if(1==b.nodeType)return!1;for(;a=a.nextSibling;)if(1==a.nodeType)return!1;return!0},"nth-child":a.createNTHPseudo("firstChild","nextSibling","posNTH"),"nth-last-child":a.createNTHPseudo("lastChild","previousSibling","posNTHLast"),"nth-of-type":a.createNTHPseudo("firstChild","nextSibling","posNTHType",!0),"nth-last-of-type":a.createNTHPseudo("lastChild","previousSibling","posNTHTypeLast",!0),index:function(a,b){return this["pseudo:nth-child"](a, ""+(b+1))},even:function(a){return this["pseudo:nth-child"](a,"2n")},odd:function(a){return this["pseudo:nth-child"](a,"2n+1")},"first-of-type":function(a){for(var b=a.nodeName;a=a.previousSibling;)if(a.nodeName==b)return!1;return!0},"last-of-type":function(a){for(var b=a.nodeName;a=a.nextSibling;)if(a.nodeName==b)return!1;return!0},"only-of-type":function(a){for(var b=a,c=a.nodeName;b=b.previousSibling;)if(b.nodeName==c)return!1;for(;a=a.nextSibling;)if(a.nodeName==c)return!1;return!0},enabled:function(a){return!a.disabled}, disabled:function(a){return a.disabled},checked:function(a){return a.checked||a.selected},focus:function(a){return this.isHTMLDocument&&this.document.activeElement===a&&(a.href||a.type||this.hasAttribute(a,"tabindex"))},root:function(a){return a===this.root},selected:function(a){return a.selected}},i;for(i in g)a["pseudo:"+i]=g[i];i=a.attributeGetters={"for":function(){return"htmlFor"in this?this.htmlFor:this.getAttribute("for")},href:function(){return"href"in this?this.getAttribute("href",2):this.getAttribute("href")}, style:function(){return this.style?this.style.cssText:this.getAttribute("style")},tabindex:function(){var a=this.getAttributeNode("tabindex");return a&&a.specified?a.nodeValue:null},type:function(){return this.getAttribute("type")},maxlength:function(){var a=this.getAttributeNode("maxLength");return a&&a.specified?a.nodeValue:null}};i.MAXLENGTH=i.maxLength=i.maxlength;var j=a.Slick=this.Slick||{};j.version="1.1.7";j.search=function(b,c,d){return a.search(b,c,d)};j.find=function(b,c){return a.search(b, c,null,!0)};j.contains=function(b,c){a.setDocument(b);return a.contains(b,c)};j.getAttribute=function(b,c){a.setDocument(b);return a.getAttribute(b,c)};j.hasAttribute=function(b,c){a.setDocument(b);return a.hasAttribute(b,c)};j.match=function(b,c){if(!b||!c)return!1;if(!c||c===b)return!0;a.setDocument(b);return a.matchNode(b,c)};j.defineAttributeGetter=function(b,c){a.attributeGetters[b]=c;return this};j.lookupAttributeGetter=function(b){return a.attributeGetters[b]};j.definePseudo=function(b,c){a["pseudo:"+ b]=function(a,b){return c.call(a,b)};return this};j.lookupPseudo=function(b){var c=a["pseudo:"+b];return c?function(a){return c.call(this,a)}:null};j.override=function(b,c){a.override(b,c);return this};j.isXML=a.isXML;j.uidOf=function(b){return a.getUIDHTML(b)};this.Slick||(this.Slick=j)}).apply("undefined"!=typeof exports?exports:this); var Element=function(a,b){var c=Element.Constructors[a];if(c)return c(b);if("string"!=typeof a)return document.id(a).set(b);b||(b={});if(!/^[\w-]+$/.test(a)){c=Slick.parse(a).expressions[0][0];a="*"==c.tag?"div":c.tag;c.id&&null==b.id&&(b.id=c.id);var d=c.attributes;if(d)for(var e,f=0,g=d.length;f=this.length;)delete this[b--];return c}.protect());Array.forEachMethod(function(a,b){Elements.implement(b,a)});Array.mirror(Elements);var c;try{c=document.createElement("").name=="x"}catch(d){}var e=function(a){return(""+a).replace(/&/g,"&").replace(/"/g,""")};Document.implement({newElement:function(a, b){if(b&&b.checked!=null)b.defaultChecked=b.checked;if(c&&b){a="<"+a;b.name&&(a=a+(' name="'+e(b.name)+'"'));b.type&&(a=a+(' type="'+e(b.type)+'"'));a=a+">";delete b.name;delete b.type}return this.id(this.createElement(a)).set(b)}})})(); (function(){Slick.uidOf(window);Slick.uidOf(document);Document.implement({newTextNode:function(a){return this.createTextNode(a)},getDocument:function(){return this},getWindow:function(){return this.window},id:function(){var a={string:function(b,c,d){return(b=Slick.find(d,"#"+b.replace(/(\W)/g,"\\$1")))?a.element(b,c):null},element:function(a,b){Slick.uidOf(a);if(!b&&!a.$family&&!/^(?:object|embed)$/i.test(a.tagName)){var c=a.fireEvent;a._fireEvent=function(a,b){return c(a,b)};Object.append(a,Element.Prototype)}return a}, object:function(b,c,d){return b.toElement?a.element(b.toElement(d),c):null}};a.textnode=a.whitespace=a.window=a.document=function(a){return a};return function(b,c,d){if(b&&b.$family&&b.uniqueNumber)return b;var e=typeOf(b);return a[e]?a[e](b,c,d||document):null}}()});window.$==null&&Window.implement("$",function(a,b){return document.id(a,b,this.document)});Window.implement({getDocument:function(){return this.document},getWindow:function(){return this}});[Document,Element].invoke("implement",{getElements:function(a){return Slick.search(this, a,new Elements)},getElement:function(a){return document.id(Slick.find(this,a))}});var a={contains:function(a){return Slick.contains(this,a)}};document.contains||Document.implement(a);document.createElement("div").contains||Element.implement(a);var b=function(a,b){if(!a)return b;for(var a=Object.clone(Slick.parse(a)),c=a.expressions,d=c.length;d--;)c[d][0].combinator=b;return a};Object.forEach({getNext:"~",getPrevious:"!~",getParent:"!"},function(a,c){Element.implement(c,function(c){return this.getElement(b(c, a))})});Object.forEach({getAllNext:"~",getAllPrevious:"!~",getSiblings:"~~",getChildren:">",getParents:"!"},function(a,c){Element.implement(c,function(c){return this.getElements(b(c,a))})});Element.implement({getFirst:function(a){return document.id(Slick.search(this,b(a,">"))[0])},getLast:function(a){return document.id(Slick.search(this,b(a,">")).getLast())},getWindow:function(){return this.ownerDocument.window},getDocument:function(){return this.ownerDocument},getElementById:function(a){return document.id(Slick.find(this, "#"+(""+a).replace(/(\W)/g,"\\$1")))},match:function(a){return!a||Slick.match(this,a)}});window.$$==null&&Window.implement("$$",function(a){if(arguments.length==1){if(typeof a=="string")return Slick.search(this.document,a,new Elements);if(Type.isEnumerable(a))return new Elements(a)}return new Elements(arguments)});var c={before:function(a,b){var c=b.parentNode;c&&c.insertBefore(a,b)},after:function(a,b){var c=b.parentNode;c&&c.insertBefore(a,b.nextSibling)},bottom:function(a,b){b.appendChild(a)}, top:function(a,b){b.insertBefore(a,b.firstChild)}};c.inside=c.bottom;var d={},e={},f={};Array.forEach(["type","value","defaultValue","accessKey","cellPadding","cellSpacing","colSpan","frameBorder","rowSpan","tabIndex","useMap"],function(a){f[a.toLowerCase()]=a});f.html="innerHTML";f.text=document.createElement("div").textContent==null?"innerText":"textContent";Object.forEach(f,function(a,b){e[b]=function(b,c){b[a]=c};d[b]=function(b){return b[a]}});Array.forEach(["compact","nowrap","ismap","declare", "noshade","checked","disabled","readOnly","multiple","selected","noresize","defer","defaultChecked","autofocus","controls","autoplay","loop"],function(a){var b=a.toLowerCase();e[b]=function(b,c){b[a]=!!c};d[b]=function(b){return!!b[a]}});Object.append(e,{"class":function(a,b){"className"in a?a.className=b||"":a.setAttribute("class",b)},"for":function(a,b){"htmlFor"in a?a.htmlFor=b:a.setAttribute("for",b)},style:function(a,b){a.style?a.style.cssText=b:a.setAttribute("style",b)},value:function(a,b){a.value= b!=null?b:""}});d["class"]=function(a){return"className"in a?a.className||null:a.getAttribute("class")};a=document.createElement("button");try{a.type="button"}catch(g){}if(a.type!="button")e.type=function(a,b){a.setAttribute("type",b)};a=null;a=document.createElement("input");a.value="t";a.type="submit";if(a.value!="t")e.type=function(a,b){var c=a.value;a.type=b;a.value=c};var a=null,h,a=document.createElement("div");a.random="attribute";h=a.getAttribute("random")=="attribute";Element.implement({setProperty:function(a, b){var c=e[a.toLowerCase()];if(c)c(this,b);else{if(h)var d=this.retrieve("$attributeWhiteList",{});if(b==null){this.removeAttribute(a);h&&delete d[a]}else{this.setAttribute(a,""+b);h&&(d[a]=true)}}return this},setProperties:function(a){for(var b in a)this.setProperty(b,a[b]);return this},getProperty:function(a){var b=d[a.toLowerCase()];if(b)return b(this);if(h){var c=this.getAttributeNode(a),b=this.retrieve("$attributeWhiteList",{});if(!c)return null;if(c.expando&&!b[a]){c=this.outerHTML;if(c.substr(0, c.search(/\/?['"]?>(?![^<]*<['"])/)).indexOf(a)<0)return null;b[a]=true}}b=Slick.getAttribute(this,a);return!b&&!Slick.hasAttribute(this,a)?null:b},getProperties:function(){var a=Array.from(arguments);return a.map(this.getProperty,this).associate(a)},removeProperty:function(a){return this.setProperty(a,null)},removeProperties:function(){Array.each(arguments,this.removeProperty,this);return this},set:function(a,b){var c=Element.Properties[a];c&&c.set?c.set.call(this,b):this.setProperty(a,b)}.overloadSetter(), get:function(a){var b=Element.Properties[a];return b&&b.get?b.get.apply(this):this.getProperty(a)}.overloadGetter(),erase:function(a){var b=Element.Properties[a];b&&b.erase?b.erase.apply(this):this.removeProperty(a);return this},hasClass:function(a){return this.className.clean().contains(a," ")},addClass:function(a){if(!this.hasClass(a))this.className=(this.className+" "+a).clean();return this},removeClass:function(a){this.className=this.className.replace(RegExp("(^|\\s)"+a+"(?:\\s|$)"),"$1");return this}, toggleClass:function(a,b){b==null&&(b=!this.hasClass(a));return b?this.addClass(a):this.removeClass(a)},adopt:function(){var a=this,b,c=Array.flatten(arguments),d=c.length;d>1&&(a=b=document.createDocumentFragment());for(var e=0;e";var p=a.childNodes.length==1;if(!p)for(var a=["abbr","article","aside","audio","canvas","datalist","details","figcaption","figure","footer","header","hgroup","mark","meter","nav","output","progress","section","summary","time","video"],r=document.createDocumentFragment(),s=a.length;s--;)r.createElement(a[s]);a=null;a=Function.attempt(function(){document.createElement("table").innerHTML= "";return true});s=document.createElement("tr");s.innerHTML="";var q=s.innerHTML=="",s=null;if(!a||!q||!p){var a=Element.Properties.html,t=Element.Properties.html.set,v={table:[1,"","
"],select:[1,""],tbody:[2,"","
"],tr:[3,"","
"]};v.thead=v.tfoot=v.tbody;a.set=function(a){var b=v[this.get("tag")];!b&&!p&&(b=[0,"",""]);if(!b)return t.call(this,a);var c=b[0],d=document.createElement("div"), e=d;p||r.appendChild(d);for(d.innerHTML=[b[1],a,b[2]].flatten().join("");c--;)e=e.firstChild;this.empty().adopt(e.childNodes);p||r.removeChild(d)}}a=document.createElement("form");a.innerHTML="";if(a.firstChild.value!="s")Element.Properties.value={set:function(a){if(this.get("tag")!="select")return this.setProperty("value",a);for(var b=this.getElements("option"),c=0;c0||b==null?"visible":"hidden"},g=b?function(a,b){a.style.opacity=b}:d?function(a,b){var c=a.style;if(!a.currentStyle||!a.currentStyle.hasLayout)c.zoom=1;var b=b== null||b==1?"":"alpha(opacity="+(b*100).limit(0,100).round()+")",d=c.filter||a.getComputedStyle("filter")||"";c.filter=e.test(d)?d.replace(e,b):d+b;c.filter||c.removeAttribute("filter")}:f,h=b?function(a){a=a.style.opacity||a.getComputedStyle("opacity");return a==""?1:a.toFloat()}:d?function(a){var a=a.style.filter||a.getComputedStyle("filter"),b;a&&(b=a.match(e));return b==null||a==null?1:b[1]/100}:function(a){var b=a.retrieve("$opacity");b==null&&(b=a.style.visibility=="hidden"?0:1);return b},i= a.style.cssFloat==null?"styleFloat":"cssFloat";Element.implement({getComputedStyle:function(a){if(this.currentStyle)return this.currentStyle[a.camelCase()];var b=Element.getDocument(this).defaultView;return(b=b?b.getComputedStyle(this,null):null)?b.getPropertyValue(a==i?"float":a.hyphenate()):null},setStyle:function(a,b){if(a=="opacity"){b!=null&&(b=parseFloat(b));g(this,b);return this}a=(a=="float"?i:a).camelCase();if(typeOf(b)!="string")var d=(Element.Styles[a]||"@").split(" "),b=Array.from(b).map(function(a, b){return!d[b]?"":typeOf(a)=="number"?d[b].replace("@",Math.round(a)):a}).join(" ");else b==String(Number(b))&&(b=Math.round(b));this.style[a]=b;(b==""||b==null)&&(c&&this.style.removeAttribute)&&this.style.removeAttribute(a);return this},getStyle:function(a){if(a=="opacity")return h(this);var a=(a=="float"?i:a).camelCase(),b=this.style[a];if(!b||a=="zIndex"){var b=[],c;for(c in Element.ShortStyles)if(a==c){for(var d in Element.ShortStyles[c])b.push(this.getStyle(d));return b.join(" ")}b=this.getComputedStyle(a)}if(b){b= String(b);(c=b.match(/rgba?\([\d\s,]+\)/))&&(b=b.replace(c[0],c[0].rgbToHex()))}if(Browser.opera||Browser.ie){if(/^(height|width)$/.test(a)&&!/px$/.test(b)){var e=0;(a=="width"?["left","right"]:["top","bottom"]).each(function(a){e=e+(this.getStyle("border-"+a+"-width").toInt()+this.getStyle("padding-"+a).toInt())},this);return this["offset"+a.capitalize()]-e+"px"}if(Browser.ie&&/^border(.+)Width|margin|padding/.test(a)&&isNaN(parseFloat(b)))return"0px"}return b},setStyles:function(a){for(var b in a)this.setStyle(b, a[b]);return this},getStyles:function(){var a={};Array.flatten(arguments).each(function(b){a[b]=this.getStyle(b)},this);return a}});Element.Styles={left:"@px",top:"@px",bottom:"@px",right:"@px",width:"@px",height:"@px",maxWidth:"@px",maxHeight:"@px",minWidth:"@px",minHeight:"@px",backgroundColor:"rgb(@, @, @)",backgroundPosition:"@px @px",color:"rgb(@, @, @)",fontSize:"@px",letterSpacing:"@px",lineHeight:"@px",clip:"rect(@px @px @px @px)",margin:"@px @px @px @px",padding:"@px @px @px @px",border:"@px @ rgb(@, @, @) @px @ rgb(@, @, @) @px @ rgb(@, @, @)", borderWidth:"@px @px @px @px",borderStyle:"@ @ @ @",borderColor:"rgb(@, @, @) rgb(@, @, @) rgb(@, @, @) rgb(@, @, @)",zIndex:"@",zoom:"@",fontWeight:"@",textIndent:"@px",opacity:"@"};Element.ShortStyles={margin:{},padding:{},border:{},borderWidth:{},borderStyle:{},borderColor:{}};["Top","Right","Bottom","Left"].each(function(a){var b=Element.ShortStyles,c=Element.Styles;["margin","padding"].each(function(d){var e=d+a;b[d][e]=c[e]="@px"});var d="border"+a;b.border[d]=c[d]="@px @ rgb(@, @, @)";var e= d+"Width",f=d+"Style",g=d+"Color";b[d]={};b.borderWidth[e]=b[d][e]=c[e]="@px";b.borderStyle[f]=b[d][f]=c[f]="@";b.borderColor[g]=b[d][g]=c[g]="rgb(@, @, @)"})})(); (function(){Element.Properties.events={set:function(a){this.addEvents(a)}};[Element,Window,Document].invoke("implement",{addEvent:function(a,c,d){var e=this.retrieve("events",{});e[a]||(e[a]={keys:[],values:[]});if(e[a].keys.contains(c))return this;e[a].keys.push(c);var f=a,g=Element.Events[a],h=c,i=this;if(g){g.onAdd&&g.onAdd.call(this,c,a);g.condition&&(h=function(d){return g.condition.call(this,d,a)?c.call(this,d):true});g.base&&(f=Function.from(g.base).call(this,a))}var j=function(){return c.call(i)}, k=Element.NativeEvents[f];if(k){k==2&&(j=function(a){a=new DOMEvent(a,i.getWindow());h.call(i,a)===false&&a.stop()});this.addListener(f,j,d)}e[a].values.push(j);return this},removeEvent:function(a,c,d){var e=this.retrieve("events");if(!e||!e[a])return this;var f=e[a],g=f.keys.indexOf(c);if(g==-1)return this;e=f.values[g];delete f.keys[g];delete f.values[g];if(f=Element.Events[a]){f.onRemove&&f.onRemove.call(this,c,a);f.base&&(a=Function.from(f.base).call(this,a))}return Element.NativeEvents[a]?this.removeListener(a, e,d):this},addEvents:function(a){for(var c in a)this.addEvent(c,a[c]);return this},removeEvents:function(a){var c;if(typeOf(a)=="object"){for(c in a)this.removeEvent(c,a[c]);return this}var d=this.retrieve("events");if(!d)return this;if(a){if(d[a]){d[a].keys.each(function(c){this.removeEvent(a,c)},this);delete d[a]}}else{for(c in d)this.removeEvents(c);this.eliminate("events")}return this},fireEvent:function(a,c,d){var e=this.retrieve("events");if(!e||!e[a])return this;c=Array.from(c);e[a].keys.each(function(a){d? a.delay(d,this,c):a.apply(this,c)},this);return this},cloneEvents:function(a,c){var a=document.id(a),d=a.retrieve("events");if(!d)return this;if(c)d[c]&&d[c].keys.each(function(a){this.addEvent(c,a)},this);else for(var e in d)this.cloneEvents(a,e);return this}});Element.NativeEvents={click:2,dblclick:2,mouseup:2,mousedown:2,contextmenu:2,mousewheel:2,DOMMouseScroll:2,mouseover:2,mouseout:2,mousemove:2,selectstart:2,selectend:2,keydown:2,keypress:2,keyup:2,orientationchange:2,touchstart:2,touchmove:2, touchend:2,touchcancel:2,gesturestart:2,gesturechange:2,gestureend:2,focus:2,blur:2,change:2,reset:2,select:2,submit:2,paste:2,input:2,load:2,unload:1,beforeunload:2,resize:1,move:1,DOMContentLoaded:1,readystatechange:1,error:1,abort:1,scroll:1};Element.Events={mousewheel:{base:Browser.firefox?"DOMMouseScroll":"mousewheel"}};if("onmouseenter"in document.documentElement)Element.NativeEvents.mouseenter=Element.NativeEvents.mouseleave=2;else{var a=function(a){a=a.relatedTarget;return a==null?true:!a? false:a!=this&&a.prefix!="xul"&&typeOf(this)!="document"&&!this.contains(a)};Element.Events.mouseenter={base:"mouseover",condition:a};Element.Events.mouseleave={base:"mouseout",condition:a}}if(!window.addEventListener){Element.NativeEvents.propertychange=2;Element.Events.change={base:function(){var a=this.type;return this.get("tag")=="input"&&(a=="radio"||a=="checkbox")?"propertychange":"change"},condition:function(a){return this.type!="radio"||a.event.propertyName=="checked"&&this.checked}}}})(); (function(){var a=!!window.addEventListener;Element.NativeEvents.focusin=Element.NativeEvents.focusout=2;var b=function(a,b,c,d,e){for(;e&&e!=a;){if(b(e,d))return c.call(e,d,e);e=document.id(e.parentNode)}},c={mouseenter:{base:"mouseover"},mouseleave:{base:"mouseout"},focus:{base:"focus"+(a?"":"in"),capture:true},blur:{base:a?"blur":"focusout",capture:true}},d=function(a){return{base:"focusin",remove:function(b,c){var d=b.retrieve("$delegation:"+a+"listeners",{})[c];if(d&&d.forms)for(var e=d.forms.length;e--;)d.forms[e].removeEvent(a, d.fns[e])},listen:function(c,d,e,f,g,h){if(f=g.get("tag")=="form"?g:f.target.getParent("form")){var s=c.retrieve("$delegation:"+a+"listeners",{}),q=s[h]||{forms:[],fns:[]},t=q.forms,v=q.fns;if(t.indexOf(f)==-1){t.push(f);t=function(a){b(c,d,e,a,g)};f.addEvent(a,t);v.push(t);s[h]=q;c.store("$delegation:"+a+"listeners",s)}}}}},e=function(a){return{base:"focusin",listen:function(c,d,e,f,g){var h={blur:function(){this.removeEvents(h)}};h[a]=function(a){b(c,d,e,a,g)};f.target.addEvents(h)}}};a||Object.append(c, {submit:d("submit"),reset:d("reset"),change:e("change"),select:e("select")});var a=Element.prototype,f=a.addEvent,g=a.removeEvent,a=function(a,b){return function(c,d,e){if(c.indexOf(":relay")==-1)return a.call(this,c,d,e);var f=Slick.parse(c).expressions[0][0];if(f.pseudos[0].key!="relay")return a.call(this,c,d,e);var g=f.tag;f.pseudos.slice(1).each(function(a){g=g+(":"+a.key+(a.value?"("+a.value+")":""))});a.call(this,c,d);return b.call(this,g,f.pseudos[0].value,d)}},h={addEvent:function(a,d,e){var g= this.retrieve("$delegates",{}),h=g[a];if(h)for(var p in h)if(h[p].fn==e&&h[p].match==d)return this;p=a;var r=d,s=c[a]||{},a=s.base||p,d=function(a){return Slick.match(a,r)},q=Element.Events[p];if(q&&q.condition)var t=d,v=q.condition,d=function(b,c){return t(b,c)&&v.call(b,c,a)};var l=this,o=String.uniqueID(),q=s.listen?function(a,b){if(!b&&a&&a.target)b=a.target;b&&s.listen(l,d,e,a,b,o)}:function(a,c){if(!c&&a&&a.target)c=a.target;c&&b(l,d,e,a,c)};h||(h={});h[o]={match:r,fn:e,delegator:q};g[p]=h; return f.call(this,a,q,s.capture)},removeEvent:function(a,b,d,e){var f=this.retrieve("$delegates",{}),p=f[a];if(!p)return this;if(e){var b=a,d=p[e].delegator,r=c[a]||{},a=r.base||b;r.remove&&r.remove(this,e);delete p[e];f[b]=p;return g.call(this,a,d)}if(d)for(r in p){e=p[r];if(e.match==b&&e.fn==d)return h.removeEvent.call(this,a,b,d,r)}else for(r in p){e=p[r];e.match==b&&h.removeEvent.call(this,a,b,e.fn,r)}return this}};[Element,Window,Document].invoke("implement",{addEvent:a(f,h.addEvent),removeEvent:a(g, h.removeEvent)})})(); (function(){function a(a){return k(a,"-moz-box-sizing")=="border-box"}function b(a){return k(a,"border-top-width").toInt()||0}function c(a){return k(a,"border-left-width").toInt()||0}function d(a){return/^(?:body|html)$/i.test(a.tagName)}function e(a){a=a.getDocument();return!a.compatMode||a.compatMode=="CSS1Compat"?a.html:a.body}var f=document.createElement("div"),g=document.createElement("div");f.style.height="0";f.appendChild(g);var h=g.offsetParent===f,f=g=null,i=function(a){return k(a,"position")!= "static"||d(a)},j=function(a){return i(a)||/^(?:table|td|th)$/i.test(a.tagName)};Element.implement({scrollTo:function(a,b){if(d(this))this.getWindow().scrollTo(a,b);else{this.scrollLeft=a;this.scrollTop=b}return this},getSize:function(){return d(this)?this.getWindow().getSize():{x:this.offsetWidth,y:this.offsetHeight}},getScrollSize:function(){return d(this)?this.getWindow().getScrollSize():{x:this.scrollWidth,y:this.scrollHeight}},getScroll:function(){return d(this)?this.getWindow().getScroll(): {x:this.scrollLeft,y:this.scrollTop}},getScrolls:function(){for(var a=this.parentNode,b={x:0,y:0};a&&!d(a);){b.x=b.x+a.scrollLeft;b.y=b.y+a.scrollTop;a=a.parentNode}return b},getOffsetParent:h?function(){var a=this;if(d(a)||k(a,"position")=="fixed")return null;for(var b=k(a,"position")=="static"?j:i;a=a.parentNode;)if(b(a))return a;return null}:function(){if(d(this)||k(this,"position")=="fixed")return null;try{return this.offsetParent}catch(a){}return null},getOffsets:function(){if(this.getBoundingClientRect&& !Browser.Platform.ios){var e=this.getBoundingClientRect(),f=document.id(this.getDocument().documentElement),g=f.getScroll(),h=this.getScrolls(),i=k(this,"position")=="fixed";return{x:e.left.toInt()+h.x+(i?0:g.x)-f.clientLeft,y:e.top.toInt()+h.y+(i?0:g.y)-f.clientTop}}e=this;f={x:0,y:0};if(d(this))return f;for(;e&&!d(e);){f.x=f.x+e.offsetLeft;f.y=f.y+e.offsetTop;if(Browser.firefox){if(!a(e)){f.x=f.x+c(e);f.y=f.y+b(e)}if((g=e.parentNode)&&k(g,"overflow")!="visible"){f.x=f.x+c(g);f.y=f.y+b(g)}}else if(e!= this&&Browser.safari){f.x=f.x+c(e);f.y=f.y+b(e)}e=e.offsetParent}if(Browser.firefox&&!a(this)){f.x=f.x-c(this);f.y=f.y-b(this)}return f},getPosition:function(a){var d=this.getOffsets(),e=this.getScrolls(),d={x:d.x-e.x,y:d.y-e.y};if(a&&(a=document.id(a))){e=a.getPosition();return{x:d.x-e.x-c(a),y:d.y-e.y-b(a)}}return d},getCoordinates:function(a){if(d(this))return this.getWindow().getCoordinates();var a=this.getPosition(a),b=this.getSize(),a={left:a.x,top:a.y,width:b.x,height:b.y};a.right=a.left+a.width; a.bottom=a.top+a.height;return a},computePosition:function(a){return{left:a.x-(k(this,"margin-left").toInt()||0),top:a.y-(k(this,"margin-top").toInt()||0)}},setPosition:function(a){return this.setStyles(this.computePosition(a))}});[Document,Window].invoke("implement",{getSize:function(){var a=e(this);return{x:a.clientWidth,y:a.clientHeight}},getScroll:function(){var a=this.getWindow(),b=e(this);return{x:a.pageXOffset||b.scrollLeft,y:a.pageYOffset||b.scrollTop}},getScrollSize:function(){var a=e(this), b=this.getSize(),c=this.getDocument().body;return{x:Math.max(a.scrollWidth,c.scrollWidth,b.x),y:Math.max(a.scrollHeight,c.scrollHeight,b.y)}},getPosition:function(){return{x:0,y:0}},getCoordinates:function(){var a=this.getSize();return{top:0,left:0,bottom:a.y,right:a.x,height:a.y,width:a.x}}});var k=Element.getComputedStyle})();Element.alias({position:"setPosition"}); [Window,Document,Element].invoke("implement",{getHeight:function(){return this.getSize().y},getWidth:function(){return this.getSize().x},getScrollTop:function(){return this.getScroll().y},getScrollLeft:function(){return this.getScroll().x},getScrollHeight:function(){return this.getScrollSize().y},getScrollWidth:function(){return this.getScrollSize().x},getTop:function(){return this.getPosition().y},getLeft:function(){return this.getPosition().x}}); (function(){var a=this.Fx=new Class({Implements:[Chain,Events,Options],options:{fps:60,unit:false,duration:500,frames:null,frameSkip:true,link:"ignore"},initialize:function(a){this.subject=this.subject||this;this.setOptions(a)},getTransition:function(){return function(a){return-(Math.cos(Math.PI*a)-1)/2}},step:function(a){if(this.options.frameSkip){var b=(this.time!=null?a-this.time:0)/this.frameInterval;this.time=a;this.frame=this.frame+b}else this.frame++;if(this.frame=(7-4*c)/11){b=d*d-Math.pow((11-6*c-11*a)/4,2);break}return b},Elastic:function(a,b){return Math.pow(2,10*--a)*Math.cos(20*a*Math.PI*(b&&b[0]||1)/3)}}); ["Quad","Cubic","Quart","Quint"].each(function(a,b){Fx.Transitions[a]=new Fx.Transition(function(a){return Math.pow(a,b+2)})}); (function(){var a=function(){},b="onprogress"in new Browser.Request,c=this.Request=new Class({Implements:[Chain,Events,Options],options:{url:"",data:"",headers:{"X-Requested-With":"XMLHttpRequest",Accept:"text/javascript, text/html, application/xml, text/xml, */*"},async:true,format:false,method:"post",link:"ignore",isSuccess:null,emulation:true,urlEncoded:true,encoding:"utf-8",evalScripts:false,evalResponse:false,timeout:0,noCache:false},initialize:function(a){this.xhr=new Browser.Request;this.setOptions(a); this.headers=this.options.headers},onStateChange:function(){var c=this.xhr;if(c.readyState==4&&this.running){this.running=false;this.status=0;Function.attempt(function(){var a=c.status;this.status=a==1223?204:a}.bind(this));c.onreadystatechange=a;if(b)c.onprogress=c.onloadstart=a;clearTimeout(this.timer);this.response={text:this.xhr.responseText||"",xml:this.xhr.responseXML};this.options.isSuccess.call(this,this.status)?this.success(this.response.text,this.response.xml):this.failure()}},isSuccess:function(){var a= this.status;return a>=200&&a<300},isRunning:function(){return!!this.running},processScripts:function(a){return this.options.evalResponse||/(ecma|java)script/.test(this.getHeader("Content-type"))?Browser.exec(a):a.stripScripts(this.options.evalScripts)},success:function(a,b){this.onSuccess(this.processScripts(a),b)},onSuccess:function(){this.fireEvent("complete",arguments).fireEvent("success",arguments).callChain()},failure:function(){this.onFailure()},onFailure:function(){this.fireEvent("complete").fireEvent("failure", this.xhr)},loadstart:function(a){this.fireEvent("loadstart",[a,this.xhr])},progress:function(a){this.fireEvent("progress",[a,this.xhr])},timeout:function(){this.fireEvent("timeout",this.xhr)},setHeader:function(a,b){this.headers[a]=b;return this},getHeader:function(a){return Function.attempt(function(){return this.xhr.getResponseHeader(a)}.bind(this))},check:function(){if(!this.running)return true;switch(this.options.link){case "cancel":this.cancel();return true;case "chain":this.chain(this.caller.pass(arguments, this))}return false},send:function(a){if(!this.check(a))return this;this.options.isSuccess=this.options.isSuccess||this.isSuccess;this.running=true;var c=typeOf(a);if(c=="string"||c=="element")a={data:a};var c=this.options,a=Object.append({data:c.data,url:c.url,method:c.method},a),c=a.data,d=String(a.url),a=a.method.toLowerCase();switch(typeOf(c)){case "element":c=document.id(c).toQueryString();break;case "object":case "hash":c=Object.toQueryString(c)}if(this.options.format)var h="format="+this.options.format, c=c?h+"&"+c:h;if(this.options.emulation&&!["get","post"].contains(a)){a="_method="+a;c=c?a+"&"+c:a;a="post"}this.options.urlEncoded&&["post","put"].contains(a)&&(this.headers["Content-type"]="application/x-www-form-urlencoded"+(this.options.encoding?"; charset="+this.options.encoding:""));if(!d)d=document.location.pathname;h=d.lastIndexOf("/");if(h>-1&&(h=d.indexOf("#"))>-1)d=d.substr(0,h);this.options.noCache&&(d=d+((d.contains("?")?"&":"?")+String.uniqueID()));if(c&&a=="get"){d=d+((d.contains("?")? "&":"?")+c);c=null}var i=this.xhr;if(b){i.onloadstart=this.loadstart.bind(this);i.onprogress=this.progress.bind(this)}i.open(a.toUpperCase(),d,this.options.async,this.options.user,this.options.password);if((this.options.user||this.options.withCredentials)&&"withCredentials"in i)i.withCredentials=true;i.onreadystatechange=this.onStateChange.bind(this);Object.each(this.headers,function(a,b){try{i.setRequestHeader(b,a)}catch(c){this.fireEvent("exception",[b,a])}},this);this.fireEvent("request");i.send(c); if(this.options.async){if(this.options.timeout)this.timer=this.timeout.delay(this.options.timeout,this)}else this.onStateChange();return this},cancel:function(){if(!this.running)return this;this.running=false;var c=this.xhr;c.abort();clearTimeout(this.timer);c.onreadystatechange=a;if(b)c.onprogress=c.onloadstart=a;this.xhr=new Browser.Request;this.fireEvent("cancel");return this}}),d={};["get","post","put","delete","GET","POST","PUT","DELETE"].each(function(a){d[a]=function(b){var c={method:a};if(b!= null)c.data=b;return this.send(c)}});c.implement(d);Element.Properties.send={set:function(a){this.get("send").cancel().setOptions(a);return this},get:function(){var a=this.retrieve("send");if(!a){a=new c({data:this,link:"cancel",method:this.get("method")||"post",url:this.get("action")});this.store("send",a)}return a}};Element.implement({send:function(a){var b=this.get("send");b.send({data:this,url:a||b.options.url});return this}})})(); Request.HTML=new Class({Extends:Request,options:{update:!1,append:!1,evalScripts:!0,filter:!1,headers:{Accept:"text/html, application/xml, text/xml, */*"}},success:function(a){var b=this.options,c=this.response;c.html=a.stripScripts(function(a){c.javascript=a});if(a=c.html.match(/]*>([\s\S]*?)<\/body>/i))c.html=a[1];a=(new Element("div")).set("html",c.html);c.tree=a.childNodes;c.elements=a.getElements(b.filter||"*");if(b.filter)c.tree=c.elements;if(b.update){a=document.id(b.update).empty(); b.filter?a.adopt(c.elements):a.set("html",c.html)}else if(b.append){var d=document.id(b.append);b.filter?c.elements.reverse().inject(d):d.adopt(a.getChildren())}b.evalScripts&&Browser.exec(c.javascript);this.onSuccess(c.tree,c.elements,c.html,c.javascript)}});Element.Properties.load={set:function(a){this.get("load").cancel().setOptions(a);return this},get:function(){var a=this.retrieve("load");if(!a){a=new Request.HTML({data:this,link:"cancel",update:this,method:"get"});this.store("load",a)}return a}}; Element.implement({load:function(){this.get("load").send(Array.link(arguments,{data:Type.isObject,url:Type.isString}));return this}});"undefined"==typeof JSON&&(this.JSON={}); (function(){var a={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},b=function(b){return a[b]||"\\u"+("0000"+b.charCodeAt(0).toString(16)).slice(-4)};JSON.validate=function(a){a=a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"");return/^[\],:{}\s]*$/.test(a)};JSON.encode=JSON.stringify?function(a){return JSON.stringify(a)}:function(a){a&&a.toJSON&&(a=a.toJSON()); switch(typeOf(a)){case "string":return'"'+a.replace(/[\x00-\x1f\\"]/g,b)+'"';case "array":return"["+a.map(JSON.encode).clean()+"]";case "object":case "hash":var d=[];Object.each(a,function(a,b){var c=JSON.encode(a);c&&d.push(JSON.encode(b)+":"+c)});return"{"+d+"}";case "number":case "boolean":return""+a;case "null":return"null"}return null};JSON.decode=function(a,b){if(!a||typeOf(a)!="string")return null;if(b||JSON.secure){if(JSON.parse)return JSON.parse(a);if(!JSON.validate(a))throw Error("JSON could not decode the input; security is enabled and the value is not secure."); }return eval("("+a+")")}})();Request.JSON=new Class({Extends:Request,options:{secure:!0},initialize:function(a){this.parent(a);Object.append(this.headers,{Accept:"application/json","X-Request":"JSON"})},success:function(a){var b;try{b=this.response.json=JSON.decode(a,this.options.secure)}catch(c){this.fireEvent("error",[a,c]);return}if(b==null)this.onFailure();else this.onSuccess(b,a)}}); var Cookie=new Class({Implements:Options,options:{path:"/",domain:!1,duration:!1,secure:!1,document:document,encode:!0},initialize:function(a,b){this.key=a;this.setOptions(b)},write:function(a){this.options.encode&&(a=encodeURIComponent(a));this.options.domain&&(a=a+("; domain="+this.options.domain));this.options.path&&(a=a+("; path="+this.options.path));if(this.options.duration){var b=new Date;b.setTime(b.getTime()+this.options.duration*864E5);a=a+("; expires="+b.toGMTString())}this.options.secure&& (a=a+"; secure");this.options.document.cookie=this.key+"="+a;return this},read:function(){var a=this.options.document.cookie.match("(?:^|;)\\s*"+this.key.escapeRegExp()+"=([^;]*)");return a?decodeURIComponent(a[1]):null},dispose:function(){(new Cookie(this.key,Object.merge({},this.options,{duration:-1}))).write("");return this}});Cookie.write=function(a,b,c){return(new Cookie(a,c)).write(b)};Cookie.read=function(a){return(new Cookie(a)).read()};Cookie.dispose=function(a,b){return(new Cookie(a,b)).dispose()}; (function(a,b){var c,d,e=[],f,g,h=b.createElement("div"),i=function(){clearTimeout(g);if(!c){Browser.loaded=c=true;b.removeListener("DOMContentLoaded",i).removeListener("readystatechange",j);b.fireEvent("domready");a.fireEvent("domready")}},j=function(){for(var a=e.length;a--;)if(e[a]()){i();return true}return false},k=function(){clearTimeout(g);j()||(g=setTimeout(k,10))};b.addListener("DOMContentLoaded",i);var m=function(){try{h.doScroll();return true}catch(a){}return false};if(h.doScroll&&!m()){e.push(m); f=true}b.readyState&&e.push(function(){var a=b.readyState;return a=="loaded"||a=="complete"});"onreadystatechange"in b?b.addListener("readystatechange",j):f=true;f&&k();Element.Events.domready={onAdd:function(a){c&&a.call(this)}};Element.Events.load={base:"load",onAdd:function(b){d&&this==a&&b.call(this)},condition:function(){if(this==a){i();delete Element.Events.load}return true}};a.addEvent("load",function(){d=true})})(window,document);MooTools.More={version:"1.4.0.1",build:"a4244edf2aa97ac8a196fc96082dd35af1abab87"}; (function(){var a={wait:function(a){return this.chain(function(){this.callChain.delay(a==null?500:a,this);return this}.bind(this))}};Chain.implement(a);this.Fx&&Fx.implement(a);this.Element&&(Element.implement&&this.Fx)&&Element.implement({chains:function(a){Array.from(a||["tween","morph","reveal"]).each(function(a){(a=this.get(a))&&a.setOptions({link:"chain"})},this);return this},pauseFx:function(a,c){this.chains(c).get(c||"tween").wait(a);return this}})})(); (function(a){Array.implement({min:function(){return Math.min.apply(null,this)},max:function(){return Math.max.apply(null,this)},average:function(){return this.length?this.sum()/this.length:0},sum:function(){var a=0,c=this.length;if(c)for(;c--;)a=a+this[c];return a},unique:function(){return[].combine(this)},shuffle:function(){for(var a=this.length;a&&--a;){var c=this[a],d=Math.floor(Math.random()*(a+1));this[a]=this[d];this[d]=c}return this},reduce:function(b,c){for(var d=0,e=this.length;d3&&a<21?"th":["th","st","nd", "rd","th"][Math.min(a%10,4)]},lessThanMinuteAgo:"less than a minute ago",minuteAgo:"about a minute ago",minutesAgo:"{delta} minutes ago",hourAgo:"about an hour ago",hoursAgo:"about {delta} hours ago",dayAgo:"1 day ago",daysAgo:"{delta} days ago",weekAgo:"1 week ago",weeksAgo:"{delta} weeks ago",monthAgo:"1 month ago",monthsAgo:"{delta} months ago",yearAgo:"1 year ago",yearsAgo:"{delta} years ago",lessThanMinuteUntil:"less than a minute from now",minuteUntil:"about a minute from now",minutesUntil:"{delta} minutes from now", hourUntil:"about an hour from now",hoursUntil:"about {delta} hours from now",dayUntil:"1 day from now",daysUntil:"{delta} days from now",weekUntil:"1 week from now",weeksUntil:"{delta} weeks from now",monthUntil:"1 month from now",monthsUntil:"{delta} months from now",yearUntil:"1 year from now",yearsUntil:"{delta} years from now"}); (function(){var a=this.Date,b=a.Methods={ms:"Milliseconds",year:"FullYear",min:"Minutes",mo:"Month",sec:"Seconds",hr:"Hours"};["Date","Day","FullYear","Hours","Milliseconds","Minutes","Month","Seconds","Time","TimezoneOffset","Week","Timezone","GMTOffset","DayOfYear","LastMonth","LastDayOfMonth","UTCDate","UTCDay","UTCFullYear","AMPM","Ordinal","UTCHours","UTCMilliseconds","UTCMinutes","UTCMonth","UTCSeconds","UTCMilliseconds"].each(function(b){a.Methods[b.toLowerCase()]=b});var c=function(a,b,d){return b== 1?a:a28)return 1;if(f==0&&h<-2){c=(new a(c)).decrement("day",d);d=0}f=(new a(c.get("year"),0,1)).get("day")||7;f>4&&(e=-7)}else f=(new a(c.get("year"),0,1)).get("day");e=e+c.get("dayofyear");return(e+(6-d)+(7+f-b)%7)/7},getOrdinal:function(b){return a.getMsg("ordinal",b||this.get("date"))},getTimezone:function(){return this.toString().replace(/^.*? ([A-Z]{3}).[0-9]{4}.*$/,"$1").replace(/^.*?\(([A-Z])[a-z]+ ([A-Z])[a-z]+ ([A-Z])[a-z]+\)$/, "$1$2$3")},getGMTOffset:function(){var a=this.get("timezoneOffset");return(a>0?"-":"+")+c((a.abs()/60).floor(),2)+c(a%60,2)},setAMPM:function(a){var a=a.toUpperCase(),b=this.get("hr");return b>11&&a=="AM"?this.decrement("hour",12):b<12&&a=="PM"?this.increment("hour",12):this},getAMPM:function(){return this.get("hr")<12?"AM":"PM"},parse:function(b){this.set("time",a.parse(b));return this},isValid:function(a){a||(a=this);return typeOf(a)=="date"&&!isNaN(a.valueOf())},format:function(b){if(!this.isValid())return"invalid date"; b||(b="%x %X");typeof b=="string"&&(b=f[b.toLowerCase()]||b);if(typeof b=="function")return b(this);var d=this;return b.replace(/%([a-z%])/gi,function(b,e){switch(e){case "a":return a.getMsg("days_abbr")[d.get("day")];case "A":return a.getMsg("days")[d.get("day")];case "b":return a.getMsg("months_abbr")[d.get("month")];case "B":return a.getMsg("months")[d.get("month")];case "c":return d.format("%a %b %d %H:%M:%S %Y");case "d":return c(d.get("date"),2);case "e":return c(d.get("date"),2," ");case "H":return c(d.get("hr"), 2);case "I":return c(d.get("hr")%12||12,2);case "j":return c(d.get("dayofyear"),3);case "k":return c(d.get("hr"),2," ");case "l":return c(d.get("hr")%12||12,2," ");case "L":return c(d.get("ms"),3);case "m":return c(d.get("mo")+1,2);case "M":return c(d.get("min"),2);case "o":return d.get("ordinal");case "p":return a.getMsg(d.get("ampm"));case "s":return Math.round(d/1E3);case "S":return c(d.get("seconds"),2);case "T":return d.format("%H:%M:%S");case "U":return c(d.get("week"),2);case "w":return d.get("day"); case "x":return d.format(a.getMsg("shortDate"));case "X":return d.format(a.getMsg("shortTime"));case "y":return d.get("year").toString().substr(2);case "Y":return d.get("year");case "z":return d.get("GMTOffset");case "Z":return d.get("Timezone")}return e})},toISOString:function(){return this.format("iso8601")}}).alias({toJSON:"toISOString",compare:"diff",strftime:"format"});var d=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],e=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"], f={db:"%Y-%m-%d %H:%M:%S",compact:"%Y%m%dT%H%M%S","short":"%d %b %H:%M","long":"%B %d, %Y %H:%M",rfc822:function(a){return d[a.get("day")]+a.format(", %d ")+e[a.get("month")]+a.format(" %Y %H:%M:%S %Z")},rfc2822:function(a){return d[a.get("day")]+a.format(", %d ")+e[a.get("month")]+a.format(" %Y %H:%M:%S %z")},iso8601:function(a){return a.getUTCFullYear()+"-"+c(a.getUTCMonth()+1,2)+"-"+c(a.getUTCDate(),2)+"T"+c(a.getUTCHours(),2)+":"+c(a.getUTCMinutes(),2)+":"+c(a.getUTCSeconds(),2)+"."+c(a.getUTCMilliseconds(), 3)+"Z"}},g=[],h=a.parse,i=function(b,c,d){var e=-1,f=a.getMsg(b+"s");switch(typeOf(c)){case "object":e=f[c.get(b)];break;case "number":e=f[c];if(!e)throw Error("Invalid "+b+" index: "+c);break;case "string":c=f.filter(function(a){return this.test(a)},RegExp("^"+c,"i"));if(!c.length)throw Error("Invalid "+b+" string");if(c.length>1)throw Error("Ambiguous "+b);e=c[0]}return d?f.indexOf(e):e},j=1900,k=70;a.extend({getMsg:function(a,b){return Locale.get("Date."+a,b)},units:{ms:Function.from(1),second:Function.from(1E3), minute:Function.from(6E4),hour:Function.from(36E5),day:Function.from(864E5),week:Function.from(6084E5),month:function(b,c){var d=new a;return a.daysInMonth(b!=null?b:d.get("mo"),c!=null?c:d.get("year"))*864E5},year:function(b){b=b||(new a).get("year");return a.isLeapYear(b)?316224E5:31536E6}},daysInMonth:function(b,c){return[31,a.isLeapYear(c)?29:28,31,30,31,30,31,31,30,31,30,31][b]},isLeapYear:function(a){return a%4===0&&a%100!==0||a%400===0},parse:function(b){var c=typeOf(b);if(c=="number")return new a(b); if(c!="string")return b;b=b.clean();if(!b.length)return null;var d;g.some(function(a){var c=a.re.exec(b);return c?d=a.handler(c):false});if(!d||!d.isValid()){d=new a(h(b));if(!d||!d.isValid())d=new a(b.toInt())}return d},parseDay:function(a,b){return i("day",a,b)},parseMonth:function(a,b){return i("month",a,b)},parseUTC:function(b){b=new a(b);b=a.UTC(b.get("year"),b.get("mo"),b.get("date"),b.get("hr"),b.get("min"),b.get("sec"),b.get("ms"));return new a(b)},orderIndex:function(b){return a.getMsg("dateOrder").indexOf(b)+ 1},defineFormat:function(a,b){f[a]=b;return this},defineParser:function(a){g.push(a.re&&a.handler?a:s(a));return this},defineParsers:function(){Array.flatten(arguments).each(a.defineParser);return this},define2DigitYearStart:function(a){k=a%100;j=a-k;return this}}).extend({defineFormats:a.defineFormat.overloadSetter()});var m=function(b){return RegExp("(?:"+a.getMsg(b).map(function(a){return a.substr(0,3)}).join("|")+")[a-z]*")},u=function(b){switch(b){case "T":return"%H:%M:%S";case "x":return(a.orderIndex("month")== 1?"%m[-./]%d":"%d[-./]%m")+"([-./]%y)?";case "X":return"%H([.:]%M)?([.:]%S([.:]%s)?)? ?%p? ?%z?"}return null},p={d:/[0-2]?[0-9]|3[01]/,H:/[01]?[0-9]|2[0-3]/,I:/0?[1-9]|1[0-2]/,M:/[0-5]?\d/,s:/\d+/,o:/[a-z]*/,p:/[ap]\.?m\.?/,y:/\d{2}|\d{4}/,Y:/\d{4}/,z:/Z|[+-]\d{2}(?::?\d{2})?/};p.m=p.I;p.S=p.M;var r,s=function(b){if(!r)return{format:b};var c=[],d=(b.source||b).replace(/%([a-z])/gi,function(a,b){return u(b)||a}).replace(/\((?!\?)/g,"(?:").replace(/ (?!\?|\*)/g,",? ").replace(/%([a-z%])/gi,function(a, b){var d=p[b];if(!d)return b;c.push(b);return"("+d.source+")"}).replace(/\[a-z\]/gi,"[a-z\\u00c0-\\uffff;&]");return{format:b,re:RegExp("^"+d+"$","i"),handler:function(b){var b=b.slice(1).associate(c),d=(new a).clearTime(),e=b.y||b.Y;e!=null&&q.call(d,"y",e);"d"in b&&q.call(d,"d",1);("m"in b||b.b||b.B)&&q.call(d,"m",1);for(var f in b)q.call(d,f,b[f]);return d}}},q=function(b,c){if(!c)return this;switch(b){case "a":case "A":return this.set("day",a.parseDay(c,true));case "b":case "B":return this.set("mo", a.parseMonth(c,true));case "d":return this.set("date",c);case "H":case "I":return this.set("hr",c);case "m":return this.set("mo",c-1);case "M":return this.set("min",c);case "p":return this.set("ampm",c.replace(/\./g,""));case "S":return this.set("sec",c);case "s":return this.set("ms",("0."+c)*1E3);case "w":return this.set("day",c);case "Y":return this.set("year",c);case "y":c=+c;c<100&&(c=c+(j+(c0.75*f&&(d=e);break}a=a/f;d=e+"s"}a=a.round();return Date.getMsg(d+b,a).substitute({delta:a})}}).defineParsers({re:/^(?:tod|tom|yes)/i,handler:function(a){var b=(new Date).clearTime();switch(a[0]){case "tom":return b.increment();case "yes":return b.decrement();default:return b}}},{re:/^(next|last) ([a-z]+)$/i,handler:function(a){var b=(new Date).clearTime(),c= b.getDay(),d=Date.parseDay(a[2],true),e=d-c;d<=c&&(e=e+7);a[1]=="last"&&(e=e-7);return b.set("date",b.getDate()+e)}}).alias("timeAgoInWords","timeDiffInWords");Locale.define("en-US","Number",{decimal:".",group:",",currency:{prefix:"$"}}); Number.implement({format:function(a){var b=this,a=a?Object.clone(a):{},c=function(b){return a[b]!=null?a[b]:Locale.get("Number."+b)},d=b<0,e=c("decimal"),f=c("precision"),g=c("group"),h=c("decimals");if(d){var i=c("negative")||{};if(i.prefix==null&&i.suffix==null)i.prefix="-";["prefix","suffix"].each(function(b){i[b]&&(a[b]=c(b)+i[b])});b=-b}var d=c("prefix"),j=c("suffix");h!==""&&(h>=0&&h<=20)&&(b=b.toFixed(h));f>=1&&f<=21&&(b=(+b).toPrecision(f));b=b+"";if(c("scientific")===false&&b.indexOf("e")> -1){var h=b.split("e"),k=+h[1],b=h[0].replace(".","");if(k<0){k=-k-1;f=h[0].indexOf(".");for(f>-1&&(k=k-(f-1));k--;)b="0"+b;b="0."+b}else{f=h[0].lastIndexOf(".");for(f>-1&&(k=k-(h[0].length-f-1));k--;)b=b+"0"}}e!="."&&(b=b.replace(".",e));if(g){f=b.lastIndexOf(e);f=f>-1?f:b.length;e=b.substring(f);for(h=f;h--;){(f-h-1)%3==0&&h!=f-1&&(e=g+e);e=b.charAt(h)+e}b=e}d&&(b=d+b);j&&(b=b+j);return b},formatCurrency:function(a){var b=Locale.get("Number.currency")||{};if(b.scientific==null)b.scientific=false; b.decimals=a!=null?a:b.decimals==null?2:b.decimals;return this.format(b)},formatPercentage:function(a){var b=Locale.get("Number.percentage")||{};if(b.suffix==null)b.suffix="%";b.decimals=a!=null?a:b.decimals==null?2:b.decimals;return this.format(b)}}); String.implement({levenshtein:function(a){var b,c=(b=this.split("")).length,d=(a=a.split("")).length,e,f,g,h;if(!c&&!d)return Math.max(c,d);var i=[];for(e=c+1;e;i[--e]=[e]);for(e=d+1;i[0][--e]=e;);e=-1;for(g=b.length;++e0?e.pop():a!="."&&e.push(a)});return e.join("/")+"/"},combine:function(a){return a.value||a.scheme+"://"+(a.user?a.user+(a.password?":"+a.password:"")+"@":"")+(a.host||"")+(a.port&&a.port!=this.schemes[a.scheme]?":"+a.port:"")+(a.directory||"/")+(a.file||"")+(a.query?"?"+a.query:"")+(a.fragment?"#"+a.fragment:"")},set:function(a,d,e){if(a== "value"){(a=d.match(b.regs.scheme))&&(a=a[1]);this.parsed=a&&this.schemes[a.toLowerCase()]==null?{scheme:a,value:d}:this.parse(d,(e||this).parsed)||(a?{scheme:a,value:d}:{value:d})}else a=="data"?this.setData(d):this.parsed[a]=d;return this},get:function(a,b){switch(a){case "value":return this.combine(this.parsed,b?b.parsed:false);case "data":return this.getData()}return this.parsed[a]||""},go:function(){document.location.href=this.toString()},toURI:function(){return this},getData:function(a,b){var e= this.get(b||"query");if(!(e||e===0))return a?null:{};e=e.parseQueryString();return a?e[a]:e},setData:function(a,b,e){if(typeof a=="string"){var f=this.getData();f[a]=b;a=f}else b&&(a=Object.merge(this.getData(),a));return this.set(e||"query",Object.toQueryString(a))},clearData:function(a){return this.set(a||"query","")},toString:a,valueOf:a});b.regs={endSlash:/\/$/,scheme:/^(\w+):/,directoryDot:/\.\/|\.$/};b.base=new b(Array.from(document.getElements("base[href]",true)).getLast(),{base:document.location}); String.implement({toURI:function(a){return new b(this,a)}})})(); (function(){if(!this.Hash){var a=this.Hash=new Type("Hash",function(a){typeOf(a)=="hash"&&(a=Object.clone(a.getClean()));for(var c in a)this[c]=a[c];return this});this.$H=function(b){return new a(b)};a.implement({forEach:function(a,c){Object.forEach(this,a,c)},getClean:function(){var a={},c;for(c in this)this.hasOwnProperty(c)&&(a[c]=this[c]);return a},getLength:function(){var a=0,c;for(c in this)this.hasOwnProperty(c)&&a++;return a}});a.alias("each","forEach");a.implement({has:Object.prototype.hasOwnProperty, keyOf:function(a){return Object.keyOf(this,a)},hasValue:function(a){return Object.contains(this,a)},extend:function(b){a.each(b||{},function(b,d){a.set(this,d,b)},this);return this},combine:function(b){a.each(b||{},function(b,d){a.include(this,d,b)},this);return this},erase:function(a){this.hasOwnProperty(a)&&delete this[a];return this},get:function(a){return this.hasOwnProperty(a)?this[a]:null},set:function(a,c){if(!this[a]||this.hasOwnProperty(a))this[a]=c;return this},empty:function(){a.each(this, function(a,c){delete this[c]},this);return this},include:function(a,c){this[a]==void 0&&(this[a]=c);return this},map:function(b,c){return new a(Object.map(this,b,c))},filter:function(b,c){return new a(Object.filter(this,b,c))},every:function(a,c){return Object.every(this,a,c)},some:function(a,c){return Object.some(this,a,c)},getKeys:function(){return Object.keys(this)},getValues:function(){return Object.values(this)},toQueryString:function(a){return Object.toQueryString(this,a)}});a.alias({indexOf:"keyOf", contains:"hasValue"})}})(); (function(){Events.Pseudos=function(a,b,e){var f=function(a){return{store:a.store?function(b,c){a.store("_monitorEvents:"+b,c)}:function(b,c){(a._monitorEvents||(a._monitorEvents={}))[b]=c},retrieve:a.retrieve?function(b,c){return a.retrieve("_monitorEvents:"+b,c)}:function(b,c){return!a._monitorEvents?c:a._monitorEvents[b]||c}}},g=function(b){if(b.indexOf(":")==-1||!a)return null;for(var d=Slick.parse(b).expressions[0][0],e=d.pseudos,f=e.length,g=[];f--;){var u=e[f].key,p=a[u];p!=null&&g.push({event:d.tag, value:e[f].value,pseudo:u,original:b,listener:p})}return g.length?g:null};return{addEvent:function(a,c,e){var k=g(a);if(!k)return b.call(this,a,c,e);var m=f(this),u=m.retrieve(a,[]),p=k[0].event,r=Array.slice(arguments,2),s=c,q=this;k.each(function(a){var b=a.listener,c=s;b==false?p=p+(":"+a.pseudo+"("+a.value+")"):s=function(){b.call(q,a,c,arguments,s)}});u.include({type:p,event:c,monitor:s});m.store(a,u);a!=p&&b.apply(this,[a,c].concat(r));return b.apply(this,[p,s].concat(r))},removeEvent:function(a, b){if(!g(a))return e.call(this,a,b);var c=f(this),d=c.retrieve(a);if(!d)return this;var m=Array.slice(arguments,2);e.apply(this,[a,b].concat(m));d.each(function(a,c){(!b||a.event==b)&&e.apply(this,[a.type,a.monitor].concat(m));delete d[c]},this);c.store(a,d);return this}}};var a={once:function(a,b,e,f){b.apply(this,e);this.removeEvent(a.event,f).removeEvent(a.original,b)},throttle:function(a,b,e){if(!b._throttled){b.apply(this,e);b._throttled=setTimeout(function(){b._throttled=false},a.value||250)}}, pause:function(a,b,e){clearTimeout(b._pause);b._pause=b.delay(a.value||250,this,e)}};Events.definePseudo=function(b,d){a[b]=d;return this};Events.lookupPseudo=function(b){return a[b]};var b=Events.prototype;Events.implement(Events.Pseudos(a,b.addEvent,b.removeEvent));["Request","Fx"].each(function(a){this[a]&&this[a].implement(Events.prototype)})})(); (function(){for(var a={relay:false},b=["once","throttle","pause"],c=b.length;c--;)a[b[c]]=Events.lookupPseudo(b[c]);DOMEvent.definePseudo=function(b,c){a[b]=c;return this};b=Element.prototype;[Element,Window,Document].invoke("implement",Events.Pseudos(a,b.addEvent,b.removeEvent))})(); (function(){DOMEvent.definePseudo("keys",function(a,b,c){var d=c[0],e=[],f=this.retrieve("$moo:keys-pressed",[]);e.append(a.value.replace("++",function(){e.push("+");return""}).split("+"));f.include(d.key);e.every(function(a){return f.contains(a)})&&b.apply(this,c);this.store("$moo:keys-pressed",f);if(!this.retrieve("$moo:keys-keyup")){a=function(a){(function(){f=this.retrieve("$moo:keys-pressed",[]).erase(a.key);this.store("$moo:keys-pressed",f)}).delay(0,this)};this.store("$moo:keys-keyup",a).addEvent("keyup", a)}});DOMEvent.defineKeys({16:"shift",17:"control",18:"alt",20:"capslock",33:"pageup",34:"pagedown",35:"end",36:"home",144:"numlock",145:"scrolllock",186:";",187:"=",188:",",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",107:"+"}).defineKey(Browser.firefox?109:189,"-")})();Class.Mutators.Binds=function(a){this.prototype.initialize||this.implement("initialize",function(){});return Array.from(a).concat(this.prototype.Binds||[])}; Class.Mutators.initialize=function(a){return function(){Array.from(this.Binds).each(function(a){var c=this[a];c&&(this[a]=c.bind(this))},this);return a.apply(this,arguments)}};Class.Occlude=new Class({occlude:function(a,b){var b=document.id(b||this.element),c=b.retrieve(a||this.property);if(c&&!this.occluded)return this.occluded=c;this.occluded=false;b.store(a||this.property,this);return this.occluded}}); Class.refactor=function(a,b){Object.each(b,function(b,d){var e=a.prototype[d],e=e&&e.$origin||e||function(){};a.implement(d,typeof b=="function"?function(){var a=this.previous;this.previous=e;var d=b.apply(this,arguments);this.previous=a;return d}:b)});return a}; (function(){Element.implement({measure:function(a){if(!this||this.offsetHeight||this.offsetWidth)return a.call(this);for(var b=this.getParent(),c=[];b&&(!b.offsetHeight&&!b.offsetWidth)&&b!=document.body;){c.push(b.expose());b=b.getParent()}b=this.expose();a=a.call(this);b();c.each(function(a){a()});return a},expose:function(){if(this.getStyle("display")!="none")return function(){};var a=this.style.cssText;this.setStyles({display:"block",position:"absolute",visibility:"hidden"});return function(){this.style.cssText= a}.bind(this)},getDimensions:function(a){var a=Object.merge({computeSize:false},a),b={x:0,y:0},c=this.getParent("body");if(c&&this.getStyle("display")=="none")b=this.measure(function(){return a.computeSize?this.getComputedSize(a):this.getSize()});else if(c)try{b=a.computeSize?this.getComputedSize(a):this.getSize()}catch(d){}return Object.append(b,b.x||b.x===0?{width:b.x,height:b.y}:{x:b.width,y:b.height})},getComputedSize:function(a){var a=Object.merge({styles:["padding","border"],planes:{height:["top", "bottom"],width:["left","right"]},mode:"both"},a),b={},c={width:0,height:0},d;if(a.mode=="vertical"){delete c.width;delete a.planes.width}else if(a.mode=="horizontal"){delete c.height;delete a.planes.height}var e=a.styles,f=[];Object.each(a.planes,function(a){Object.each(a,function(a){e.each(function(b){f.push(b+"-"+a+(b=="border"?"-width":""))})})});f.each(function(a){b[a]=this.getStyle(a).toInt()},this);Object.each(a.planes,function(a,e){var f=e.capitalize(),j=this.getStyle(e);j=="auto"&&!d&&(d= this.getDimensions());j=b[e]=j=="auto"?d[e]:j.toInt();c["total"+f]=j;a.each(function(a){var d,e=0;Object.each(b,function(b,c){c.test(a)&&(e=e+b.toInt())});d=e;c["computed"+a.capitalize()]=d;c["total"+f]=c["total"+f]+d})},this);return Object.append(c,b)}})})(); (function(a){var b=Element.Position={options:{relativeTo:document.body,position:{x:"center",y:"center"},offset:{x:0,y:0}},getOptions:function(a,d){d=Object.merge({},b.options,d);b.setPositionOption(d);b.setEdgeOption(d);b.setOffsetOption(a,d);b.setDimensionsOption(a,d);return d},setPositionOption:function(a){a.position=b.getCoordinateFromValue(a.position)},setEdgeOption:function(a){var d=b.getCoordinateFromValue(a.edge);a.edge=d?d:a.position.x=="center"&&a.position.y=="center"?{x:"center",y:"center"}: {x:"left",y:"top"}},setOffsetOption:function(a,b){var e={x:0,y:0},f=a.measure(function(){return document.id(this.getOffsetParent())}),g=f.getScroll();if(f&&f!=a.getDocument().body){e=f.measure(function(){var a=this.getPosition();if(this.getStyle("position")=="fixed"){var b=window.getScroll();a.x=a.x+b.x;a.y=a.y+b.y}return a});b.offset={parentPositioned:f!=document.id(b.relativeTo),x:b.offset.x-e.x+g.x,y:b.offset.y-e.y+g.y}}},setDimensionsOption:function(a,b){b.dimensions=a.getDimensions({computeSize:true, styles:["padding","border","margin"]})},getPosition:function(a,d){var e={},d=b.getOptions(a,d),f=document.id(d.relativeTo)||document.body;b.setPositionCoordinates(d,e,f);d.edge&&b.toEdge(e,d);var g=d.offset;e.left=(e.x>=0||g.parentPositioned||d.allowNegative?e.x:0).toInt();e.top=(e.y>=0||g.parentPositioned||d.allowNegative?e.y:0).toInt();b.toMinMax(e,d);(d.relFixedPosition||f.getStyle("position")=="fixed")&&b.toRelFixedPosition(f,e);d.ignoreScroll&&b.toIgnoreScroll(f,e);d.ignoreMargins&&b.toIgnoreMargins(e, d);e.left=Math.ceil(e.left);e.top=Math.ceil(e.top);delete e.x;delete e.y;return e},setPositionCoordinates:function(a,b,e){var f=a.offset.y,g=a.offset.x,h=e==document.body?window.getScroll():e.getPosition(),i=h.y,h=h.x,j=window.getSize();switch(a.position.x){case "left":b.x=h+g;break;case "right":b.x=h+g+e.offsetWidth;break;default:b.x=h+(e==document.body?j.x:e.offsetWidth)/2+g}switch(a.position.y){case "top":b.y=i+f;break;case "bottom":b.y=i+f+e.offsetHeight;break;default:b.y=i+(e==document.body? j.y:e.offsetHeight)/2+f}},toMinMax:function(a,b){var e={left:"x",top:"y"},f;["minimum","maximum"].each(function(g){["left","top"].each(function(h){f=b[g]?b[g][e[h]]:null;if(f!=null&&(g=="minimum"?a[h]f))a[h]=f})})},toRelFixedPosition:function(a,b){var e=window.getScroll();b.top=b.top+e.y;b.left=b.left+e.x},toIgnoreScroll:function(a,b){var e=a.getScroll();b.top=b.top-e.y;b.left=b.left-e.x},toIgnoreMargins:function(a,b){a.left=a.left+(b.edge.x=="right"?b.dimensions["margin-right"]:b.edge.x!= "center"?-b.dimensions["margin-left"]:-b.dimensions["margin-left"]+(b.dimensions["margin-right"]+b.dimensions["margin-left"])/2);a.top=a.top+(b.edge.y=="bottom"?b.dimensions["margin-bottom"]:b.edge.y!="center"?-b.dimensions["margin-top"]:-b.dimensions["margin-top"]+(b.dimensions["margin-bottom"]+b.dimensions["margin-top"])/2)},toEdge:function(a,b){var e,f;f=b.dimensions;var g=b.edge;switch(g.x){case "left":e=0;break;case "right":e=-f.x-f.computedRight-f.computedLeft;break;default:e=-Math.round(f.totalWidth/ 2)}switch(g.y){case "top":f=0;break;case "bottom":f=-f.y-f.computedTop-f.computedBottom;break;default:f=-Math.round(f.totalHeight/2)}a.x=a.x+e;a.y=a.y+f},getCoordinateFromValue:function(a){if(typeOf(a)!="string")return a;a=a.toLowerCase();return{x:a.test("left")?"left":a.test("right")?"right":"center",y:a.test(/upper|top/)?"top":a.test("bottom")?"bottom":"center"}}};Element.implement({position:function(b){if(b&&(b.x!=null||b.y!=null))return a?a.apply(this,arguments):this;var d=this.setStyle("position", "absolute").calculatePosition(b);return b&&b.returnPos?d:this.setStyles(d)},calculatePosition:function(a){return b.getPosition(this,a)}})})(Element.prototype.position); var IframeShim=new Class({Implements:[Options,Events,Class.Occlude],options:{className:"iframeShim",src:'javascript:false;document.write("");',display:!1,zIndex:null,margin:0,offset:{x:0,y:0},browsers:Browser.ie6||Browser.firefox&&3>Browser.version&&Browser.Platform.mac},property:"IframeShim",initialize:function(a,b){this.element=document.id(a);if(this.occlude())return this.occluded;this.setOptions(b);this.makeShim();return this},makeShim:function(){if(this.options.browsers){var a=this.element.getStyle("zIndex").toInt(); if(!a){var a=1,b=this.element.getStyle("position");(b=="static"||!b)&&this.element.setStyle("position","relative");this.element.setStyle("zIndex",a)}a=(this.options.zIndex!=null||this.options.zIndex===0)&&a>this.options.zIndex?this.options.zIndex:a-1;a<0&&(a=1);this.shim=(new Element("iframe",{src:this.options.src,scrolling:"no",frameborder:0,styles:{zIndex:a,position:"absolute",border:"none",filter:"progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)"},"class":this.options.className})).store("IframeShim", this);a=function(){this.shim.inject(this.element,"after");this[this.options.display?"show":"hide"]();this.fireEvent("inject")}.bind(this);IframeShim.ready?a():window.addEvent("load",a)}else this.position=this.hide=this.show=this.dispose=Function.from(this)},position:function(){if(!IframeShim.ready||!this.shim)return this;var a=this.element.measure(function(){return this.getSize()});if(this.options.margin!=void 0){a.x=a.x-this.options.margin*2;a.y=a.y-this.options.margin*2;this.options.offset.x=this.options.offset.x+ this.options.margin;this.options.offset.y=this.options.offset.y+this.options.margin}this.shim.set({width:a.x,height:a.y}).position({relativeTo:this.element,offset:this.options.offset});return this},hide:function(){this.shim&&this.shim.setStyle("display","none");return this},show:function(){this.shim&&this.shim.setStyle("display","block");return this.position()},dispose:function(){this.shim&&this.shim.dispose();return this},destroy:function(){this.shim&&this.shim.destroy();return this}}); window.addEvent("load",function(){IframeShim.ready=true}); var Mask=new Class({Implements:[Options,Events],Binds:["position"],options:{style:{},"class":"mask",maskMargins:!1,useIframeShim:!0,iframeShimOptions:{}},initialize:function(a,b){this.target=document.id(a)||document.id(document.body);this.target.store("mask",this);this.setOptions(b);this.render();this.inject()},render:function(){this.element=new Element("div",{"class":this.options["class"],id:this.options.id||"mask-"+String.uniqueID(),styles:Object.merge({},this.options.style,{display:"none"}),events:{click:function(a){this.fireEvent("click", a);this.options.hideOnClick&&this.hide()}.bind(this)}});this.hidden=true},toElement:function(){return this.element},inject:function(a,b){b=b||this.options.inject&&this.options.inject.where||this.target==document.body?"inside":"after";a=a||this.options.inject&&this.options.inject.target||this.target;this.element.inject(a,b);if(this.options.useIframeShim){this.shim=new IframeShim(this.element,this.options.iframeShimOptions);this.addEvents({show:this.shim.show.bind(this.shim),hide:this.shim.hide.bind(this.shim), destroy:this.shim.destroy.bind(this.shim)})}},position:function(){this.resize(this.options.width,this.options.height);this.element.position({relativeTo:this.target,position:"topLeft",ignoreMargins:!this.options.maskMargins,ignoreScroll:this.target==document.body});return this},resize:function(a,b){var c={styles:["padding","border"]};this.options.maskMargins&&c.styles.push("margin");c=this.target.getComputedSize(c);if(this.target==document.body){this.element.setStyles({width:0,height:0});var d=window.getScrollSize(); if(c.totalHeight0&&b>0?true:this.style.display!="none"},toggle:function(){return this[this.isDisplayed()?"hide":"show"]()},hide:function(){var a;try{a=this.getStyle("display")}catch(b){}return a=="none"?this:this.store("element:_originalDisplay",a||"").setStyle("display","none")},show:function(a){if(!a&&this.isDisplayed())return this;a=a||this.retrieve("element:_originalDisplay")|| "block";return this.setStyle("display",a=="none"?"block":a)},swapClass:function(a,b){return this.removeClass(a).addClass(b)}});Document.implement({clearSelection:function(){if(window.getSelection){var a=window.getSelection();a&&a.removeAllRanges&&a.removeAllRanges()}else if(document.selection&&document.selection.empty)try{document.selection.empty()}catch(b){}}}); (function(){var a=function(a){var c=a.options.hideInputs;if(window.OverText){var d=[null];OverText.each(function(a){d.include("."+a.options.labelClass)});d&&(c=c+d.join(", "))}return c?a.element.getElements(c):null};Fx.Reveal=new Class({Extends:Fx.Morph,options:{link:"cancel",styles:["padding","border","margin"],transitionOpacity:!Browser.ie6,mode:"vertical",display:function(){return this.element.get("tag")!="tr"?"block":"table-row"},opacity:1,hideInputs:Browser.ie?"select, input, textarea, object, embed": null},dissolve:function(){if(!this.hiding&&!this.showing)if(this.element.getStyle("display")!="none"){this.hiding=true;this.showing=false;this.hidden=true;this.cssText=this.element.style.cssText;var b=this.element.getComputedSize({styles:this.options.styles,mode:this.options.mode});if(this.options.transitionOpacity)b.opacity=this.options.opacity;var c={};Object.each(b,function(a,b){c[b]=[a,0]});this.element.setStyles({display:Function.from(this.options.display).call(this),overflow:"hidden"});var d= a(this);d&&d.setStyle("visibility","hidden");this.$chain.unshift(function(){if(this.hidden){this.hiding=false;this.element.style.cssText=this.cssText;this.element.setStyle("display","none");d&&d.setStyle("visibility","visible")}this.fireEvent("hide",this.element);this.callChain()}.bind(this));this.start(c)}else{this.callChain.delay(10,this);this.fireEvent("complete",this.element);this.fireEvent("hide",this.element)}else if(this.options.link=="chain")this.chain(this.dissolve.bind(this));else if(this.options.link== "cancel"&&!this.hiding){this.cancel();this.dissolve()}return this},reveal:function(){if(!this.showing&&!this.hiding)if(this.element.getStyle("display")=="none"){this.hiding=false;this.showing=true;this.hidden=false;this.cssText=this.element.style.cssText;var b;this.element.measure(function(){b=this.element.getComputedSize({styles:this.options.styles,mode:this.options.mode})}.bind(this));if(this.options.heightOverride!=null)b.height=this.options.heightOverride.toInt();if(this.options.widthOverride!= null)b.width=this.options.widthOverride.toInt();if(this.options.transitionOpacity){this.element.setStyle("opacity",0);b.opacity=this.options.opacity}var c={height:0,display:Function.from(this.options.display).call(this)};Object.each(b,function(a,b){c[b]=0});c.overflow="hidden";this.element.setStyles(c);var d=a(this);d&&d.setStyle("visibility","hidden");this.$chain.unshift(function(){this.element.style.cssText=this.cssText;this.element.setStyle("display",Function.from(this.options.display).call(this)); if(!this.hidden)this.showing=false;d&&d.setStyle("visibility","visible");this.callChain();this.fireEvent("show",this.element)}.bind(this));this.start(b)}else{this.callChain();this.fireEvent("complete",this.element);this.fireEvent("show",this.element)}else if(this.options.link=="chain")this.chain(this.reveal.bind(this));else if(this.options.link=="cancel"&&!this.showing){this.cancel();this.reveal()}return this},toggle:function(){this.element.getStyle("display")=="none"?this.reveal():this.dissolve(); return this},cancel:function(){this.parent.apply(this,arguments);if(this.cssText!=null)this.element.style.cssText=this.cssText;this.showing=this.hiding=false;return this}});Element.Properties.reveal={set:function(a){this.get("reveal").cancel().setOptions(a);return this},get:function(){var a=this.retrieve("reveal");if(!a){a=new Fx.Reveal(this);this.store("reveal",a)}return a}};Element.Properties.dissolve=Element.Properties.reveal;Element.implement({reveal:function(a){this.get("reveal").setOptions(a).reveal(); return this},dissolve:function(a){this.get("reveal").setOptions(a).dissolve();return this},nix:function(a){var c=Array.link(arguments,{destroy:Type.isBoolean,options:Type.isObject});this.get("reveal").setOptions(a).dissolve().chain(function(){this[c.destroy?"destroy":"dispose"]()}.bind(this));return this},wink:function(){var a=Array.link(arguments,{duration:Type.isNumber,options:Type.isObject}),c=this.get("reveal").setOptions(a.options);c.reveal().chain(function(){(function(){c.dissolve()}).delay(a.duration|| 2E3)})}})})();Elements.from=function(a,b){if(b||b==null)a=a.stripScripts();var c,d=a.match(/^\s*<(t[dhr]|tbody|tfoot|thead)/i);if(d){c=new Element("table");d=d[1].toLowerCase();if(["td","th","tr"].contains(d)){c=(new Element("tbody")).inject(c);d!="tr"&&(c=(new Element("tr")).inject(c))}}return(c||new Element("div")).set("html",a).getChildren()}; Form.Request.Append=new Class({Extends:Form.Request,options:{useReveal:!0,revealOptions:{},inject:"bottom"},makeRequest:function(){this.request=(new Request.HTML(Object.merge({url:this.element.get("action"),method:this.element.get("method")||"post",spinnerTarget:this.element},this.options.requestOptions,{evalScripts:false}))).addEvents({success:function(a,b,c,d){var e,f=Elements.from(c);e=f.length==1?f[0]:(new Element("div",{styles:{display:"none"}})).adopt(f);e.inject(this.target,this.options.inject); this.options.requestOptions.evalScripts&&Browser.exec(d);this.fireEvent("beforeEffect",e);f=function(){this.fireEvent("success",[e,this.target,a,b,c,d])}.bind(this);if(this.options.useReveal){e.set("reveal",this.options.revealOptions).get("reveal").chain(f);e.reveal()}else f()}.bind(this),failure:function(a){this.fireEvent("failure",a)}.bind(this)});this.attachReset()}}); (function(){var a={a:/[\u00e0\u00e1\u00e2\u00e3\u00e4\u00e5\u0103\u0105]/g,A:/[\u00c0\u00c1\u00c2\u00c3\u00c4\u00c5\u0102\u0104]/g,c:/[\u0107\u010d\u00e7]/g,C:/[\u0106\u010c\u00c7]/g,d:/[\u010f\u0111]/g,D:/[\u010e\u00d0]/g,e:/[\u00e8\u00e9\u00ea\u00eb\u011b\u0119]/g,E:/[\u00c8\u00c9\u00ca\u00cb\u011a\u0118]/g,g:/[\u011f]/g,G:/[\u011e]/g,i:/[\u00ec\u00ed\u00ee\u00ef]/g,I:/[\u00cc\u00cd\u00ce\u00cf]/g,l:/[\u013a\u013e\u0142]/g,L:/[\u0139\u013d\u0141]/g,n:/[\u00f1\u0148\u0144]/g,N:/[\u00d1\u0147\u0143]/g, o:/[\u00f2\u00f3\u00f4\u00f5\u00f6\u00f8\u0151]/g,O:/[\u00d2\u00d3\u00d4\u00d5\u00d6\u00d8]/g,r:/[\u0159\u0155]/g,R:/[\u0158\u0154]/g,s:/[\u0161\u0161\u015f]/g,S:/[\u0160\u015e\u015a]/g,t:/[\u0165\u0163]/g,T:/[\u0164\u0162]/g,ue:/[\u00fc]/g,UE:/[\u00dc]/g,u:/[\u00f9\u00fa\u00fb\u016f\u00b5]/g,U:/[\u00d9\u00da\u00db\u016e]/g,y:/[\u00ff\u00fd]/g,Y:/[\u0178\u00dd]/g,z:/[\u017e\u017a\u017c]/g,Z:/[\u017d\u0179\u017b]/g,th:/[\u00fe]/g,TH:/[\u00de]/g,dh:/[\u00f0]/g,DH:/[\u00d0]/g,ss:/[\u00df]/g,oe:/[\u0153]/g, OE:/[\u0152]/g,ae:/[\u00e6]/g,AE:/[\u00c6]/g},b={" ":/[\xa0\u2002\u2003\u2009]/g,"*":/[\xb7]/g,"'":/[\u2018\u2019]/g,'"':/[\u201c\u201d]/g,"...":/[\u2026]/g,"-":/[\u2013]/g,"»":/[\uFFFD]/g},c=function(a,b){var c=a,d;for(d in b)c=c.replace(b[d],d);return c},d=function(a,b){a=a||"";return RegExp(b?"<"+a+"(?!\\w)[^>]*>([\\s\\S]*?)":"]+)?>","gi")};String.implement({standardize:function(){return c(this,a)},repeat:function(a){return Array(a+1).join(this)},pad:function(a, b,c){if(this.length>=a)return this;a=(b==null?" ":""+b).repeat(a-this.length).substr(0,a-this.length);return!c||c=="right"?this+a:c=="left"?a+this:a.substr(0,(a.length/2).floor())+this+a.substr(0,(a.length/2).ceil())},getTags:function(a,b){return this.match(d(a,b))||[]},stripTags:function(a,b){return this.replace(d(a,b),"")},tidy:function(){return c(this,b)},truncate:function(a,b,c){var d=this;b==null&&arguments.length==1&&(b="\u2026");if(d.length>a){d=d.substring(0,a);if(c){var i=d.lastIndexOf(c); i!=-1&&(d=d.substr(0,i))}b&&(d=d+b)}return d}})})(); Element.implement({tidy:function(){this.set("value",this.get("value").tidy())},getTextInRange:function(a,b){return this.get("value").substring(a,b)},getSelectedText:function(){return this.setSelectionRange?this.getTextInRange(this.getSelectionStart(),this.getSelectionEnd()):document.selection.createRange().text},getSelectedRange:function(){if(this.selectionStart!=null)return{start:this.selectionStart,end:this.selectionEnd};var a={start:0,end:0},b=this.getDocument().selection.createRange();if(!b|| b.parentElement()!=this)return a;var c=b.duplicate();if(this.type=="text"){a.start=0-c.moveStart("character",-1E5);a.end=a.start+b.text.length}else{var d=this.get("value"),e=d.length;c.moveToElementText(this);c.setEndPoint("StartToEnd",b);c.text.length&&(e=e-d.match(/[\n\r]*$/)[0].length);a.end=e-c.text.length;c.setEndPoint("StartToStart",b);a.start=e-c.text.length}return a},getSelectionStart:function(){return this.getSelectedRange().start},getSelectionEnd:function(){return this.getSelectedRange().end}, setCaretPosition:function(a){if(a=="end")a=this.get("value").length;this.selectRange(a,a);return this},getCaretPosition:function(){return this.getSelectedRange().start},selectRange:function(a,b){if(this.setSelectionRange){this.focus();this.setSelectionRange(a,b)}else{var c=this.get("value"),d=c.substr(a,b-a).replace(/\r/g,"").length,a=c.substr(0,a).replace(/\r/g,"").length,c=this.createTextRange();c.collapse(true);c.moveEnd("character",a+d);c.moveStart("character",a);c.select()}return this},insertAtCursor:function(a, b){var c=this.getSelectedRange(),d=this.get("value");this.set("value",d.substring(0,c.start)+a+d.substring(c.end,d.length));b!==false?this.selectRange(c.start,c.start+a.length):this.setCaretPosition(c.start+a.length);return this},insertAroundCursor:function(a,b){var a=Object.append({before:"",defaultMiddle:"",after:""},a),c=this.getSelectedText()||a.defaultMiddle,d=this.getSelectedRange(),e=this.get("value");if(d.start==d.end){this.set("value",e.substring(0,d.start)+a.before+c+a.after+e.substring(d.end, e.length));this.selectRange(d.start+a.before.length,d.end+a.before.length+c.length)}else{c=e.substring(d.start,d.end);this.set("value",e.substring(0,d.start)+a.before+c+a.after+e.substring(d.end,e.length));d=d.start+a.before.length;b!==false?this.selectRange(d,d+c.length):this.setCaretPosition(d+e.length)}return this}}); Locale.define("en-US","FormValidator",{required:"This field is required.",length:"Please enter {length} characters (you entered {elLength} characters)",minLength:"Please enter at least {minLength} characters (you entered {length} characters).",maxLength:"Please enter no more than {maxLength} characters (you entered {length} characters).",integer:"Please enter an integer in this field. Numbers with decimals (e.g. 1.25) are not permitted.",numeric:'Please enter only numeric values in this field (i.e. "1" or "1.1" or "-1" or "-1.1").', digits:"Please use numbers and punctuation only in this field (for example, a phone number with dashes or dots is permitted).",alpha:"Please use only letters (a-z) within this field. No spaces or other characters are allowed.",alphanum:"Please use only letters (a-z) or numbers (0-9) in this field. No spaces or other characters are allowed.",dateSuchAs:"Please enter a valid date such as {date}",dateInFormatMDY:'Please enter a valid date such as MM/DD/YYYY (i.e. "12/31/1999")',email:'Please enter a valid email address. For example "fred@domain.com".', url:"Please enter a valid URL such as http://www.example.com.",currencyDollar:"Please enter a valid $ amount. For example $100.00 .",oneRequired:"Please enter something for at least one of these inputs.",errorPrefix:"Error: ",warningPrefix:"Warning: ",noSpace:"There can be no spaces in this input.",reqChkByNode:"No items are selected.",requiredChk:"This field is required.",reqChkByName:"Please select a {label}.",match:"This field needs to match the {matchName} field",startDate:"the start date",endDate:"the end date", currendDate:"the current date",afterDate:"The date should be the same or after {label}.",beforeDate:"The date should be the same or before {label}.",startMonth:"Please select a start month",sameMonth:"These two dates must be in the same month - you must change one or the other.",creditcard:"The credit card number entered is invalid. Please check the number and try again. {length} digits entered."});window.Form||(window.Form={}); var InputValidator=this.InputValidator=new Class({Implements:[Options],options:{errorMsg:"Validation failed.",test:Function.from(!0)},initialize:function(a,b){this.setOptions(b);this.className=a},test:function(a,b){return(a=document.id(a))?this.options.test(a,b||this.getProps(a)):false},getError:function(a,b){var a=document.id(a),c=this.options.errorMsg;typeOf(c)=="function"&&(c=c(a,b||this.getProps(a)));return c},getProps:function(a){return(a=document.id(a))?a.get("validatorProps"):{}}}); Element.Properties.validators={get:function(){return(this.get("data-validators")||this.className).clean().split(" ")}}; Element.Properties.validatorProps={set:function(a){return this.eliminate("$moo:validatorProps").store("$moo:validatorProps",a)},get:function(a){a&&this.set(a);if(this.retrieve("$moo:validatorProps"))return this.retrieve("$moo:validatorProps");if(this.getProperty("data-validator-properties")||this.getProperty("validatorProps"))try{this.store("$moo:validatorProps",JSON.decode(this.getProperty("validatorProps")||this.getProperty("data-validator-properties")))}catch(b){return{}}else{var c=this.get("validators").filter(function(a){return a.test(":")}); if(c.length){a={};c.each(function(b){b=b.split(":");if(b[1])try{a[b[0]]=JSON.decode(b[1])}catch(c){}});this.store("$moo:validatorProps",a)}else this.store("$moo:validatorProps",{})}return this.retrieve("$moo:validatorProps")}}; Form.Validator=new Class({Implements:[Options,Events],Binds:["onSubmit"],options:{fieldSelectors:"input, select, textarea",ignoreHidden:!0,ignoreDisabled:!0,useTitles:!1,evaluateOnSubmit:!0,evaluateFieldsOnBlur:!0,evaluateFieldsOnChange:!0,serial:!0,stopOnFailure:!0,warningPrefix:function(){return Form.Validator.getMsg("warningPrefix")||"Warning: "},errorPrefix:function(){return Form.Validator.getMsg("errorPrefix")||"Error: "}},initialize:function(a,b){this.setOptions(b);this.element=document.id(a); this.element.store("validator",this);this.warningPrefix=Function.from(this.options.warningPrefix)();this.errorPrefix=Function.from(this.options.errorPrefix)();this.options.evaluateOnSubmit&&this.element.addEvent("submit",this.onSubmit);(this.options.evaluateFieldsOnBlur||this.options.evaluateFieldsOnChange)&&this.watchFields(this.getFields())},toElement:function(){return this.element},getFields:function(){return this.fields=this.element.getElements(this.options.fieldSelectors)},watchFields:function(a){a.each(function(a){this.options.evaluateFieldsOnBlur&& a.addEvent("blur",this.validationMonitor.pass([a,false],this));this.options.evaluateFieldsOnChange&&a.addEvent("change",this.validationMonitor.pass([a,true],this))},this)},validationMonitor:function(){clearTimeout(this.timer);this.timer=this.validateField.delay(50,this,arguments)},onSubmit:function(a){this.validate(a)&&this.reset()},reset:function(){this.getFields().each(this.resetField,this);return this},validate:function(a){var b=this.getFields().map(function(a){return this.validateField(a,true)}, this).every(function(a){return a});this.fireEvent("formValidate",[b,this.element,a]);this.options.stopOnFailure&&(!b&&a)&&a.preventDefault();return b},validateField:function(a,b){if(this.paused)return true;var a=document.id(a),c=!a.hasClass("validation-failed"),d,e;if(this.options.serial&&!b){d=this.element.getElement(".validation-failed");e=this.element.getElement(".warning")}if(a&&(!d||b||a.hasClass("validation-failed")||d&&!this.options.serial)){d=a.get("validators");var f=d.some(function(a){return this.getValidator(a)}, this),g=[];d.each(function(b){b&&!this.test(b,a)&&g.include(b)},this);c=g.length===0;if(f&&!this.hasValidator(a,"warnOnly"))if(c){a.addClass("validation-passed").removeClass("validation-failed");this.fireEvent("elementPass",[a])}else{a.addClass("validation-failed").removeClass("validation-passed");this.fireEvent("elementFail",[a,g])}if(!e){d.some(function(a){return a.test("^warn")?this.getValidator(a.replace(/^warn-/,"")):null},this);a.removeClass("warning");d.map(function(b){return b.test("^warn")? this.test(b.replace(/^warn-/,""),a,true):null},this)}}return c},test:function(a,b,c){b=document.id(b);if(this.options.ignoreHidden&&!b.isVisible()||this.options.ignoreDisabled&&b.get("disabled"))return true;var d=this.getValidator(a);c!=null&&(c=false);this.hasValidator(b,"warnOnly")&&(c=true);var e=this.hasValidator(b,"ignoreValidation")||(d?d.test(b):true);d&&b.isVisible()&&this.fireEvent("elementValidate",[e,b,a,c]);return c?true:e},hasValidator:function(a,b){return a.get("validators").contains(b)}, resetField:function(a){(a=document.id(a))&&a.get("validators").each(function(b){b.test("^warn-")&&b.replace(/^warn-/,"");a.removeClass("validation-failed");a.removeClass("warning");a.removeClass("validation-passed")},this);return this},stop:function(){this.paused=true;return this},start:function(){this.paused=false;return this},ignoreField:function(a,b){if(a=document.id(a)){this.enforceField(a);b?a.addClass("warnOnly"):a.addClass("ignoreValidation")}return this},enforceField:function(a){(a=document.id(a))&& a.removeClass("warnOnly").removeClass("ignoreValidation");return this}});Form.Validator.getMsg=function(a){return Locale.get("FormValidator."+a)};Form.Validator.adders={validators:{},add:function(a,b){this.validators[a]=new InputValidator(a,b);this.initialize||this.implement({validators:this.validators})},addAllThese:function(a){Array.from(a).each(function(a){this.add(a[0],a[1])},this)},getValidator:function(a){return this.validators[a.split(":")[0]]}};Object.append(Form.Validator,Form.Validator.adders); Form.Validator.implement(Form.Validator.adders);Form.Validator.add("IsEmpty",{errorMsg:!1,test:function(a){return a.type=="select-one"||a.type=="select"?!(a.selectedIndex>=0&&a.options[a.selectedIndex].value!=""):a.get("value")==null||a.get("value").length==0}}); Form.Validator.addAllThese([["required",{errorMsg:function(){return Form.Validator.getMsg("required")},test:function(a){return!Form.Validator.getValidator("IsEmpty").test(a)}}],["length",{errorMsg:function(a,b){return typeOf(b.length)!="null"?Form.Validator.getMsg("length").substitute({length:b.length,elLength:a.get("value").length}):""},test:function(a,b){return typeOf(b.length)!="null"?a.get("value").length==b.length||a.get("value").length==0:true}}],["minLength",{errorMsg:function(a,b){return typeOf(b.minLength)!= "null"?Form.Validator.getMsg("minLength").substitute({minLength:b.minLength,length:a.get("value").length}):""},test:function(a,b){return typeOf(b.minLength)!="null"?a.get("value").length>=(b.minLength||0):true}}],["maxLength",{errorMsg:function(a,b){return typeOf(b.maxLength)!="null"?Form.Validator.getMsg("maxLength").substitute({maxLength:b.maxLength,length:a.get("value").length}):""},test:function(a,b){return a.get("value").length<=(b.maxLength||1E4)}}],["validate-integer",{errorMsg:Form.Validator.getMsg.pass("integer"), test:function(a){return Form.Validator.getValidator("IsEmpty").test(a)||/^(-?[1-9]\d*|0)$/.test(a.get("value"))}}],["validate-numeric",{errorMsg:Form.Validator.getMsg.pass("numeric"),test:function(a){return Form.Validator.getValidator("IsEmpty").test(a)||/^-?(?:0$0(?=\d*\.)|[1-9]|0)\d*(\.\d+)?$/.test(a.get("value"))}}],["validate-digits",{errorMsg:Form.Validator.getMsg.pass("digits"),test:function(a){return Form.Validator.getValidator("IsEmpty").test(a)||/^[\d() .:\-\+#]+$/.test(a.get("value"))}}], ["validate-alpha",{errorMsg:Form.Validator.getMsg.pass("alpha"),test:function(a){return Form.Validator.getValidator("IsEmpty").test(a)||/^[a-zA-Z]+$/.test(a.get("value"))}}],["validate-alphanum",{errorMsg:Form.Validator.getMsg.pass("alphanum"),test:function(a){return Form.Validator.getValidator("IsEmpty").test(a)||!/\W/.test(a.get("value"))}}],["validate-date",{errorMsg:function(a,b){if(Date.parse){var c=b.dateFormat||"%x";return Form.Validator.getMsg("dateSuchAs").substitute({date:(new Date).format(c)})}return Form.Validator.getMsg("dateInFormatMDY")}, test:function(a,b){if(Form.Validator.getValidator("IsEmpty").test(a))return true;var c=Locale.getCurrent().sets.Date,c=RegExp([c.days,c.days_abbr,c.months,c.months_abbr].flatten().join("|"),"i"),d=a.get("value"),e=d.match(/[a-z]+/gi);if(e&&!e.every(c.exec,c))return false;c=Date.parse(d);d=c.format(b.dateFormat||"%x");d!="invalid date"&&a.set("value",d);return c.isValid()}}],["validate-email",{errorMsg:Form.Validator.getMsg.pass("email"),test:function(a){return Form.Validator.getValidator("IsEmpty").test(a)|| /^(?:[a-z0-9!#$%&'*+\/=?^_`{|}~-]\.?){0,63}[a-z0-9!#$%&'*+\/=?^_`{|}~-]@(?:(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)*[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\])$/i.test(a.get("value"))}}],["validate-url",{errorMsg:Form.Validator.getMsg.pass("url"),test:function(a){return Form.Validator.getValidator("IsEmpty").test(a)||/^(https?|ftp|rmtp|mms):\/\/(([A-Z0-9][A-Z0-9_-]*)(\.[A-Z0-9][A-Z0-9_-]*)+)(:(\d+))?\/?/i.test(a.get("value"))}}], ["validate-currency-dollar",{errorMsg:Form.Validator.getMsg.pass("currencyDollar"),test:function(a){return Form.Validator.getValidator("IsEmpty").test(a)||/^\$?\-?([1-9]{1}[0-9]{0,2}(\,[0-9]{3})*(\.[0-9]{0,2})?|[1-9]{1}\d*(\.[0-9]{0,2})?|0(\.[0-9]{0,2})?|(\.[0-9]{1,2})?)$/.test(a.get("value"))}}],["validate-one-required",{errorMsg:Form.Validator.getMsg.pass("oneRequired"),test:function(a,b){return(document.id(b["validate-one-required"])||a.getParent(b["validate-one-required"])).getElements("input").some(function(a){return["checkbox", "radio"].contains(a.get("type"))?a.get("checked"):a.get("value")})}}]]);Element.Properties.validator={set:function(a){this.get("validator").setOptions(a)},get:function(){var a=this.retrieve("validator");if(!a){a=new Form.Validator(this);this.store("validator",a)}return a}};Element.implement({validate:function(a){a&&this.set("validator",a);return this.get("validator").validate()}}); Form.Validator.Inline=new Class({Extends:Form.Validator,options:{showError:function(a){a.reveal?a.reveal():a.setStyle("display","block")},hideError:function(a){a.dissolve?a.dissolve():a.setStyle("display","none")},scrollToErrorsOnSubmit:!0,scrollToErrorsOnBlur:!1,scrollToErrorsOnChange:!1,scrollFxOptions:{transition:"quad:out",offset:{y:-20}}},initialize:function(a,b){this.parent(a,b);this.addEvent("onElementValidate",function(a,b,e,f){var g=this.getValidator(e);if(!a&&g.getError(b)){f&&b.addClass("warning"); a=this.makeAdvice(e,b,g.getError(b),f);this.insertAdvice(a,b);this.showAdvice(e,b)}else this.hideAdvice(e,b)})},makeAdvice:function(a,b,c,d){var e=d?this.warningPrefix:this.errorPrefix,e=e+(this.options.useTitles?b.title||c:c),c=d?"warning-advice":"validation-advice",d=(d=this.getAdvice(a,b))?d.set("html",e):(new Element("div",{html:e,styles:{display:"none"},id:"advice-"+a.split(":")[0]+"-"+this.getFieldId(b)})).addClass(c);b.store("$moo:advice-"+a,d);return d},getFieldId:function(a){return a.id? a.id:a.id="input_"+a.name},showAdvice:function(a,b){var c=this.getAdvice(a,b);if(c&&!b.retrieve("$moo:"+this.getPropName(a))&&(c.getStyle("display")=="none"||c.getStyle("visiblity")=="hidden"||c.getStyle("opacity")==0)){b.store("$moo:"+this.getPropName(a),true);this.options.showError(c);this.fireEvent("showAdvice",[b,c,a])}},hideAdvice:function(a,b){var c=this.getAdvice(a,b);if(c&&b.retrieve("$moo:"+this.getPropName(a))){b.store("$moo:"+this.getPropName(a),false);this.options.hideError(c);this.fireEvent("hideAdvice", [b,c,a])}},getPropName:function(a){return"advice"+a},resetField:function(a){a=document.id(a);if(!a)return this;this.parent(a);a.get("validators").each(function(b){this.hideAdvice(b,a)},this);return this},getAllAdviceMessages:function(a,b){var c=[];if(a.hasClass("ignoreValidation")&&!b)return c;a.get("validators").some(function(b){var e=b.test("^warn-")||a.hasClass("warnOnly");e&&(b=b.replace(/^warn-/,""));(b=this.getValidator(b))&&c.push({message:b.getError(a),warnOnly:e,passed:b.test(),validator:b})}, this);return c},getAdvice:function(a,b){return b.retrieve("$moo:advice-"+a)},insertAdvice:function(a,b){var c=b.get("validatorProps");!c.msgPos||!document.id(c.msgPos)?b.type&&b.type.toLowerCase()=="radio"?b.getParent().adopt(a):a.inject(document.id(b),"after"):document.id(c.msgPos).grab(a)},validateField:function(a,b,c){a=this.parent(a,b);if((this.options.scrollToErrorsOnSubmit&&c==null||c)&&!a){c=document.id(this).getElement(".validation-failed");for(b=document.id(this).getParent();b!=document.body&& b.getScrollSize().y==b.getSize().y;)b=b.getParent();var d=b.retrieve("$moo:fvScroller");if(!d&&window.Fx&&Fx.Scroll){d=new Fx.Scroll(b,this.options.scrollFxOptions);b.store("$moo:fvScroller",d)}c&&(d?d.toElement(c):b.scrollTo(b.getScroll().x,c.getPosition(b).y-20))}return a},watchFields:function(a){a.each(function(a){this.options.evaluateFieldsOnBlur&&a.addEvent("blur",this.validationMonitor.pass([a,false,this.options.scrollToErrorsOnBlur],this));this.options.evaluateFieldsOnChange&&a.addEvent("change", this.validationMonitor.pass([a,true,this.options.scrollToErrorsOnChange],this))},this)}}); Form.Validator.addAllThese([["validate-enforce-oncheck",{test:function(a,b){var c=a.getParent("form").retrieve("validator");if(!c)return true;(b.toEnforce||document.id(b.enforceChildrenOf).getElements("input, select, textarea")).map(function(b){if(a.checked)c.enforceField(b);else{c.ignoreField(b);c.resetField(b)}});return true}}],["validate-ignore-oncheck",{test:function(a,b){var c=a.getParent("form").retrieve("validator");if(!c)return true;(b.toIgnore||document.id(b.ignoreChildrenOf).getElements("input, select, textarea")).each(function(b){if(a.checked){c.ignoreField(b); c.resetField(b)}else c.enforceField(b)});return true}}],["validate-nospace",{errorMsg:function(){return Form.Validator.getMsg("noSpace")},test:function(a){return!a.get("value").test(/\s/)}}],["validate-toggle-oncheck",{test:function(a,b){var c=a.getParent("form").retrieve("validator");if(!c)return true;var d=b.toToggle||document.id(b.toToggleChildrenOf).getElements("input, select, textarea");a.checked?d.each(function(a){c.enforceField(a)}):d.each(function(a){c.ignoreField(a);c.resetField(a)});return true}}], ["validate-reqchk-bynode",{errorMsg:function(){return Form.Validator.getMsg("reqChkByNode")},test:function(a,b){return document.id(b.nodeId).getElements(b.selector||"input[type=checkbox], input[type=radio]").some(function(a){return a.checked})}}],["validate-required-check",{errorMsg:function(a,b){return b.useTitle?a.get("title"):Form.Validator.getMsg("requiredChk")},test:function(a){return!!a.checked}}],["validate-reqchk-byname",{errorMsg:function(a,b){return Form.Validator.getMsg("reqChkByName").substitute({label:b.label|| a.get("type")})},test:function(a,b){var c=b.groupName||a.get("name"),c=$$(document.getElementsByName(c)).some(function(a){return a.checked}),d=a.getParent("form").retrieve("validator");c&&d&&d.resetField(a);return c}}],["validate-match",{errorMsg:function(a,b){return Form.Validator.getMsg("match").substitute({matchName:b.matchName||document.id(b.matchInput).get("name")})},test:function(a,b){var c=a.get("value"),d=document.id(b.matchInput)&&document.id(b.matchInput).get("value");return c&&d?c==d:true}}], ["validate-after-date",{errorMsg:function(a,b){return Form.Validator.getMsg("afterDate").substitute({label:b.afterLabel||(b.afterElement?Form.Validator.getMsg("startDate"):Form.Validator.getMsg("currentDate"))})},test:function(a,b){var c=document.id(b.afterElement)?Date.parse(document.id(b.afterElement).get("value")):new Date,d=Date.parse(a.get("value"));return d&&c?d>=c:true}}],["validate-before-date",{errorMsg:function(a,b){return Form.Validator.getMsg("beforeDate").substitute({label:b.beforeLabel|| (b.beforeElement?Form.Validator.getMsg("endDate"):Form.Validator.getMsg("currentDate"))})},test:function(a,b){var c=Date.parse(a.get("value")),d=document.id(b.beforeElement)?Date.parse(document.id(b.beforeElement).get("value")):new Date;return d&&c?d>=c:true}}],["validate-custom-required",{errorMsg:function(){return Form.Validator.getMsg("required")},test:function(a,b){return a.get("value")!=b.emptyValue}}],["validate-same-month",{errorMsg:function(a,b){var c=document.id(b.sameMonthAs)&&document.id(b.sameMonthAs).get("value"); if(a.get("value")!="")return Form.Validator.getMsg(c?"sameMonth":"startMonth")},test:function(a,b){var c=Date.parse(a.get("value")),d=Date.parse(document.id(b.sameMonthAs)&&document.id(b.sameMonthAs).get("value"));return c&&d?c.format("%B")==d.format("%B"):true}}],["validate-cc-num",{errorMsg:function(a){a=a.get("value").replace(/[^0-9]/g,"");return Form.Validator.getMsg("creditcard").substitute({length:a.length})},test:function(a){if(Form.Validator.getValidator("IsEmpty").test(a))return true;var b= a.get("value"),b=b.replace(/[^0-9]/g,""),c=false;b.test(/^4[0-9]{12}([0-9]{3})?$/)?c="Visa":b.test(/^5[1-5]([0-9]{14})$/)?c="Master Card":b.test(/^3[47][0-9]{13}$/)?c="American Express":b.test(/^6011[0-9]{12}$/)&&(c="Discover");if(c){for(var d=c=0,e=b.length-1;e>=0;--e){d=b.charAt(e).toInt();if(d!=0){(b.length-e)%2==0&&(d=d+d);d>9&&(d=d.toString().charAt(0).toInt()+d.toString().charAt(1).toInt());c=c+d}}if(c%10==0)return true}for(c="";b!="";){c=c+(" "+b.substr(0,4));b=b.substr(4)}a.getParent("form").retrieve("validator").ignoreField(a); a.set("value",c.clean());a.getParent("form").retrieve("validator").enforceField(a);return false}}]]); var OverText=new Class({Implements:[Options,Events,Class.Occlude],Binds:["reposition","assert","focus","hide"],options:{element:"label",labelClass:"overTxtLabel",positionOptions:{position:"upperLeft",edge:"upperLeft",offset:{x:4,y:2}},poll:!1,pollInterval:250,wrap:!1},property:"OverText",initialize:function(a,b){a=this.element=document.id(a);if(this.occlude())return this.occluded;this.setOptions(b);this.attach(a);OverText.instances.push(this);this.options.poll&&this.poll()},toElement:function(){return this.element}, attach:function(){var a=this.element,b=this.options,c=b.textOverride||a.get("alt")||a.get("title");if(!c)return this;c=this.text=(new Element(b.element,{"class":b.labelClass,styles:{lineHeight:"normal",position:"absolute",cursor:"text"},html:c,events:{click:this.hide.pass(b.element=="label",this)}})).inject(a,"after");if(b.element=="label"){a.get("id")||a.set("id","input_"+String.uniqueID());c.set("for",a.get("id"))}if(b.wrap)this.textHolder=(new Element("div.overTxtWrapper",{styles:{lineHeight:"normal", position:"relative"}})).grab(c).inject(a,"before");return this.enable()},destroy:function(){this.element.eliminate(this.property);this.disable();this.text&&this.text.destroy();this.textHolder&&this.textHolder.destroy();return this},disable:function(){this.element.removeEvents({focus:this.focus,blur:this.assert,change:this.assert});window.removeEvent("resize",this.reposition);this.hide(true,true);return this},enable:function(){this.element.addEvents({focus:this.focus,blur:this.assert,change:this.assert}); window.addEvent("resize",this.reposition);this.reposition();return this},wrap:function(){if(this.options.element=="label"){this.element.get("id")||this.element.set("id","input_"+String.uniqueID());this.text.set("for",this.element.get("id"))}},startPolling:function(){this.pollingPaused=false;return this.poll()},poll:function(a){if(this.poller&&!a)return this;a?clearInterval(this.poller):this.poller=function(){this.pollingPaused||this.assert(true)}.periodical(this.options.pollInterval,this);return this}, stopPolling:function(){this.pollingPaused=true;return this.poll(true)},focus:function(){return this.text&&(!this.text.isDisplayed()||this.element.get("disabled"))?this:this.hide()},hide:function(a,b){if(this.text&&this.text.isDisplayed()&&(!this.element.get("disabled")||b)){this.text.hide();this.fireEvent("textHide",[this.text,this.element]);this.pollingPaused=true;if(!a)try{this.element.fireEvent("focus");this.element.focus()}catch(c){}}return this},show:function(){if(this.text&&!this.text.isDisplayed()){this.text.show(); this.reposition();this.fireEvent("textShow",[this.text,this.element]);this.pollingPaused=false}return this},test:function(){return!this.element.get("value")},assert:function(a){return this[this.test()?"show":"hide"](a)},reposition:function(){this.assert(true);if(!this.element.isVisible())return this.stopPolling().hide();this.text&&this.test()&&this.text.position(Object.merge(this.options.positionOptions,{relativeTo:this.element}));return this}});OverText.instances=[]; Object.append(OverText,{each:function(a){return OverText.instances.each(function(b,c){b.element&&b.text&&a.call(OverText,b,c)})},update:function(){return OverText.each(function(a){return a.reposition()})},hideAll:function(){return OverText.each(function(a){return a.hide(true,true)})},showAll:function(){return OverText.each(function(a){return a.show()})}}); Fx.Elements=new Class({Extends:Fx.CSS,initialize:function(a,b){this.elements=this.subject=$$(a);this.parent(b)},compute:function(a,b,c){var d={},e;for(e in a){var f=a[e],g=b[e],h=d[e]={},i;for(i in f)h[i]=this.parent(f[i],g[i],c)}return d},set:function(a){for(var b in a)if(this.elements[b]){var c=a[b],d;for(d in c)this.render(this.elements[b],d,c[d],this.options.unit)}return this},start:function(a){if(!this.check(a))return this;var b={},c={},d;for(d in a)if(this.elements[d]){var e=a[d],f=b[d]={}, g=c[d]={},h;for(h in e){var i=this.prepare(this.elements[d],h,e[h]);f[h]=i.from;g[h]=i.to}}return this.parent(b,c)}}); Fx.Accordion=new Class({Extends:Fx.Elements,options:{fixedHeight:!1,fixedWidth:!1,display:0,show:!1,height:!0,width:!1,opacity:!0,alwaysHide:!1,trigger:"click",initialDisplayFx:!0,resetHeight:!0},initialize:function(){var a=function(a){return a!=null},a=Array.link(arguments,{container:Type.isElement,options:Type.isObject,togglers:a,elements:a});this.parent(a.elements,a.options);var b=this.options,c=this.togglers=$$(a.togglers);this.previous=-1;this.internalChain=new Chain;if(b.alwaysHide)this.options.link= "chain";if(b.show||this.options.show===0){b.display=false;this.previous=b.show}if(b.start){b.display=false;b.show=false}var d=this.effects={};if(b.opacity)d.opacity="fullOpacity";if(b.width)d.width=b.fixedWidth?"fullWidth":"offsetWidth";if(b.height)d.height=b.fixedHeight?"fullHeight":"scrollHeight";for(var a=0,e=c.length;a=0?d-1:0).chain(f):f();return this},detach:function(a){var b=function(a){a.removeEvent(this.options.trigger,a.retrieve("accordion:display"))}.bind(this);a?b(a):this.togglers.each(b);return this},display:function(a,b){if(!this.check(a,b))return this;var c={},d=this.elements,e=this.options,f=this.effects;b==null&&(b=true);typeOf(a)=="element"&&(a=d.indexOf(a));if(a==this.previous&&!e.alwaysHide)return this;if(e.resetHeight){var g=d[this.previous];if(g&& !this.selfHidden)for(var h in f)g.setStyle(h,g[f[h]])}if(this.timer&&e.link=="chain"||a===this.previous&&!e.alwaysHide)return this;this.previous=a;this.selfHidden=false;d.each(function(d,g){c[g]={};var h;if(g!=a)h=true;else if(e.alwaysHide&&(d.offsetHeight>0&&e.height||d.offsetWidth>0&&e.width))this.selfHidden=h=true;this.fireEvent(h?"background":"active",[this.togglers[g],d]);for(var m in f)c[g][m]=h?0:d[f[m]];if(!b&&!h&&e.resetHeight)c[g].height="auto"},this);this.internalChain.clearChain();this.internalChain.chain(function(){if(e.resetHeight&& !this.selfHidden){var b=d[a];b&&b.setStyle("height","auto")}}.bind(this));return b?this.start(c):this.set(c).internalChain.callChain()}}); (function(){Fx.Scroll=new Class({Extends:Fx,options:{offset:{x:0,y:0},wheelStops:true},initialize:function(a,b){this.element=this.subject=document.id(a);this.parent(b);if(typeOf(this.element)!="element")this.element=document.id(this.element.getDocument().body);if(this.options.wheelStops){var c=this.element,d=this.cancel.pass(false,this);this.addEvent("start",function(){c.addEvent("mousewheel",d)},true);this.addEvent("complete",function(){c.removeEvent("mousewheel",d)},true)}},set:function(){var a= Array.flatten(arguments);Browser.firefox&&(a=[Math.round(a[0]),Math.round(a[1])]);this.element.scrollTo(a[0],a[1]);return this},compute:function(a,b,c){return[0,1].map(function(d){return Fx.compute(a[d],b[d],c)})},start:function(a,b){if(!this.check(a,b))return this;var c=this.element.getScroll();return this.parent([c.x,c.y],[a,b])},calculateScroll:function(a,b){var c=this.element,d=c.getScrollSize(),e=c.getScroll(),c=c.getSize(),f=this.options.offset,g={x:a,y:b},h;for(h in g){!g[h]&&g[h]!==0&&(g[h]= e[h]);typeOf(g[h])!="number"&&(g[h]=d[h]-c[h]);g[h]=g[h]+f[h]}return[g.x,g.y]},toTop:function(){return this.start.apply(this,this.calculateScroll(false,0))},toLeft:function(){return this.start.apply(this,this.calculateScroll(0,false))},toRight:function(){return this.start.apply(this,this.calculateScroll("right",false))},toBottom:function(){return this.start.apply(this,this.calculateScroll(false,"bottom"))},toElement:function(a,b){var b=b?Array.from(b):["x","y"],c=/^(?:body|html)$/i.test(this.element.tagName)? {x:0,y:0}:this.element.getScroll(),d=Object.map(document.id(a).getPosition(this.element),function(a,d){return b.contains(d)?a+c[d]:false});return this.start.apply(this,this.calculateScroll(d.x,d.y))},toElementEdge:function(a,b,c){var b=b?Array.from(b):["x","y"],a=document.id(a),d={},e=a.getPosition(this.element),a=a.getSize(),f=this.element.getScroll(),g=this.element.getSize(),h={x:e.x+a.x,y:e.y+a.y};["x","y"].each(function(a){if(b.contains(a)){h[a]>f[a]+g[a]&&(d[a]=h[a]-g[a]);e[a]this.options.snap){this.cancel();this.document.addEvents({mousemove:this.bound.drag,mouseup:this.bound.stop});this.fireEvent("start",[this.element,a]).fireEvent("snap",this.element)}},drag:function(a){var b=this.options;b.preventDefault&&a.preventDefault();this.mouse.now=a.page;for(var c in b.modifiers)if(b.modifiers[c]){this.value.now[c]= this.mouse.now[c]-this.mouse.pos[c];b.invert&&(this.value.now[c]=this.value.now[c]*-1);if(b.limit&&this.limit[c])if((this.limit[c][1]||this.limit[c][1]===0)&&this.value.now[c]>this.limit[c][1])this.value.now[c]=this.limit[c][1];else if((this.limit[c][0]||this.limit[c][0]===0)&&this.value.now[c]0^a0^a>this.max))a=this.max;this.step=Math.round(a);return this.checkStep().fireEvent("tick",this.toPosition(this.step)).end()},setRange:function(a,b){this.min=Array.pick([a[0],0]);this.max=Array.pick([a[1],this.options.steps]);this.range=this.max-this.min;this.steps= this.options.steps||this.full;this.stepSize=Math.abs(this.range)/this.steps;this.stepWidth=this.stepSize*this.full/Math.abs(this.range);a&&this.set(Array.pick([b,this.step]).floor(this.min).max(this.max));return this},clickedElement:function(a){if(!(this.isDragging||a.target==this.knob)){var b=this.range<0?-1:1,a=a.page[this.axis]-this.element.getPosition()[this.axis]-this.half,a=a.limit(-this.options.offset,this.full-this.options.offset);this.step=Math.round(this.min+b*this.toStep(a));this.checkStep().fireEvent("tick", a).end()}},scrolledElement:function(a){this.set(this.step+((this.options.mode=="horizontal"?a.wheel<0:a.wheel>0)?-1:1)*this.stepSize);a.stop()},draggedKnob:function(){var a=this.range<0?-1:1,b=this.drag.value.now[this.axis],b=b.limit(-this.options.offset,this.full-this.options.offset);this.step=Math.round(this.min+a*this.toStep(b));this.checkStep()},checkStep:function(){var a=this.step;if(this.previousChange!=a){this.previousChange=a;this.fireEvent("change",a)}return this},end:function(){var a=this.step; if(this.previousEnd!==a){this.previousEnd=a;this.fireEvent("complete",a+"")}return this},toStep:function(a){a=(a+this.options.offset)*this.stepSize/this.full*this.steps;return this.options.steps?Math.round(a-a%this.stepSize):a},toPosition:function(a){return this.full*Math.abs(this.min-a)/(this.steps*this.stepSize)-this.options.offset}}); Drag.Move=new Class({Extends:Drag,options:{droppables:[],container:!1,precalculate:!1,includeMargins:!0,checkDroppables:!0},initialize:function(a,b){this.parent(a,b);a=this.element;this.droppables=$$(this.options.droppables);if((this.container=document.id(this.options.container))&&typeOf(this.container)!="element")this.container=document.id(this.container.getDocument().body);if(this.options.style){if(this.options.modifiers.x=="left"&&this.options.modifiers.y=="top"){var c=a.getOffsetParent(),d=a.getStyles("left", "top");c&&(d.left=="auto"||d.top=="auto")&&a.setPosition(a.getPosition(c))}a.getStyle("position")=="static"&&a.setStyle("position","absolute")}this.addEvent("start",this.checkDroppables,true);this.overed=null},start:function(a){if(this.container)this.options.limit=this.calculateLimit();if(this.options.precalculate)this.positions=this.droppables.map(function(a){return a.getCoordinates()});this.parent(a)},calculateLimit:function(){var a=this.element,b=this.container,c=document.id(a.getOffsetParent())|| document.body,d=b.getCoordinates(c),e={},f={},g={},h={};["top","right","bottom","left"].each(function(d){e[d]=a.getStyle("margin-"+d).toInt();a.getStyle("border-"+d).toInt();f[d]=b.getStyle("margin-"+d).toInt();g[d]=b.getStyle("border-"+d).toInt();h[d]=c.getStyle("padding-"+d).toInt()},this);var i=0,j=0,k=d.right-g.right-(a.offsetWidth+e.left+e.right),m=d.bottom-g.bottom-(a.offsetHeight+e.top+e.bottom);if(this.options.includeMargins){i=i+e.left;j=j+e.top}else{k=k+e.right;m=m+e.bottom}if(a.getStyle("position")== "relative"){d=a.getCoordinates(c);d.left=d.left-a.getStyle("left").toInt();d.top=d.top-a.getStyle("top").toInt();i=i-d.left;j=j-d.top;if(b.getStyle("position")!="relative"){i=i+g.left;j=j+g.top}k=k+(e.left-d.left);m=m+(e.top-d.top);if(b!=c){i=i+(f.left+h.left);j=j+((Browser.ie6||Browser.ie7?0:f.top)+h.top)}}else{i=i-e.left;j=j-e.top;if(b!=c){i=i+(d.left+g.left);j=j+(d.top+g.top)}}return{x:[i,k],y:[j,m]}},getDroppableCoordinates:function(a){var b=a.getCoordinates();if(a.getStyle("position")=="fixed"){a= window.getScroll();b.left=b.left+a.x;b.right=b.right+a.x;b.top=b.top+a.y;b.bottom=b.bottom+a.y}return b},checkDroppables:function(){var a=this.droppables.filter(function(a,c){var a=this.positions?this.positions[c]:this.getDroppableCoordinates(a),d=this.mouse.now;return d.x>a.left&&d.xa.top},this).getLast();if(this.overed!=a){this.overed&&this.fireEvent("leave",[this.element,this.overed]);a&&this.fireEvent("enter",[this.element,a]);this.overed=a}},drag:function(a){this.parent(a); this.options.checkDroppables&&this.droppables.length&&this.checkDroppables()},stop:function(a){this.checkDroppables();this.fireEvent("drop",[this.element,this.overed,a]);this.overed=null;return this.parent(a)}});Element.implement({makeDraggable:function(a){a=new Drag.Move(this,a);this.store("dragger",a);return a}}); var Sortables=new Class({Implements:[Events,Options],options:{opacity:1,clone:!1,revert:!1,handle:!1,dragOptions:{}},initialize:function(a,b){this.setOptions(b);this.elements=[];this.lists=[];this.idle=true;this.addLists($$(document.id(a)||a));if(!this.options.clone)this.options.revert=false;if(this.options.revert)this.effect=new Fx.Morph(null,Object.merge({duration:250,link:"cancel"},this.options.revert))},attach:function(){this.addLists(this.lists);return this},detach:function(){this.lists=this.removeLists(this.lists); return this},addItems:function(){Array.flatten(arguments).each(function(a){this.elements.push(a);var b=a.retrieve("sortables:start",function(b){this.start.call(this,b,a)}.bind(this));(this.options.handle?a.getElement(this.options.handle)||a:a).addEvent("mousedown",b)},this);return this},addLists:function(){Array.flatten(arguments).each(function(a){this.lists.include(a);this.addItems(a.getChildren())},this);return this},removeItems:function(){return $$(Array.flatten(arguments).map(function(a){this.elements.erase(a); var b=a.retrieve("sortables:start");(this.options.handle?a.getElement(this.options.handle)||a:a).removeEvent("mousedown",b);return a},this))},removeLists:function(){return $$(Array.flatten(arguments).map(function(a){this.lists.erase(a);this.removeItems(a.getChildren());return a},this))},getClone:function(a,b){if(!this.options.clone)return(new Element(b.tagName)).inject(document.body);if(typeOf(this.options.clone)=="function")return this.options.clone.call(this,a,b,this.list);var c=b.clone(true).setStyles({margin:0, position:"absolute",visibility:"hidden",width:b.getStyle("width")}).addEvent("mousedown",function(a){b.fireEvent("mousedown",a)});c.get("html").test("radio")&&c.getElements("input[type=radio]").each(function(a,c){a.set("name","clone_"+c);a.get("checked")&&b.getElements("input[type=radio]")[c].set("checked",true)});return c.inject(this.list).setPosition(b.getPosition(b.getOffsetParent()))},getDroppables:function(){var a=this.list.getChildren().erase(this.clone).erase(this.element);this.options.constrain|| a.append(this.lists).erase(this.list);return a},insert:function(a,b){var c="inside";if(this.lists.contains(b)){this.list=b;this.drag.droppables=this.getDroppables()}else c=this.element.getAllPrevious().contains(b)?"before":"after";this.element.inject(b,c);this.fireEvent("sort",[this.element,this.clone])},start:function(a,b){if(this.idle&&!a.rightClick&&!["button","input","a","textarea"].contains(a.target.get("tag"))){this.idle=false;this.element=b;this.opacity=b.getStyle("opacity");this.list=b.getParent(); this.clone=this.getClone(a,b);this.drag=(new Drag.Move(this.clone,Object.merge({droppables:this.getDroppables()},this.options.dragOptions))).addEvents({onSnap:function(){a.stop();this.clone.setStyle("visibility","visible");this.element.setStyle("opacity",this.options.opacity||0);this.fireEvent("start",[this.element,this.clone])}.bind(this),onEnter:this.insert.bind(this),onCancel:this.end.bind(this),onComplete:this.end.bind(this)});this.clone.inject(this.element,"before");this.drag.start(a)}},end:function(){this.drag.detach(); this.element.setStyle("opacity",this.opacity);if(this.effect){var a=this.element.getStyles("width","height"),b=this.clone,c=b.computePosition(this.element.getPosition(this.clone.getOffsetParent())),d=function(){this.removeEvent("cancel",d);b.destroy()};this.effect.element=b;this.effect.start({top:c.top,left:c.left,width:a.width,height:a.height,opacity:0.25}).addEvent("cancel",d).chain(d)}else this.clone.destroy();this.reset()},reset:function(){this.idle=true;this.fireEvent("complete",this.element)}, serialize:function(){var a=Array.link(arguments,{modifier:Type.isFunction,index:function(a){return a!=null}}),b=this.lists.map(function(b){return b.getChildren().map(a.modifier||function(a){return a.get("id")},this)},this),c=a.index;this.lists.length==1&&(c=0);return(c||c===0)&&c>=0&&c2083&&this.fireEvent("error",b);Request.JSONP.request_map["request_"+ c]=function(){this.success(arguments,c)}.bind(this);var d=this.getScript(b).inject(a.injectScript);this.fireEvent("request",[b,d]);a.timeout&&this.timeout.delay(a.timeout,this);return this},getScript:function(a){if(!this.script)this.script=new Element("script",{type:"text/javascript",async:true,src:a});return this.script},success:function(a){this.running&&this.clear().fireEvent("complete",a).fireEvent("success",a).callChain()},cancel:function(){this.running&&this.clear().fireEvent("cancel");return this}, isRunning:function(){return!!this.running},clear:function(){this.running=false;if(this.script){this.script.destroy();this.script=null}return this},timeout:function(){if(this.running){this.running=false;this.fireEvent("timeout",[this.script.get("src"),this.script]).fireEvent("failure").cancel()}return this}});Request.JSONP.counter=0;Request.JSONP.request_map={}; Request.implement({options:{initialDelay:5E3,delay:5E3,limit:6E4},startTimer:function(a){var b=function(){this.running||this.send({data:a})};this.lastDelay=this.options.initialDelay;this.timer=b.delay(this.lastDelay,this);this.completeCheck=function(a){clearTimeout(this.timer);this.lastDelay=a?this.options.delay:(this.lastDelay+this.options.delay).min(this.options.limit);this.timer=b.delay(this.lastDelay,this)};return this.addEvent("complete",this.completeCheck)},stopTimer:function(){clearTimeout(this.timer); return this.removeEvent("complete",this.completeCheck)}}); var Asset={javascript:function(a,b){b||(b={});var c=new Element("script",{src:a,type:"text/javascript"}),d=b.document||document,e=b.onload||b.onLoad;delete b.onload;delete b.onLoad;delete b.document;e&&(typeof c.onreadystatechange!="undefined"?c.addEvent("readystatechange",function(){["loaded","complete"].contains(this.readyState)&&e.call(this)}):c.addEvent("load",e));return c.set(b).inject(d.head)},css:function(a,b){b||(b={});var c=new Element("link",{rel:"stylesheet",media:"screen",type:"text/css", href:a}),d=b.onload||b.onLoad,e=b.document||document;delete b.onload;delete b.onLoad;delete b.document;d&&c.addEvent("load",d);return c.set(b).inject(e.head)},image:function(a,b){b||(b={});var c=new Image,d=document.id(c)||new Element("img");["load","abort","error"].each(function(a){var f="on"+a,g="on"+a.capitalize(),h=b[f]||b[g]||function(){};delete b[g];delete b[f];c[f]=function(){if(c){if(!d.parentNode){d.width=c.width;d.height=c.height}c=c.onload=c.onabort=c.onerror=null;h.delay(1,d,d);d.fireEvent(a, d,1)}}});c.src=d.src=a;c&&c.complete&&c.onload.delay(1);return d.set(b)},images:function(a,b){var a=Array.from(a),c=function(){},d=0,b=Object.merge({onComplete:c,onProgress:c,onError:c,properties:{}},b);return new Elements(a.map(function(c,f){return Asset.image(c,Object.append(b.properties,{onload:function(){d++;b.onProgress.call(this,d,f,c);if(d==a.length)b.onComplete()},onerror:function(){d++;b.onError.call(this,d,f,c);if(d==a.length)b.onComplete()}}))}))}}; (function(){var a=this.Color=new Type("Color",function(a,c){if(arguments.length>=3){c="rgb";a=Array.slice(arguments,0,3)}else typeof a=="string"&&(a=a.match(/rgb/)?a.rgbToHex().hexToRgb(true):a.match(/hsb/)?a.hsbToRgb():a.hexToRgb(true));switch(c||"rgb"){case "hsb":var d=a,a=a.hsbToRgb();a.hsb=d;break;case "hex":a=a.hexToRgb(true)}a.rgb=a.slice(0,3);a.hsb=a.hsb||a.rgbToHsb();a.hex=a.rgbToHex();return Object.append(a,this)});a.implement({mix:function(){var b=Array.slice(arguments),c=typeOf(b.getLast())== "number"?b.pop():50,d=this.slice();b.each(function(b){for(var b=new a(b),f=0;f<3;f++)d[f]=Math.round(d[f]/100*(100-c)+b[f]/100*c)});return new a(d,"rgb")},invert:function(){return new a(this.map(function(a){return 255-a}))},setHue:function(b){return new a([b,this.hsb[1],this.hsb[2]],"hsb")},setSaturation:function(b){return new a([this.hsb[0],b,this.hsb[2]],"hsb")},setBrightness:function(b){return new a([this.hsb[0],this.hsb[1],b],"hsb")}});this.$RGB=function(b,c,d){return new a([b,c,d],"rgb")};this.$HSB= function(b,c,d){return new a([b,c,d],"hsb")};this.$HEX=function(b){return new a(b,"hex")};Array.implement({rgbToHsb:function(){var a=this[0],c=this[1],d=this[2],e=0,f=Math.max(a,c,d),g=Math.min(a,c,d),h=f-g,g=f/255,i=f!=0?h/f:0;if(i!=0){var e=(f-a)/h,j=(f-c)/h,d=(f-d)/h,e=(a==f?d-j:c==f?2+e-d:4+j-e)/6;e<0&&e++}return[Math.round(e*360),Math.round(i*100),Math.round(g*100)]},hsbToRgb:function(){var a=Math.round(this[2]/100*255);if(this[1]==0)return[a,a,a];var c=this[0]%360,d=c%60,e=Math.round(this[2]* (100-this[1])/1E4*255),f=Math.round(this[2]*(6E3-this[1]*d)/6E5*255),d=Math.round(this[2]*(6E3-this[1]*(60-d))/6E5*255);switch(Math.floor(c/60)){case 0:return[a,d,e];case 1:return[f,a,e];case 2:return[e,a,d];case 3:return[e,f,a];case 4:return[d,e,a];case 5:return[a,e,f]}return false}});String.implement({rgbToHsb:function(){var a=this.match(/\d{1,3}/g);return a?a.rgbToHsb():null},hsbToRgb:function(){var a=this.match(/\d{1,3}/g);return a?a.hsbToRgb():null}})})(); var HtmlTable=new Class({Implements:[Options,Events,Class.Occlude],options:{properties:{cellpadding:0,cellspacing:0,border:0},rows:[],headers:[],footers:[]},property:"HtmlTable",initialize:function(){var a=Array.link(arguments,{options:Type.isObject,table:Type.isElement,id:Type.isString});this.setOptions(a.options);if(!a.table&&a.id)a.table=document.id(a.id);this.element=a.table||new Element("table",this.options.properties);if(this.occlude())return this.occluded;this.build()},build:function(){this.element.store("HtmlTable", this);this.body=document.id(this.element.tBodies[0])||(new Element("tbody")).inject(this.element);$$(this.body.rows);this.options.headers.length?this.setHeaders(this.options.headers):this.thead=document.id(this.element.tHead);if(this.thead)this.head=this.getHead();this.options.footers.length&&this.setFooters(this.options.footers);if(this.tfoot=document.id(this.element.tFoot))this.foot=document.id(this.tfoot.rows[0]);this.options.rows.each(function(a){this.push(a)},this)},toElement:function(){return this.element}, empty:function(){this.body.empty();return this},set:function(a,b){var c=a=="headers"?"tHead":"tFoot",d=c.toLowerCase();this[d]=(document.id(this.element[c])||(new Element(d)).inject(this.element,"top")).empty();c=this.push(b,{},this[d],a=="headers"?"th":"td");a=="headers"?this.head=this.getHead():this.foot=this.getHead();return c},getHead:function(){var a=this.thead.rows;return a.length>1?$$(a):a.length?document.id(a[0]):false},setHeaders:function(a){this.set("headers",a);return this},setFooters:function(a){this.set("footers", a);return this},update:function(a,b,c){var d=a.getChildren(c||"td"),e=d.length-1;b.each(function(b,g){var h=d[g]||(new Element(c||"td")).inject(a),i=(b?b.content:"")||b,j=typeOf(i);b&&b.properties&&h.set(b.properties);/(element(s?)|array|collection)/.test(j)?h.empty().adopt(i):h.set("html",i);g>e?d.push(h):d[g]=h});return{tr:a,tds:d}},push:function(a,b,c,d,e){if(typeOf(a)=="element"&&a.get("tag")=="tr"){a.inject(c||this.body,e);return{tr:a,tds:a.getChildren("td")}}return this.update((new Element("tr", b)).inject(c||this.body,e),a,d)},pushMany:function(a,b,c,d,e){return a.map(function(a){return this.push(a,b,c,d,e)},this)}});"adopt inject wraps grab replaces dispose".split(" ").each(function(a){HtmlTable.implement(a,function(){this.element[a].apply(this.element,arguments);return this})}); HtmlTable=Class.refactor(HtmlTable,{options:{sortIndex:0,sortReverse:!1,parsers:[],defaultParser:"string",classSortable:"table-sortable",classHeadSort:"table-th-sort",classHeadSortRev:"table-th-sort-rev",classNoSort:"table-th-nosort",classGroupHead:"table-tr-group-head",classGroup:"table-tr-group",classCellSort:"table-td-sort",classSortSpan:"table-th-sort-span",sortable:!1,thSelector:"th"},initialize:function(){this.previous.apply(this,arguments);if(this.occluded)return this.occluded;this.sorted= {index:null,dir:1};if(!this.bound)this.bound={};this.bound.headClick=this.headClick.bind(this);this.sortSpans=new Elements;if(this.options.sortable){this.enableSort();this.options.sortIndex!=null&&this.sort(this.options.sortIndex,this.options.sortReverse)}},attachSorts:function(a){this.detachSorts();a!==false&&this.element.addEvent("click:relay("+this.options.thSelector+")",this.bound.headClick)},detachSorts:function(){this.element.removeEvents("click:relay("+this.options.thSelector+")")},setHeaders:function(){this.previous.apply(this, arguments);this.sortEnabled&&this.setParsers()},setParsers:function(){this.parsers=this.detectParsers()},detectParsers:function(){return this.head&&this.head.getElements(this.options.thSelector).flatten().map(this.detectParser,this)},detectParser:function(a,b){if(a.hasClass(this.options.classNoSort)||a.retrieve("htmltable-parser"))return a.retrieve("htmltable-parser");var c=new Element("div");c.adopt(a.childNodes).inject(a);c=(new Element("span",{"class":this.options.classSortSpan})).inject(c,"top"); this.sortSpans.push(c);var d=this.options.parsers[b],e=this.body.rows,f;switch(typeOf(d)){case "function":d={convert:d};f=true;break;case "string":f=true}f||HtmlTable.ParserPriority.some(function(a){var a=HtmlTable.Parsers[a],c=a.match;if(!c)return false;for(var f=0,j=e.length;fg&&a[f].position--}}},setRowStyle:function(a,b){this.previous(a,b);a.cells[this.sorted.index].addClass(this.options.classCellSort)},setGroupSort:function(a,b,c){a==c.value?b.removeClass(this.options.classGroupHead).addClass(this.options.classGroup):b.removeClass(this.options.classGroup).addClass(this.options.classGroupHead);return c.value},getParser:function(){var a=this.parsers[this.sorted.index]; return typeOf(a)=="string"?HtmlTable.Parsers[a]:a},sort:function(a,b,c){if(this.head){if(!c){this.clearSort();this.setSortedState(a,b);this.setHeadSort(true)}if(a=this.getParser()){var d;if(!Browser.ie){d=this.body.getParent();this.body.dispose()}b=this.parseData(a).sort(function(a,b){return a.value===b.value?0:a.value>b.value?1:-1});this.sorted.reverse==(a==HtmlTable.Parsers["input-checked"])&&b.reverse(true);this.setRowSort(b,c);d&&d.grab(this.body);this.fireEvent("stateChanged");return this.fireEvent("sort", [this.body,this.sorted.index])}}},parseData:function(a){return Array.map(this.body.rows,function(b,c){var d=a.convert.call(document.id(b.cells[this.sorted.index]));return{position:c,value:d}},this)},clearSort:function(){this.setHeadSort(false);this.body.getElements("td").removeClass(this.options.classCellSort)},reSort:function(){this.sortEnabled&&this.sort.call(this,this.sorted.index,this.sorted.reverse);return this},enableSort:function(){this.element.addClass(this.options.classSortable);this.attachSorts(true); this.setParsers();this.sortEnabled=true;return this},disableSort:function(){this.element.removeClass(this.options.classSortable);this.attachSorts(false);this.sortSpans.each(function(a){a.destroy()});this.sortSpans.empty();this.sortEnabled=false;return this}});HtmlTable.ParserPriority=["date","input-checked","input-value","float","number"]; HtmlTable.Parsers={date:{match:/^\d{2}[-\/ ]\d{2}[-\/ ]\d{2,4}$/,convert:function(){var a=Date.parse(this.get("text").stripTags());return typeOf(a)=="date"?a.format("db"):""},type:"date"},"input-checked":{match:/ type="(radio|checkbox)" /,convert:function(){return this.getElement("input").checked}},"input-value":{match:/$1")},getTimeInSeconds:function(){var a=0;this.split(":").reverse().forEach(function(b,c){a=a+b.toInt()*(c>0?c*60:1)});return a},singularize:function(){var a=this;a.substr(a.length-3,a.length-1)==="ies"?a=a.replace("ies","y"):a.substr(a.length-1,a.length-1)==="s"&&(a=a.substr(0,a.length-1));return a}}); Request=Class.refactor(Request,{trackAnalytics:function(){var a=this.options,b=typeOf(a.track_event)==="array",c=typeOf(a.track_pageview)==="array",d=window._gaq;if((b||c)&&d){b&&d.push(a.track_event);c&&d.push(a.track_pageview)}},send:function(a){if(window.Signal&&Signal.request){var b=Object.buildQueryString(a,["url"]),b=[this.options.url||a.url||"/",b?"?":"",b].join("");Signal.request.send.dispatch({url:b})}$(document.body).addClass("progress");this.options.method.toLowerCase()==="post"&&Cookie.write("xsrft", vimeo.xsrft,{domain:vimeo.domain,path:"/"});this.previous(a)},success:function(a,b){$(document.body).removeClass("progress");this.trackAnalytics();this.previous(a,b)},failure:function(){$(document.body).removeClass("progress");this.previous()},cancel:function(){$(document.body).removeClass("progress");this.previous()}});Request.HTML=Class.refactor(Request.HTML,{success:function(a){$(document.body).removeClass("progress");this.trackAnalytics();this.previous(a);Global.xsrfProtect();Global.trackAnalytics()}}); Request.JSON=Class.refactor(Request.JSON,{success:function(a){$(document.body).removeClass("progress");this.trackAnalytics();this.previous(a)}}); Form.Request=Class.refactor(Form.Request,{submit_value:null,initialize:function(a,b,c){this.element=document.id(a);this.element.retrieve("form.request")===null&&this.previous(a,b,c)},send:function(){this.disableSubmit();this.previous()},makeRequest:function(){var a=this;this.request=(new Request.HTML(Object.merge({update:this.target,emulation:false,spinnerTarget:this.element,method:this.element.get("method")||"post"},this.options.requestOptions))).addEvents({success:function(b,c,d,e){a.enableSubmit(); ["complete","success"].each(function(f){a.fireEvent(f,[a.target,b,c,d,e])})},failure:function(){a.enableSubmit();a.fireEvent("complete",arguments).fireEvent("failure",arguments)},exception:function(){a.enableSubmit();a.fireEvent("failure",arguments)}});return this.attachReset()},attach:function(a){try{this.element.removeEvent("submit",Global.onStaticFormSubmit)}catch(b){console.log(b)}this.previous(a)},enableSubmit:function(){var a=this.element.getElement("input[type=submit]");a!==null&&a.removeClass("btn_disabled").set("disabled", false).set("value",this.submit_value)},disableSubmit:function(){var a=this.element.getElement("input[type=submit]");if(a!==null){if(this.submit_value===null)this.submit_value=a.get("value");a.addClass("btn_disabled").set("disabled",true);this.options.progress!==false&&a.set("value",a.get("data-submit-text")||a.get("value"))}}}); Form.Request.Append=Class.refactor(Form.Request.Append,{makeRequest:function(){this.request=(new Request.HTML(Object.merge({url:this.element.get("action"),method:this.element.get("method")||"post",spinnerTarget:this.element},this.options.requestOptions,{evalScripts:false}))).addEvents({success:function(a,b,c,d){this.enableSubmit();var e,f=Elements.from(c);e=f.length==1?f[0]:(new Element("div",{styles:{display:"none"}})).adopt(f);e.inject(this.target,this.options.inject);this.options.requestOptions.evalScripts&& Browser.exec(d);this.fireEvent("beforeEffect",e);f=function(){this.fireEvent("success",[e,this.target,a,b,c,d])}.bind(this);if(this.options.useReveal){e.set("reveal",this.options.revealOptions).get("reveal").chain(f);e.hide();e.reveal()}else f()}.bind(this),failure:function(a){this.enableSubmit();this.fireEvent("failure",a)}.bind(this)});this.attachReset()}}); Form.Validator=Class.refactor(Form.Validator,{options:{evaluateFieldsOnBlur:!1,evaluateFieldsOnChange:!1},initialize:function(a,b){this.element=document.id(a);this.element!==null&&this.element.retrieve("validator")===null&&this.previous(a,b)},validate:function(a,b){var c=this.getFields().map(function(a){return this.validateField(a,true)},this).every(function(a){return a});b||this.fireEvent("formValidate",[c,this.element,a]);this.options.stopOnFailure&&(!c&&a)&&a.preventDefault();return c},isFieldValid:function(a){var a= document.id(a),b;if(a){b=a.get("validators");b.some(function(a){return this.getValidator(a)},this);var c=[];b.each(function(b){var e=this.getValidator(b);!this.hasValidator(a,"ignoreValidation")&&!(e?e.test(a):1)&&c.include(b)},this);b=c.length===0}return b}}); Form.Validator.Inline=Class.refactor(Form.Validator.Inline,{initialize:function(a,b){this.parent(a,b);this.addEvent("onElementValidate",function(a,b,e,f){var g=this.getValidator(e);if(!a&&g.getError(b)){if(!this.hasAdvice(b)){f&&b.addClass("warning");a=this.makeAdvice(e,b,g.getError(b),f);this.insertAdvice(a,b);this.showAdvice(e,b)}}else this.hideAdvice(e,b)});this.addEvent("onShowAdvice",function(a,b,e){b=a.retrieve("$inlineValidatorsAdviceDisplay",{});b[e]=true;a.store("$inlineValidatorsAdviceDisplay", b)});this.addEvent("onHideAdvice",function(a,b,e){b=a.retrieve("$inlineValidatorsAdviceDisplay",{});b[e]=false;a.store("$inlineValidatorsAdviceDisplay",b)})},hasAdvice:function(a){var b=false,a=a.retrieve("$inlineValidatorsAdviceDisplay",{}),c;for(c in a)a[c]===true&&(b=true);return b}}); OverText=Class.refactor(OverText,{enable:function(){this.element.addEvents({focus:this.focus,blur:this.assert,change:this.assert});window.addEvent("resize",this.reposition);this.assert(true);this.reposition();this.element.match(":focus")&&this.hide();return this}});Fx.Scroll=Class.refactor(Fx.Scroll,{toElement:function(a,b){var c=document.id(a).getPosition(this.element);return this.start(c.x+0,c.y+0+(b||0))}}); Form.Validator.add("IsEmpty",{errorMsg:!1,test:function(a){return a.type=="select-one"||a.type=="select"?!(a.selectedIndex>=0&&a.options[a.selectedIndex].value!=""):a.get("value")===null||a.get("value").trim().length===0}}); Form.Validator.addAllThese([["clipurl",{errorMsg:Form.Validator.getMsg.pass("url"),test:function(a){return Form.Validator.getValidator("IsEmpty").test(a)||/vimeo.com\/[0-9]+/i.test(a.get("value"))}}],["lazyclipurl",{errorMsg:Form.Validator.getMsg.pass("url"),test:function(a){return Form.Validator.getValidator("IsEmpty").test(a)||/(vimeo.com\/)?[0-9]+/i.test(a.get("value"))}}],["validate-urlazy",{errorMsg:Form.Validator.getMsg.pass("url"),test:function(a){return Form.Validator.getValidator("IsEmpty").test(a)|| /^((https?|ftp|rmtp|mms):\/\/)?(([A-Z0-9][A-Z0-9_-]*)(\.[A-Z0-9][A-Z0-9_-]*)+)(:(\d+))?\/?/i.test(a.get("value"))}}],["minValue",{errorMsg:"Please enter a number within the valid range.",test:function(a,b){return a.value>=b.minValue}}],["maxValue",{errorMsg:"Please enter a number within the valid range.",test:function(a,b){return a.value<=b.maxValue}}],["custom-url",{errorMsg:"Unavailable",test:function(a){var b=a.get("value"),c=a.getNext("span.msg");return b===a.get("data-original-value")||b.length=== 0?true:c.get("text")==="Unavailable"||!Form.Validator.getValidator("validate-alphanum").test(a)||!/^([0-9]*[a-z][a-z0-9]*)$/i.test(b)||b.length<3||b.length>24?false:true}}],["custom-clip-url",{errorMsg:"Unavailable",test:function(a){var b=a.get("value"),c=a.getNext("span.msg");if(b===a.get("data-original-value")||b.length===0)return true;if(c.get("text")==="Unavailable")return false;b=ClipSettings.filterCustomUrl(b);return!/^([a-z0-9\-]*)$/i.test(b)||b.length>64?false:true}}],["custom-cc-num",{errorMsg:"Invalid credit card number", test:function(a){if(Form.Validator.getValidator("IsEmpty").test(a))return true;var a=a.get("value"),b=false;a.test(/^4[0-9]{12}([0-9]{3})?$/)?b="Visa":a.test(/^5[1-5]([0-9]{14})$/)?b="Master Card":a.test(/^3[47][0-9]{13}$/)?b="American Express":a.test(/^6011[0-9]{12}$/)&&(b="Discover");if(b){for(var c=b=0,d=a.length-1;d>=0;--d){c=a.charAt(d).toInt();if(c!=0){(a.length-d)%2==0&&(c=c+c);c>9&&(c=c.toString().charAt(0).toInt()+c.toString().charAt(1).toInt());b=b+c}}if(b%10==0)return true}return false}}], ["custom-tip-num",{errorMsg:"Invalid tip amount",test:function(a){var b=a.get("value");return Form.Validator.getValidator("IsEmpty").test(a)||!/^(?:0$0(?=\d*\.)|[1-9]|0)\d*(\.\d+)?$/.test(b)||parseFloat(b)>500||parseFloat(b)<0.99?false:/^\$?\-?([1-9]{1}[0-9]{0,2}(\,[0-9]{3})*(\.[0-9]{0,2})?|[1-9]{1}\d*(\.[0-9]{0,2})?|0(\.[0-9]{0,2})?|(\.[0-9]{1,2})?)$/.test(b)}}],["custom-digit-positive",{errorMsg:"Invalid value",test:function(a){var b=a.get("value");return Form.Validator.getValidator("IsEmpty").test(a)? false:parseFloat(b)>0}}]]);Class.Binds=new Class({$bound:{},bound:function(a){return this.$bound[a]?this.$bound[a]:this.$bound[a]=this[a].bind(this)}}); Sortables=Class.refactor(Sortables,{start:function(a,b){var c=false;this.options.handle&&(c=b.getElement(this.options.handle));if(this.idle&&!(a.rightClick||["button","input","a","textarea"].contains(a.target.get("tag"))&&c!=a.target)){this.idle=false;this.element=b;this.opacity=b.get("opacity");this.list=b.getParent();this.clone=this.getClone(a,b);this.drag=(new Drag.Move(this.clone,Object.merge({droppables:this.getDroppables()},this.options.dragOptions))).addEvents({onSnap:function(){a.stop();this.clone.setStyle("visibility", "visible");this.element.set("opacity",this.options.opacity||0);this.fireEvent("start",[this.element,this.clone])}.bind(this),onEnter:this.insert.bind(this),onCancel:this.end.bind(this),onComplete:this.end.bind(this)});this.clone.inject(this.element,"before");this.drag.start(a)}}});Array.implement({difference:function(a){var b,c;if(this.length>a.length){b=this;c=a}else{b=a;c=this}return b.filter(function(a){return!c.contains(a)})}}); Number.implement({formatBigNumber:function(){var a=parseInt(this,10);return a<1E4?a.format():a<1E5?(a/1E3).format({decimals:1})+"K":a<1E6?(a/1E3).format({decimals:0})+"K":a<1E8?(a/1E6).format({decimals:1})+"M":a<1E9?(a/1E6).format({decimals:0})+"M":"\u221e"},formatTimecode:function(a){if(!a){a=this>=216E3?"hh:mm:ss":"mm:ss";if(this===0)return"00:00"}var b=a,a=[],b=b?b.split(":"):null,c,d,e;for(e=0;e=1024&&b<4;b++)a=a/1024;return a.toFixed(2)+["B","KB","MB","GB","TB"][b]}}); Element.implement("surround",function(a,b){var c=this;Array.slice(a).each(function(a){c.wraps(a,b)});return this});Element.implement("equalize",function(a,b){var c=!a?this.getChildren():this.getChildren(a),b=b||"height";max=0;prop=(typeof document.body.style.maxHeight!=="undefined"?"min-":"")+b;offset="offset"+b.capitalize();c.each(function(a){a=a[offset];a>max&&(max=a)});c.each(function(a){a.setStyle(prop,max-(a[offset]-a.getStyle(b).toInt()))});return max}); Element.implement("toQueryStringIgnoringSubForms",function(){var a=[],b=this;this.getElements("input, select, textarea").each(function(c){if(c.getParent("form").id===b.id){var d=c.type;if(c.name&&!c.disabled&&!(d=="submit"||d=="reset"||d=="file"||d=="image")){d=c.get("tag")=="select"?c.getSelected().map(function(a){return document.id(a).get("value")}):(d=="radio"||d=="checkbox")&&!c.checked?null:c.get("value");Array.from(d).each(function(b){typeof b!="undefined"&&a.push(encodeURIComponent(c.name)+ "="+encodeURIComponent(b))})}}});return a.join("&")}); Element.implement("setContextMenu",function(a){function b(a,b){var c=new Element("menu",{label:a.label,icon:a.icon});d(a.items,c);c.inject(b);return c}function c(a,b){return(new Element("menuitem",{label:a.label,icon:a.icon,events:{click:function(b){b.stop();a.url?window.location=a.url:a.action&&a.action.call()}}})).inject(b)}function d(a,d){a.each(function(a){a.items?b(a,d):c(a,d)})}if(!("contextMenu"in document.body)||!("HTMLMenuItemElement"in window))return false;if(typeOf(a)==="menu"){this.set("contextmenu", e);return true}var e=(new Element("menu",{id:(new Date).getTime(),type:"context"})).inject($(document.body));typeOf(a)==="array"?d(a,e):a.items?b(a,e):a.label&&c(a,e);this.set("contextmenu",e.get("id"));return true});Slick.definePseudo("input",function(){var a=this.nodeName.toLowerCase();return a==="input"||a==="select"||a==="textarea"||a==="button"}); Slick.definePseudo("textfield",function(){var a;if(this.nodeName.toLowerCase()==="input"){a=$(this).get("type");return a==="text"||a==="password"||a==="search"||a==="email"||a==="url"||a==="number"}});Object.extend({buildQueryString:function(a,b){var b=b||[],c=[];for(n in a)typeof a[n]=="object"?c.push(Object.buildQueryString(a[n],b)):b.indexOf(n)===-1&&((typeof a[n]=="string"||typeof a[n]=="number"||typeof a[n]=="boolean")&&a[n]!="")&&c.push(n+"="+encodeURIComponent(a[n]));return c.join("&")}}); Element.NativeEvents.transitionend=2;Element.NativeEvents.webkitTransitionEnd=2;Element.NativeEvents.oTransitionEnd=2;Element.NativeEvents.msTransitionEnd=2;Element.NativeEvents.message=2;Element.Events.transitionend={base:Browser.safari||Browser.chrome?"webkitTransitionEnd":Browser.opera?"oTransitionEnd":Browser.ie&&8=1){this.element.setStyle(this.transition,"none");this.element.setStyle(this.property,this.from[0].value+this.options.unit); e.delay(0.1)}else e();this.fireEvent("start",this);return this}return this.parent(a,b,c)},cancel:function(){if(this.css3Supported){this.element.setStyle(this.transition,"none");this.element.removeEvent("transitionend",this.boundComplete);this.boundComplete=null}this.parent();return this}});Locale.define("en-US","DatePicker",{select_a_time:"Select a time",use_mouse_wheel:"Use the mouse wheel to quickly change value",time_confirm_button:"OK",apply_range:"Apply",cancel:"Cancel",week:"Wk"}); Form.Validator=Class.refactor(Form.Validator,{test:function(a,b,c){b=document.id(b);if(this.options.ignoreHidden&&!b.isVisible()||this.options.ignoreDisabled&&b.get("disabled"))return true;var d=this.getValidator(a);c!=null&&(c=false);this.hasValidator(b,"warnOnly")&&(c=true);var e=b.hasClass("ignoreValidation")||(d?d.test(b):true);d&&b.isVisible()&&this.fireEvent("elementValidate",[e,b,a,c]);return c?true:e}});function str_repeat(a,b){for(var c=[];b>0;c[--b]=a);return c.join("")} function sprintf(){for(var a=0,b,c=arguments[a++],d=[],e,f,g;c;){if(e=/^[^\x25]+/.exec(c))d.push(e[0]);else if(e=/^\x25{2}/.exec(c))d.push("%");else if(e=/^\x25(?:(\d+)\$)?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fosuxX])/.exec(c)){if((b=arguments[e[1]||a++])==null||b==void 0)throw"Too few arguments.";if(/[^s]/.test(e[7])&&typeof b!="number")throw"Expecting number but found "+typeof b;switch(e[7]){case "b":b=b.toString(2);break;case "c":b=String.fromCharCode(b);break;case "d":b=parseInt(b);break; case "e":b=e[6]?b.toExponential(e[6]):b.toExponential();break;case "f":b=e[6]?parseFloat(b).toFixed(e[6]):parseFloat(b);break;case "o":b=b.toString(8);break;case "s":b=(b=String(b))&&e[6]?b.substring(0,e[6]):b;break;case "u":b=Math.abs(b);break;case "x":b=b.toString(16);break;case "X":b=b.toString(16).toUpperCase()}b=/[def]/.test(e[7])&&e[2]&&b>=0?"+"+b:b;f=e[3]?e[3]=="0"?"0":e[3].charAt(1):" ";g=e[5]-String(b).length-0;f=e[5]?str_repeat(f,g):"";d.push(""+(e[4]?b+f:f+b))}else throw"Huh ?!";c=c.substring(e[0].length)}return d.join("")} var ScrollSpy=new Class({Implements:[Options,Events],options:{container:window,max:0,min:0,mode:"vertical"},initialize:function(a){this.setOptions(a);this.container=document.id(this.options.container);this.enters=this.leaves=0;this.inside=false;var b=this;this.listener=function(a){var d=b.container.getScroll(),e=d[b.options.mode==="vertical"?"y":"x"];if(e>=b.options.min&&(b.options.max===0||e<=b.options.max)){if(!b.inside){b.inside=true;b.enters++;b.fireEvent("enter",[d,b.enters,a])}b.fireEvent("tick", [d,b.inside,b.enters,b.leaves,a])}else if(b.inside){b.inside=false;b.leaves++;b.fireEvent("leave",[d,b.leaves,a])}b.fireEvent("scroll",[d,b.inside,b.enters,b.leaves,a])};this.addListener()},start:function(){this.container.addEvent("scroll",this.listener)},stop:function(){this.container.removeEvent("scroll",this.listener)},addListener:function(){this.start()}}),ThrottledScrollSpy=new Class({Extends:ScrollSpy,has_scrolled:!0,polling:!1,interval:250,e:null,initialize:function(a){this.bound={setHasScrolled:this.setHasScrolled.bind(this)}; this.parent(a);setTimeout(this.checkScrollPosition.bind(this),this.interval)},checkScrollPosition:function(){if(this.has_scrolled){this.listener(this.e);this.e=null;this.has_scrolled=false}this.polling&&setTimeout(this.checkScrollPosition.bind(this),this.interval)},stopPolling:function(){this.polling=false},setHasScrolled:function(a){this.e=a;this.has_scrolled=true;if(!this.polling){this.polling=true;return this.checkScrollPosition()}setTimeout(this.stopPolling.bind(this),1E3)},start:function(){this.container.addEvent("scroll", this.bound.setHasScrolled)},stop:function(){this.container.removeEvent("scroll",this.bound.setHasScrolled)}}); (function(a){function b(a,b,c,d,i){this._listener=b;this._isOnce=c;this.context=d;this._signal=a;this._priority=i||0}function c(a,b){if(typeof a!=="function")throw Error("listener is a required param of {fn}() and should be a Function.".replace("{fn}",b));}var d={VERSION:"0.6.3"};b.prototype={active:true,params:null,execute:function(a){var b;if(this.active&&this._listener){a=this.params?this.params.concat(a):a;b=this._listener.apply(this.context,a);this._isOnce&&this.detach()}return b},detach:function(){return this.isBound()? this._signal.remove(this._listener):null},isBound:function(){return!!this._signal&&!!this._listener},getListener:function(){return this._listener},_destroy:function(){delete this._signal;delete this._listener;delete this.context},isOnce:function(){return this._isOnce},toString:function(){return"[SignalBinding isOnce: "+this._isOnce+", isBound: "+this.isBound()+", active: "+this.active+"]"}};d.Signal=function(){this._bindings=[]};d.Signal.prototype={_shouldPropagate:true,active:true,_registerListener:function(a, c,d,h){var i=this._indexOfListener(a);if(i!==-1){a=this._bindings[i];if(a.isOnce()!==c)throw Error("You cannot add"+(c?"":"Once")+"() then add"+(!c?"":"Once")+"() the same listener without removing the relationship first.");}else{a=new b(this,a,c,d,h);this._addBinding(a)}return a},_addBinding:function(a){var b=this._bindings.length;do--b;while(this._bindings[b]&&a._priority<=this._bindings[b]._priority);this._bindings.splice(b+1,0,a)},_indexOfListener:function(a){for(var b=this._bindings.length;b--;)if(this._bindings[b]._listener=== a)return b;return-1},add:function(a,b,d){c(a,"add");return this._registerListener(a,false,b,d)},addOnce:function(a,b,d){c(a,"addOnce");return this._registerListener(a,true,b,d)},remove:function(a){c(a,"remove");var b=this._indexOfListener(a);if(b!==-1){this._bindings[b]._destroy();this._bindings.splice(b,1)}return a},removeAll:function(){for(var a=this._bindings.length;a--;)this._bindings[a]._destroy();this._bindings.length=0},getNumListeners:function(){return this._bindings.length},halt:function(){this._shouldPropagate= false},dispatch:function(a){if(this.active){var b=Array.prototype.slice.call(arguments),c=this._bindings.slice(),d=this._bindings.length;this._shouldPropagate=true;do d--;while(c[d]&&this._shouldPropagate&&c[d].execute(b)!==false)}},dispose:function(){this.removeAll();delete this._bindings},toString:function(){return"[Signal active: "+this.active+" numListeners: "+this.getNumListeners()+"]"}};a.signals=d})(window||this); var Forage=new Class({Implements:[Options,Events],options:{autoQueue:!1,url:"/user/forage/",limit:50,excludeIds:[],onUserAdded:function(){},onUserRemoved:function(){},addEmails:!0},currentPage:0,users:{a:[],b:[],c:[],d:[],e:[],f:[],g:[],h:[],i:[],j:[],k:[],l:[],m:[],n:[],o:[],p:[],q:[],r:[],s:[],t:[],u:[],v:[],w:[],x:[],y:[],z:[],num:[]},numbers:"0123456789#!@".split(""),loadQueue:[],queueRunning:!1,pageList:"a b c d e f g h i j k l m n o p q r s t u v w x y z num".split(" "),REQUEST_DELAY:35,previousTerm:null, localResults:[],selectedEmails:[],searchAllUsersIndex:0,initialize:function(a,b){if($(a)===null)throw Error("Invalid element");this.setOptions(b);this.container=$(a);this.addedContainer=this.container.getElement(".fg_added");this.bucketList=this.container.getElement(".fg_bucket");this.searchView=this.container.getElement(".fg_search");this.searchResults=this.container.getElement(".fg_search_results");this.searchNoResults=this.container.getElement(".fg_search_no_results");this.searchAllResults=this.container.getElement(".fg_search_results_all_users"); this.seriouslyNoResults=this.container.getElement(".fg_seriously_no_results");this.resetSearch=this.container.getElement(".fg_reset_search");this.searchForm=this.container.getElement(".fg_search_form");this.logged_in=!this.searchForm.hasClass("logged_out");this.searchInput=this.container.getElement(".fg_search_input");this.clearSearchBtn=this.container.getElement(".fg_clear_search");if(this.logged_in){this.browseView=this.container.getElement(".fg_browse");this.pages=this.browseView.getElements("ol"); if(this.pagination=this.container.getElement(".fg_pagination"))this.pageLinks=this.pagination.getElement("ol").getElements("a")}this.createRequests();this.attachEvents();if(this.options.autoQueue){this.loadQueue=this.pageList;this.runQueue()}},createRequests:function(){this.queueRequest=new Request({url:this.options.url,method:"get",onSuccess:this.onQueueRequestSuccess.bind(this)});this.searchRequest=new Request({url:this.options.url,method:"get",onSuccess:this.onSearchAllSuccess.bind(this)})},attachEvents:function(){if(this.pagination){var a= this.pagination,b=a.getElement("a.prev"),a=a.getElement("a.next"),c=this.pageLinks.filter(function(a){return!a.getParent().hasClass("inactive")});if(this.logged_in){b&&b.addEvent("click",this.onPrevClick.bind(this));a&&a.addEvent("click",this.onNextClick.bind(this));this.pageLinks&&this.pageLinks.addEvent("click",this.onPageClick.bind(this));c&&!this.autoQueue&&c.addEvent("mousedown",this.onPreloadPage.bind(this))}}if(this.logged_in){this.searchInput.addEvent("focus",this.onSearchFocus.bind(this)); this.container.getElement(".fg_search_all_btn").addEvent("click",this.onSearchAllClick.bind(this));this.resetSearch.addEvent("click",this.onClearSearchClick.bind(this))}else{var d=$("add_email_btn");this.searchInput.addEvent("keyup",function(a){this.searchInput.get("value").test(/^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/)&&d.removeClass("btn_disabled").set("disabled",false);a.key==="enter"&&d.fireEvent("click")}.bind(this));d.addEvent("click",function(){var a=this.searchInput;if(a.get("value").test(/^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/)){this.addEmail(a.get("value")); d.addClass("btn_disabled").set("disabled",true);a.set("value","")}}.bind(this))}this.container.getElements("div.userlist").addEvent("click:relay(li)",this.onActionClick.bind(this));this.searchForm.addEvent("submit",Function.from(false))},runQueue:function(a){this.queueRunning=true;if(a){this.processAll=true;this.requestedPage=this.loadQueue;this.loadQueue=[]}else{this.processAll=false;a=this.loadQueue[0];this.loadQueue.splice(0,1);this.requestedPage=a}this.queueRequest.send({data:{action:"list",page:this.requestedPage, exclude_ids:this.options.excludeIds}})},createUserElements:function(a,b){var c=[],d,e;a.each(function(a){e=b?this.searchView:this.browseView;a.email&&this.browseView.getElements("li[data-user-id="+a.id+"]").set("data-user-email",a.email);if(!e.getElements("li[data-user-id="+a.id+"]").length){d=new Element("li",{"data-user-id":a.id,html:'"});a.email&&d.set("data-user-email",a.email);this.bucketList.getElement("li[data-user-id="+a.id+"]")&&d.addClass("disabled");c.push(d)}},this);return c},createUserMarkup:function(a,b){this.numbers.indexOf(a)>-1&&(a="num");var c=this.container.getElement(".fg_browse_"+a),d=this.createUserElements(b);c.adopt(d)},createSearchUserMarkup:function(a){a=this.createUserElements(a,true);this.searchResults.adopt(a);this.searchNoResults.hide();this.seriouslyNoResults.hide();this.searchResults.show()}, insertErrorMessage:function(a){var b=this.container.getElement(".fg_browse_"+a),c;if(b){(c=b.getElement("p.no_following"))&&c.destroy();b.adopt(new Element("p",{"class":"no_following",html:Copy.translate("no_followers_for_letter",false,{PAGE_LETTER:a})}))}this.pagination&&this.pagination.getElement('a[rel="'+a+'"]').getParent().addClass("inactive")},showSearch:function(){this.browseView.hide();this.searchView.show();this.clearSearchBtn!==null&&this.clearSearchBtn.show("inline-block");this.searchResults.empty()}, clearSearch:function(){this.localResults=[];this.searchInput.set("value","");this.browseView.show();this.searchView.hide();this.clearSearchBtn!==null&&this.clearSearchBtn.show("inline-block")},waitForSearchResults:function(){if(this.loadQueue.length===0){this.updateSearchPool();this.searchInput.removeEvents();this.searchInput.addEvent("keyup",this.onSearchKeyUp.bind(this));this.searchInput.addEvent("keydown",this.onSearchKeyDown.bind(this));this.clearSearchBtn!==null&&this.clearSearchBtn.addEvent("click", this.onClearSearchClick.bind(this));this.searchInput.get("value").length>3&&this.search(this.searchInput.get("value"))}else this.waitForSearchResults.delay(500,this)},updateSearchPool:function(){this.users=this.browseView.getElements("li[data-user-id]").filter(function(a){return a.getParent("ol").get("id")==="fg_browse_fav"?false:true})},refreshBucketList:function(){var a=this.addedContainer,b=this.bucketList.getChildren().length;this.updateCount(b);if(b>0){a.show();$("submit_forager")&&$("submit_forager").set("disabled", false)}else{a.hide();$("submit_forager")&&$("submit_forager").set("disabled",true)}},searchAll:function(){this.searchRequest.send({data:{action:"search",q:this.searchInput.get("value"),exclude_ids:this.options.excludeIds}})},addUser:function(a){if(a.get("data-user-email"))this.addEmail(a.get("data-user-email"));else{var b=a.get("data-user-id"),a=a.clone().inject(this.bucketList),c=$$(this.container.getElements("div.user_source").getElements("li[data-user-id="+b+"]").flatten());this.fireEvent("onUserAdded", {id:b,sources:c,clone:a});a.getElement("a.action").set("html",Copy.dict.remove);c.addClass("disabled")}},removeUser:function(a){var b=a.get("data-user-id"),c=$$(this.container.getElements("div.user_source").getElements("li[data-user-id="+b+"]").flatten());this.fireEvent("onUserRemoved",{id:b,sources:c,clone:a});c.removeClass("disabled");a.destroy()},updateCount:function(a){var b=this.options.limit;if(a>b){alert(Copy.dict.share_limit_reached);return false}if(this.counter=this.counter||this.container.getElement(".fg_added_count")){this.count= a;this.counter.set("text",a);if(a>=b-10){this.limitColor=this.limitColor||new Color("#fc575e");this.limitColor=this.limitColor.setBrightness(50+(50-5*(b-a)));this.counter.setStyle("color",this.limitColor)}else this.counter.setStyle("color","")}return true},onPreloadPage:function(a){a=a.target.get("rel");if(a!=="fav"&&this.pageList.contains(a)){a=this.pageList.indexOf(a);this.loadQueue.push(this.pageList.splice(a,1));this.queueRunning||this.runQueue()}},onPageClick:function(a){var b=a.target;a.stop(); $(b).getParent().hasClass("inactive")||this.loadPage(this.pageLinks.indexOf(b))},onPrevClick:function(a){a.stop();this.prevPage()},onNextClick:function(a){a.stop();this.nextPage()},onActionClick:function(a){a.preventDefault();var b=$(a.target);if(a=b.getParent("li")){var c=a.get("data-user-email")?"email":"user",b=b.getParent("ol")===this.bucketList?"remove":"add";if(a.hasClass("disabled"))return false;b==="add"?this.addUser(a):c==="email"?this.removeEmail(a.getElement("div.email").get("html"),a): this.removeUser(a);this.refreshBucketList();return true}},onSearchFocus:function(){if(this.pageList.length>0&&!this.options.autoQueue){this.loadQueue.combine(this.pageList);this.emptyList=Array.clone(this.pageList);this.pageList=[];this.queueRunning||this.runQueue(true)}this.waitForSearchResults()},onSearchKeyDown:function(a){a.code===13&&this.searchNoResults.isDisplayed()&&this.searchAll()},onSearchKeyUp:function(a){var b=this.localResults.length>0,c=this.searchInput.value.toLowerCase(),d=c.length, a=a.key==="backspace"||a.key==="delete",e;try{a?e=this.previousTerm.indexOf(c)===0&&d>2:this.previousTerm&&(e=c.indexOf(this.previousTerm)===0&&d>2)}catch(f){this.previousTerm===null&&(e=false)}this.is_email=c.test(/^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/);b&&e?a&&this.localResults.length===1&&c.length===1?this.clearSearch():this.filter(c,a):d>2?this.search(c):d===0&&this.clearSearch()},onClearSearchClick:function(a){a.stop();this.clearSearch()},onSearchAllClick:function(a){a.stop();this.searchAll()}, onQueueRequestSuccess:function(a){var a=JSON.decode(a),b,c;a.length===0&&this.insertErrorMessage(this.requestedPage[0]);for(b in a){c=this.numbers.indexOf(b)>-1?"num":b;if(a.hasOwnProperty(b)){this.emptyList&&this.emptyList.erase(c);this.createUserMarkup(c,a[b])}}this.emptyList&&this.emptyList.each(function(a){this.insertErrorMessage(a)},this);this.processAll?this.queueRunning=false:this.loadQueue.length>0?this.runQueue.delay(this.REQUEST_DELAY,this):this.queueRunning=false},onSearchAllSuccess:function(a){a= JSON.decode(a);if(a!==null&&a.length)this.createSearchUserMarkup(a);else{this.searchNoResults.hide();this.seriouslyNoResults.show()}},loadPage:function(a){var b=this.pages[a],c,d;if(!b.hasClass("active")){c=b.get("class").split("fg_browse_")[1];this.currentPage=a;this.browseView.getElement("ol.active").removeClass("active");if(this.pageList.contains(c)){d=this.pageList.indexOf(c);this.loadQueue.push(this.pageList.splice(d,1));this.queueRunning||this.runQueue()}if(this.loadQueue.contains(c)){d=this.loadQueue.indexOf(c); this.loadQueue.splice(d,1);this.loadQueue.splice(0,0,c)}this.clearSearch();b.addClass("active");this.pagination.getElement(".selected").removeClass("selected");this.pageLinks[a].getParent().addClass("selected")}},prevPage:function(){var a=--this.currentPage;this.pages[a]===null?this.currentPage++:this.pages[a].hasClass("empty")?this.prevPage():a>=0&&this.loadPage(a)},nextPage:function(){var a=++this.currentPage;this.pages[a]===null?this.currentPage--:this.pages[a].hasClass("empty")?this.nextPage(): a-1||a===b.get("data-user-id")});if(d.length===0){this.searchForm.hasClass("logged_out")||this.searchNoResults.show();this.searchResults.hide()}else{this.searchNoResults.hide(); this.seriouslyNoResults.hide();this.searchResults.show();if(b)c.show&&c.show("inline-block");else{this.localResults.push(d);try{e=c.difference(d);e.hide()}catch(h){}}this.previousTerm=a.toLowerCase()}}},search:function(a){var b,c=[],d,e=this.is_email;d=/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i; this.localResults=[];this.searchNoResults.hide();this.seriouslyNoResults.hide();this.searchResults.show();this.searchView.match(".active")||this.showSearch();this.updateSearchPool();b=this.users.filter(function(b){return e?a===b.get("data-user-email"):b.getElement("a.name").get("text").toLowerCase().indexOf(a.toLowerCase())>-1||a===b.get("data-user-id")});if(b.length>0){for(var f=0,g=b.length;f'+a+''+Copy.dict.add+"","class":"email_result"}));else{this.searchNoResults.show();this.searchResults.empty();this.searchResults.hide()}},addEmail:function(a){if(!this.selectedEmails.contains(a)){this.selectedEmails.push(a);(new Element("li",{"data-user-email":a,html:'"})).inject(this.bucketList);this.fireEvent("onUserAdded",a)}this.refreshBucketList()},removeEmail:function(a,b){this.fireEvent("onUserRemoved",a);this.selectedEmails.erase(a);b.destroy();this.refreshBucketList()},getUserIds:function(){var a;return this.bucketList.getElements("li[data-user-id]").map(function(b){return a=b.get("data-user-id")})},getEmails:function(){return this.selectedEmails},reset:function(){var a= $("message_input");this.clearSearchBtn&&this.clearSearchBtn.click();a&&a.set("value","");this.addedContainer.getElements(".action").each(function(a){a.click()})}}); Forage.Share=new Class({Extends:Forage,options:{form:null},initialize:function(a,b){this.setOptions(b);this.parent(a,b);this.form=$(this.options.form);this.setupForm()},setupForm:function(){var a=this;this.uids=this.form.getElement('input[name="user_ids"]');this.emails=this.form.getElement('input[name="user_emails"]');if(!this.uids){this.uids=new Element("input",{type:"hidden",name:"user_ids"});this.form.adopt(this.uids)}if(!this.emails){this.emails=new Element("input",{type:"hidden",name:"user_emails"}); this.form.adopt(this.emails)}$("submit_forager").addEvents({focus:this.onUpdateForm.bind(this),keydown:this.onUpdateForm.bind(this),mousedown:this.onUpdateForm.bind(this)});this.request=new Form.Request(this.form,null,{extraData:{action:"send_message"},onSend:function(){typeof ClipConfig!=="undefined"&&_gaq.push(["_trackEvent","sharebox","email",ClipConfig.clip_id])},onSuccess:function(){$("submit_forager").hide();$("submit_failure").addClass("hide");$("submit_success").removeClass("hide").set("tween", {duration:250,onComplete:function(){$("submit_success").addClass("hide");$("submit_forager").show();a.reset();try{Share.equalize()}catch(b){}}}).setStyle("opacity","1");setTimeout(function(){$("submit_success").tween("opacity",[1,0])},3500);try{Share.equalize()}catch(b){}},onFailure:function(){$("submit_forager").hide();$("submit_success").addClass("hide");$("submit_failure").removeClass("hide").set("tween",{duration:250,onComplete:function(){$("submit_failure").addClass("hide");$("submit_forager").show(); try{Share.equalize()}catch(a){}}}).setStyle("opacity","1");setTimeout(function(){$("submit_failure").tween("opacity",[1,0])},3500);try{Share.equalize()}catch(a){}}})},onUpdateForm:function(){this.uids.set("value",this.getUserIds().join(","));this.emails.set("value",this.getEmails().join(","))}}); var ColorPicker=new Class({Implements:[Options,Events],options:{initial_color:"#00adef",position:{edge:"upperLeft",position:"centerRight",offset:{x:0,y:0}},onUpdate:function(){},onSelect:function(){}},max_value:{H:359,S:100,V:100},color:null,previous_color:null,initialize:function(a,b){if($(a)===null)throw Error("Invalid trigger element supplied to ColorPicker");this.trigger=$(a);this.bound={onSatValMouseEvent:this.onSatValMouseEvent.bind(this),onHueMouseEvent:this.onHueMouseEvent.bind(this),onDocumentMouseUp:this.onDocumentMouseUp.bind(this), onBodyClick:this.onBodyClick.bind(this),onKeyUp:this.onKeyUp.bind(this)};this.setOptions(b);this.createElements();this.setDragArea();this.attachEvents();this.previous_color=this.options.initial_color;this.setColor(this.options.initial_color)},isValidHex:function(a){a=a.split("")[0]==="#"?a:"#"+a;return/^#[0-9a-f]{3}$|^#([0-9a-f]){6}$/i.test(a)},createElements:function(){this.widget=(new Element("div",{"class":"color_picker"})).inject($(document.body)).hide();this.sat_val_selector=(new Element("div", {"class":"sv_selector"})).inject(this.widget);this.sat_val_cursor=(new Element("div",{"class":"sv_cursor"})).inject(this.sat_val_selector);this.hue_wrapper=(new Element("div",{"class":"hue_wrapper"})).inject(this.widget);this.hue_selector=(new Element("div",{"class":"hue_selector"})).inject(this.hue_wrapper);this.hue_cursor=(new Element("div",{"class":"hue_cursor"})).inject(this.hue_wrapper);this.preview=(new Element("div",{"class":"preview_swatch"})).inject(this.widget);this.clear_div=(new Element("div", {"class":"clear"})).inject(this.widget);this.button_wrapper=(new Element("div",{"class":"button_wrapper"})).inject(this.widget);this.select_button=(new Element("button",{"class":"btn",html:"Select"})).inject(this.button_wrapper);this.or_span=(new Element("span",{html:" or "})).inject(this.button_wrapper);this.close_button=(new Element("a",{href:"#","class":"cancel",html:"cancel"})).inject(this.button_wrapper)},setDragArea:function(){var a,b;a=this.sat_val_selector.measure(function(){return this.getSize()}); b=this.hue_selector.measure(function(){return this.getSize()});this.sat_val_cursor_padding=this.sat_val_cursor.measure(function(){return this.getSize().x/2});this.hue_cursor_padding=this.hue_cursor.measure(function(){return this.getSize().y/2});this.sat_val_width=a.x;this.sat_val_height=a.y;this.hue_width=b.x;this.hue_height=b.y},attachEvents:function(){this.trigger.addEvent("click",this.onToggleClick.bind(this));this.sat_val_selector.addEvent("mousedown",this.bound.onSatValMouseEvent);this.hue_selector.addEvent("mousedown", this.bound.onHueMouseEvent);this.select_button.addEvent("click",this.onSelectClick.bind(this));this.close_button.addEvent("click",this.onCloseClick.bind(this))},moveCursor:function(a,b,c){var d=this[[a,"_cursor_padding"].join("")],e=this[[a,"_width"].join("")]-d,f=this[[a,"_height"].join("")]-d,b=Math.max(d,Math.min(b,e))-d,c=Math.max(d,Math.min(c,f))-d,a=this[[a,"_cursor"].join("")];a.setStyle("left",b);a.setStyle("top",c)},startTracking:function(a){[a.charAt(0).toUpperCase(),a.slice(1)].join(""); this[[a,"_selector"].join("")].addEvent("mousemove",this.bound[a==="hue"?"onHueMouseEvent":"onSatValMouseEvent"]);$(document.body).addEvent("mouseup",this.bound.onDocumentMouseUp)},update:function(a){var b=new Color([this.color.hsb[0],100,100],"hsb");this.sat_val_selector.setStyle("background-color",b.hex);this.preview.setStyle("background-color",this.color.hex);a===true&&this.repositionSliders();this.fireEvent("onUpdate",[this.color])},repositionSliders:function(){var a=0,b=0,c=0,a=Math.round((360- this.color.hsb[0])/360*(this.hue_height-this.hue_cursor_padding)),b=Math.round(this.color.hsb[1]/100*this.sat_val_width),c=Math.round((100-this.color.hsb[2])/100*this.sat_val_height);this.moveCursor("hue",0,a);this.moveCursor("sat_val",b,c)},positionWidget:function(){var a=this.options;this.widget.position({relativeTo:this.trigger,edge:a.position.edge,position:a.position.position})},onSatValMouseEvent:function(a){a.stop();var b=a.page,c=this.sat_val_selector.getCoordinates(),d=c.width,e=c.height, f=Math.max(0,Math.min(d,b.x-c.left)),b=Math.max(0,Math.min(e,b.y-c.top));a.type==="mousedown"&&this.startTracking("sat_val");this.moveCursor("sat_val",f,b);this.setSaturation(Math.round(f/d*100));this.setValue(Math.round(100-b/e*100));this.update()},onHueMouseEvent:function(a){a.stop();var b=a.page,c=this.hue_selector.getCoordinates(),d=c.height;Math.max(0,Math.min(c.width,b.x-c.left));b=Math.max(0,Math.min(d,b.y-c.top));a.type==="mousedown"&&this.startTracking("hue");this.moveCursor("hue",0,b);this.setHue(Math.round(360- b/d*360));this.update()},onDocumentMouseUp:function(){this.sat_val_selector.removeEvent("mousemove",this.bound.onSatValMouseEvent);this.hue_selector.removeEvent("mousemove",this.bound.onHueMouseEvent);$(document.body).removeEvent("mouseup",this.bound.onDocumentMouseUp)},onCloseClick:function(a){a.stop();this.revert();this.close()},onToggleClick:function(a){a.preventDefault();this.widget.isVisible()?this.close():this.open()},onSelectClick:function(a){a.stop();this.fireEvent("onSelect",[this.color]); this.previous_color=this.color.hex;this.close()},onBodyClick:function(a){var b=$(a.target).getParents();a.preventDefault();if(!b.contains(this.widget)){this.revert();this.close()}},onKeyUp:function(a){if(a.key==="esc"){this.revert();this.close()}},setHue:function(a,b){this.color=this.color.setHue(Math.max(0,Math.min(a,this.max_value.H)));b===true&&this.update()},setSaturation:function(a,b){this.color=this.color.setSaturation(Math.max(0,Math.min(a,this.max_value.S)));b===true&&this.update()},setValue:function(a, b){this.color=this.color.setBrightness(Math.max(0,Math.min(a,this.max_value.V)));b===true&&this.update()},setColor:function(a){if(this.color!==null)this.previous_color=this.color.hex;if(!this.isValidHex(a)){console.warn("Invalid hex_value supplied to ColorPicker.setColor()",a);a="#ffffff"}this.color=new Color(a);this.update(true)},revert:function(){this.color=new Color(this.previous_color);this.update()},open:function(){this.positionWidget();this.widget.show();$(document).addEvent("mousedown",this.bound.onBodyClick); $(document).addEvent("keyup",this.bound.onKeyUp)},close:function(){this.widget.hide();$(document).removeEvent("mousedown",this.bound.onBodyClick);$(document).removeEvent("keyup",this.bound.onKeyUp)}}),Revolver=new Class({Implements:[Options,Events],options:{startIndex:0,timerDelay:5E3,className:"fading_revolver",height:"auto",showFx:{property:"opacity",duration:525,transition:"sine:out"},hideFx:{property:"opacity",duration:250,transition:"sine:out"},showAllEl:void 0},paused:!1,timer:null,effect:null, currentIndex:0,delayCounter:-1,initialize:function(a,b,c){if($(a)===null)throw Error("Invalid element");this.setOptions(c);this.container=$(a);this.elements=b||this.container.getChildren();this.currentIndex=this.options.startIndex;this.bound={next:this.next.bind(this),onItemOver:this.onItemOver.bind(this),onItemOut:this.onItemOut.bind(this)};this.createElements();this.attachEvents();this.start()},createElements:function(){var a=this.options,b=this.container,c=this.options.showAllEl;this.showAllButton= c===void 0?this.createShowAllButton():$(c);b.addClass("revolver");b.addClass(a.className);typeOf(a.height)==="number"&&b.setStyle("height",a.height);this.elements[this.options.startIndex].addClass("active")},attachEvents:function(){this.showAllButton!==null&&this.showAllButton.addEvent("click",this.onShowAllToggle.bind(this));this.container.addEvents({mouseenter:this.bound.onItemOver,mouseleave:this.bound.onItemOut})},createShowAllButton:function(){return(new Element("a",{html:"View All","class":"revolver_view_all"})).inject(this.container, "after")},onShowAllToggle:function(a){a.stop();this.stop();this.showAll()},onItemOver:function(){this.paused=true;this.stop()},onItemOut:function(){this.paused=false;this.start()},start:function(){if(this.timer===null)this.timer=setInterval(function(){this.paused||this.next()}.bind(this),this.options.timerDelay)},stop:function(){if(this.timer!==null){clearInterval(this.timer);this.timer=null}},show:function(a,b){var c=this.elements[a];this.effect=new Fx.Tween.CSS3(c,this.options.showFx);this.effect.addEvent("complete", function(){c.addClass("active");typeof b!=="undefined"&&b.call()}.bind(this));this.effect.start(0,1)},hide:function(a,b){var c=this.elements[a];this.effect=new Fx.Tween.CSS3(c,this.options.hideFx);this.effect.addEvent("complete",function(){c.removeClass("active");typeof b!=="undefined"&&b.call()}.bind(this));this.effect.start(1,0)},showAll:function(){this.elements.each(function(a){a.erase("style");a.erase("class")},this);this.container.removeEvents({mouseenter:this.bound.onItemOver,mouseleave:this.bound.onItemOut}); this.container.addClass("show_all_revolver");this.showAllButton.destroy()},next:function(){var a=this.currentIndex+1;a>=this.elements.length&&(a=0);this.hide(this.currentIndex,function(){this.show(a);this.currentIndex=a}.bind(this))}}),AutoComplete=new Class({Implements:[Options,Events],options:{className:"ac_list",maxHeight:200,parentElement:null,disableParentForm:!0,limitedDisabledParent:!1,autoSelect:!0,hideOnEmptySet:!0,url:null,action:"suggest",limit:10,pollingThreshold:125,minimumLength:3,onLoadStart:function(){}, onLoadComplete:function(){},onOpen:function(){},onClose:function(){},onSuggestionSelect:function(){},showOnFocus:!0,showOnClick:!0,stopOn:null,requestData:{}},focusIndex:-1,suggestionsLoaded:!1,open:!1,initialize:function(a,b){if($(a)===null)throw Error("Invalid element");this.setOptions(b);this.input=$(a);this.url=this.options.url||this.input.getParent("form").get("action");this.bound={bodyClick:this.onBodyClick.bind(this),mouseMove:this.onMouseMove.bind(this),suggestionOver:this.onSuggestionOver.bind(this), suggestionOut:this.onSuggestionOut.bind(this),suggestionClick:this.onSuggestionClick.bind(this),delayedSearch:this.delayedSearch.bind(this)};this.createElements();this.createRequest();this.attachEvents()},createElements:function(){var a=this.options,a=a.parentElement===null?this.input.getParent():a.parentElement;this.container=(new Element("div",{"class":this.options.className})).setStyles({display:"none",width:this.calculateWidth(),"max-height":this.options.maxHeight+"px"}).inject(a).position({relativeTo:this.input, position:"bottomLeft",edge:"topLeft"});this.input.set("autocomplete","off")},createRequest:function(){this.ajaxRequest=new Request.HTML({url:this.url,method:"get",update:this.container,onSuccess:this.onSearchLoaded.bind(this)})},attachEvents:function(){var a={keydown:this.onKeyDown.bind(this),keyup:this.onKeyUp.bind(this)};if(this.options.showOnClick)a.click=this.onFocus.bind(this);if(this.options.showOnFocus)a.focus=this.onFocus.bind(this);this.input.addEvents(a);this.container.addEvent("scroll", this.onListKeyDown.bind(this));this.enableMouseEvents();this.options.disableParentForm&&!this.options.limitedDisabledParent&&this.input.getParents("form").addEvent("submit",Function.from(false))},enableMouseEvents:function(){this.container.addEvent("mouseover:relay(li)",this.bound.suggestionOver);this.container.addEvent("mouseout:relay(li)",this.bound.suggestionOut);this.container.addEvent("click:relay(li)",this.bound.suggestionClick);this.container.removeEvent("mousemove",this.bound.mouseMove)}, disableMouseEvents:function(){this.container.removeEvent("mouseover:relay(li)",this.bound.suggestionOver);this.container.removeEvent("mouseout:relay(li)",this.bound.suggestionOut);this.container.removeEvent("click:relay(li)",this.onSuggestionClick.bind(this));this.container.addEvent("mousemove",this.bound.mouseMove)},calculateWidth:function(){var a=this.input,b=parseInt(a.getStyle("width"),10),c=a.getStyle("padding").split(" "),a=a.getStyle("box-sizing")==="border-box"?0:parseInt(c[1],10)+parseInt(c[3], 10);return b+a+"px"},delayedSearch:function(){this.ajaxDelay&&clearTimeout(this.ajaxDelay);this.search(this.input.get("value"))},focusNext:function(){var a=this.container.getElements("li");this.focusIndex++;if(this.focusIndex>=a.length)this.focusIndex=a.length-1;this.updateFocus()},focusPrev:function(){this.focusIndex--;if(this.focusIndex<0)this.focusIndex=0;this.updateFocus()},updateFocus:function(){var a=this.container.getElements("li");this.focusedItem&&this.focusedItem.removeClass("selected"); this.focusedItem=a[this.focusIndex];this.focusedItem.addClass("selected");this.checkScroll()},checkScroll:function(){var a=this.focusedItem,b=this.container.getSize().y,a=a.getSize().y;this.container.scrollTo(0,a*(this.focusIndex-Math.floor(b/2/a)))},getNearestLI:function(a){a=$(a);return a.get("tag")==="li"?a:a.getParents("li")},onFocus:function(){this.suggestionsLoaded&&this.showSuggestions()},onListKeyDown:function(){this.input.focus()},onKeyDown:function(a){if(this.options.stopOn!==null&&this.input.get("value").test(this.options.stopOn))this.clearSuggestions(); else{if(this.options.limitedDisabledParent&&this.container.isDisplayed()){this.input.getParents("form").addClass("disabled");this.input.getParents("form").addEvent("submit",this.empty)}var b=a.key,c=this.container.isDisplayed();a.key==="up"&&a.preventDefault();switch(b){case "up":if(c){this.focusPrev();this.disableMouseEvents()}break;case "down":if(c){this.focusNext();this.disableMouseEvents()}}}},onKeyUp:function(a){a.stop();var b=a.key,c=this.input.get("value"),d=this.container.isDisplayed(),e= /[a-zA-Z0-9]/;if(this.options.limitedDisabledParent&&this.container.isDisplayed()){this.input.getParents("form").removeClass("disabled");this.input.getParents("form").removeEvent("submit",this.empty)}switch(b){case "enter":if(d&&this.focusedItem){this.hideSuggestions();this.fireEvent("onSuggestionSelect",[this.focusedItem,this.input,a]);this.fireEvent("select",{item:this.focusedItem,input:this.input})}break;case "esc":d&&this.hideSuggestions();break;default:c.length>=this.options.minimumLength&&(b.length=== 1&&b.match(e)||b==="backspace")?this.ajaxDelay=this.bound.delayedSearch.delay(this.options.pollingThreshold):c.length===0&&this.reset()}},onMouseMove:function(){this.enableMouseEvents()},onSearchLoaded:function(){var a=this.container.getElements("li:not(.no_matches)").length===0;this.fireEvent("onLoadComplete");if(a&&this.options.hideOnEmptySet)return false;this.suggestionsLoaded=true;this.showSuggestions();if(!a&&this.options.autoSelect){this.focusIndex=-1;this.focusNext()}this.options.highlight&& this.highlightTerms();return true},highlightTerms:function(){var a=this.input.get("value"),b=this.container.getElements("li.searchable a");b&&b.each(function(b){b.set("html",b.get("text").toString().highlightTerm(a))})},onSuggestionOver:function(a){a.stop();this.focusedItem&&this.focusedItem.removeClass("selected");this.focusedItem=a.target.tagName.toString().toLowerCase()==="li"?a.target:a.target.getParent("li");this.focusedItem.addClass("selected");this.focusIndex=this.container.getElements("li").indexOf(this.focusedItem)}, onSuggestionOut:function(a){a.stop();this.focusedItem&&this.focusedItem.removeClass("selected");this.focusedItem=null},onSuggestionClick:function(a){this.focusedItem=a.target.tagName.toString().toLowerCase()==="li"?a.target:a.target.getParent("li");this.fireEvent("onSuggestionSelect",[this.focusedItem,this.input]);this.fireEvent("select",{item:this.focusedItem,input:this.input});this.hideSuggestions()},onBodyClick:function(a){var b=$(a.target).getParents();a.target!==this.container&&(!b.contains(this.container)&& !b.contains(this.input))&&(!this.input.getParent("label")||!b.contains(this.input.getParent("label")))&&this.hideSuggestions()},onBlur:function(a){this.hideSuggestions();parent.onBlur(a)},refreshPosition:function(){this.container.position({relativeTo:this.input,position:"bottomLeft",edge:"topLeft"})},showSuggestions:function(){this.container.position({relativeTo:this.input,position:"bottomLeft",edge:"topLeft"}).show();$(document).addEvent("mousedown",this.bound.bodyClick);this.open=true;this.fireEvent("onOpen")}, hideSuggestions:function(){this.container.hide();$(document).removeEvent("mousedown",this.bound.bodyClick);this.open=false;this.fireEvent("onClose")},clearSuggestions:function(){this.hideSuggestions();this.container.empty()},search:function(a){var b=this.options;this.fireEvent("onLoadStart");a=Object.merge(b.requestData,{search:a,limit:b.limit,action:b.action});this.ajaxRequest.send({data:a,link:"cancel"})},reset:function(){this.focusIndex=-1;this.suggestionsLoaded=false;this.clearSuggestions();this.input.set("value", "")},empty:function(){return false}}),Oracle=new Class({Extends:AutoComplete,user_id:null,data_store:{},storage:null,base_url:"/search",selected:null,params:{},initialize:function(a,b){if("localStorage"in window&&window.localStorage!==null)this.storage=window.localStorage;this.parent(a,b);this.params=b.params||{}},createElements:function(){var a,b,c,d=this;this.parent();this.container.addClass("oracle");a=(new Element("ul")).inject(this.container);a=(new Element("li")).inject(a);this.basic_search= (new Element("a",{text:Copy.dict.search_all,href:"javascript:void(0)"})).inject(a);this.basic_search.addEvent("click",function(a){if(d.input.get("value")==="")window.location="/search";if(c=d.input.getParent("form")){a.stop();d.updateSearchHistory(d.input.value);c.getElement("input[type=submit]").click()}});this.results=(new Element("div",{"class":"results"})).inject(this.container);if(this.storage&&this.storage.getItem("oracle_history")){b=(new Element("section",{"class":"recent"})).inject(this.container).adopt(new Element("span.section_header", {text:Copy.dict.recent_searches})).adopt(this.getSearchHistoryMarkup());b.getElements("li a").addEvents({mouseover:function(a){d.selectedIndex=b.getElements("li a").indexOf(a.target);d.selectedItem=this},mouseout:function(){d.selected=null},click:function(a){if(c=d.input.getParent("form")){a.stop();d.input.set("value",this.get("html"));c.getElement("input[type=submit]").click()}}});this.input.addEvent("keyup",function(a){if(a.key=="backspace"&&d.selectedIndex!=null){a=d.storage.getItem("oracle_history").split("|"); a.splice(d.selectedIndex,1);d.storage.setItem("oracle_history",a.join("|"));d.selectedItem.dispose()}})}this.footer=(new Element("section",{"class":"advanced"})).inject(this.container);footer_ul=(new Element("ul")).inject(this.footer);this.footer_item=(new Element("li")).inject(footer_ul);this.advanced_search_h1=(new Element("span.section_header",{text:Copy.dict.advanced_search})).inject(this.footer);this.advanced_search=(new Element("a",{text:Copy.dict.advanced_search,href:"/search"})).inject(this.footer_item); this.input.addEvent("keyup",this.onInputKeyUp.bind(this));this.onInputKeyUp()},createRequest:function(){this.ajaxRequest=new Request.JSON({method:"get",url:"/search/preload",onSuccess:this.onSearchLoaded.bind(this)})},getSearchHistoryMarkup:function(){var a=this.storage.getItem("oracle_history").split("|"),b=new Element("ul"),c=this,d=new Hash(this.options.params),e,f;a.each(function(a){f=decodeURIComponent(a);e=f.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g, "'").replace(/\//g,"/");b.adopt(new Element("li",{html:''+e+"","class":"searchable"}))});return b},updateSearchHistoryMarkup:function(){this.storage.getItem("oracle_history");var a=this.container.getElements(".recent ul li a"),b=this,c=(new Hash(this.options.params)).toQueryString(),d;a.each(function(a){d=a.get("href").split("?")[1];a.set("href",b.base_url+"?"+d+(c.length>0?"&"+c:""))})},updateSearchHistory:function(a){var b= this.storage,c=b.getItem("oracle_history"),c=c?c.split("|"):[];if(!(c.contains(a)||a.trim().length===0)){c.length>=5&&c.pop();c.splice(0,0,encodeURIComponent(a));b.setItem("oracle_history",c.join("|"))}},setBaseUrl:function(a){this.base_url=a||"/search"},buildMenu:function(a){var b=this.input;b.getParent().get("action");var b=b.get("value"),c=new Element("div"),d,e,f;Object.each(a,function(a,b){e=b.split(" ").join("_").toLowerCase();d=(new Element("section",{"class":e})).inject(c);section_title=(new Element("span.section_header", {text:b})).inject(d);f=(new Element("ol")).inject(d);Object.each(a,function(a,b){(new Element("li")).adopt(new Element("a",{href:a,text:b})).inject(f)})});this.advanced_search.set("href","/search/?q="+b+"&panel=1");this.results.set("html",c.get("html"))},onFocus:function(){this.showSuggestions();this.suggestionsLoaded||this.ajaxRequest.send()},onSearchLoaded:function(a){var b=this.input.get("value");this.data_store=a;this.suggestionsLoaded=true;Object.each(a,function(a,b){this[b+"_keys"]=Object.keys(a); this[b+"_values"]=Object.values(a)},this);b&&b.length>=3&&this.search(b)},onKeyUp:function(a){a.stop();var b=a.key,c=this.input,d=c.get("value"),e=d.length,f=this.container.isDisplayed(),g=/[a-zA-Z0-9]/;switch(b){case "enter":if(f&&this.focusedItem){this.hideSuggestions();this.updateSearchHistory(d);this.fireEvent("onSuggestionSelect",[this.focusedItem,c,a])}break;case "esc":f&&this.hideSuggestions();break;default:e>=this.minimumLength&&b.length===1&&b.match(g)?this.ajaxDelay=this.bound.delayedSearch.delay(this.options.pollingThreshold): b==="backspace"||b=="space"?e>=this.minimumLength?this.search(d):this.results.empty():e===0&&this.reset()}},onSuggestionClick:function(a){this.updateSearchHistory(this.input.get("value"));this.parent(a)},onInputKeyUp:function(){var a=this.input.get("value").trim();if(a.length0){this.buildMenu(b);this.showSuggestions();this.results.hasClass("no_results")&&this.results.removeClass("no_results");if(this.options.autoSelect){this.focusIndex=-1;this.focusNext()}}else if(a.length===0)this.results.empty();else{this.results.set("html", "
"+Copy.dict.no_suggestions+"
").addClass("no_suggestions");this.showSuggestions();this.focusIndex=-1;this.focusNext()}},clearSuggestions:function(){this.hideSuggestions();this.results.empty()},reset:function(){this.focusIndex=-1;this.input.set("value","")}}),Illuminati=new Class({Extends:Oracle,createElements:function(){this.parent();this.suggestionFill=$("search_suggest");this.cachedSuggestions=[];this.usedAutocomplete=false;this.input.addEvent("onKeyDown",function(){this.showInlineSuggestion()})}, base_url:"/search",selected:null,limit:7,callback:"Global.oracle.search",pollingThreshold:50,minimumLength:2,createRequest:function(){this.ajaxRequest=new Request.JSON({method:"get",url:"/search/suggest",onSuccess:this.onSearchLoaded.bind(this)})},updateFocus:function(){this.parent();var a=this.focusedItem,b=this.input;a.hasClass("searchable")&&b.set("value",a.get("text"))},onFocus:function(){this.showSuggestions()},onSuggestionSelect:function(){this.usedAutocomplete=false},onSuggestionOver:function(a){this.parent(a); var a=this.input,b=this.focusedItem;this.suggestionFill.set("value","");if(b.hasClass("searchable")){a.set("data-cached-value",a.get("value"));a.set("value",b.get("text"))}},onSuggestionOut:function(a){this.parent(a);this.input.set("value",this.input.get("data-cached-value"));this.showInlineSuggestion()},onKeyDown:function(a){var b=this.input,c=this.suggestionFill;if(a.key==="tab"){a.preventDefault();b.set("value",c.get("value"));this.usedAutocomplete=true;if(this.options.autoSelect)this.focusIndex= -1}this.parent(a)},onKeyUp:function(a){this.showInlineSuggestion();if(this.suggestionSection&&this.input.get("value").length0){if(!this.suggestionSection){this.suggestionSection=(new Element("section",{"class":"suggestions"})).inject(this.container,"top");this.suggestions_ul=(new Element("ul")).inject(this.suggestionSection)}d.each(function(a){var b;b=(new Element("li",{"class":"searchable"})).inject(this.suggestions_ul);(new Element("a",{text:a,href:"/search?q="+encodeURIComponent(a)})).inject(b)}.bind(this));this.showSuggestions();this.highlightTerms()}else{this.focusIndex=-1;this.focusNext()}}},showInlineSuggestion:function(){var a= this.input.get("value").toLowerCase(),b=this.cachedSuggestions[0],c=this.suggestionFill;this.suggestionSection&&(b&&a.length>=this.minimumLength&&b.test(a)?c.set("value",b):c.set("value",""))},showSuggestions:function(){this.showInlineSuggestion();this.parent()},hideSuggestions:function(){this.parent();this.suggestionFill.set("value","")},search:function(a){this.showSuggestions();this.fireEvent("onLoadStart");this.ajaxRequest.send({data:{search:encodeURI(a),limit:this.limit,callback:this.callback}})}}), Lightbox=new Class({Implements:[Options,Events],options:{url:null,html:null,stop_links:!0,data:"",uid:"",className:"default_lightbox",position:"fixed",width:"auto",height:"auto",top:"auto",scrollIntoView:!1,cache:!0,iframe:!1,onOpen:function(){},onLoad:function(){},onClose:function(){}},standAloneMode:!1,currentContent:null,defaultOptions:this.options,initialize:function(a,b){this.setOptions(b);this.defaultOptions=Object.clone(this.options);a!==null?$$(a).each(function(a){if(a.get("data-lightbox-defined")!== "true"){a.addEvent("click",this.onLinkClick.bind(this));a.set("data-lightbox-defined","true")}},this):this.standAloneMode=true;var c=this.options.uid;if($("lightbox_container"+c)!==null){this.container=$("lightbox_container"+c);this.content=$("lightbox_content"+c);this.overlay=$("lightbox_overlay"+c)}else{this.createElements();this.updateStyles();this.attachEvents()}},createElements:function(){var a=$(document.body),b=this.options.uid;this.content=new Element("div",{id:"lightbox_content"+b,"class":"lightbox_content"}); this.closeButton=new Element("a",{id:"lightbox_close"+b,"class":"close undertaker",html:"×",title:typeof Copy!="undefined"&&typeof Copy.dict!="undefined"&&typeof Copy.dict.close!="undefined"?Copy.dict.close:"Close"});this.container=(new Element("div",{id:"lightbox_container"+b})).adopt(this.closeButton,this.content).hide().inject(a);this.overlay=(new Element("div",{id:"lightbox_overlay"+b,"class":"lightbox_overlay"})).hide().inject(a)},createRequest:function(){this.request=new Request.HTML({method:"get", update:this.content,onSuccess:this.onAjaxSuccess.bind(this)})},updateStyles:function(){var a=this.options,b=this.container,c=this.content;b.erase("class");a.className!==null&&b.set("class",a.className);this.container.addClass(this.currentContent);b.setStyle("position",a.position);c.setStyle("width",a.width);c.setStyle("height",a.height);this.centerWindow()},centerWindow:function(){var a=$(window),b=this.options,c=this.container,d=a.getSize(),e=c.getSize(),f=Math.max(0,d.x*0.5-e.x*0.5),d=Math.max(0, d.y*0.5-e.y*0.5);if(b.top!=="auto")d=b.top;b.position==="absolute"&&(d=d+a.getScroll().y);c.setPosition({x:f,y:d})},attachEvents:function(){this.overlay.addEvent("click",this.onCloseClick.bind(this));this.container.addEvent("click:relay(.close)",this.onCloseClick.bind(this))},parseInlineOptions:function(a){var b=new Hash,c,d;a.split("|").each(function(a){a=a.substr(0,a.indexOf("="))+"|"+a.substr(a.indexOf("=")+1);a=a.split("|");c=a[0];d=a[1].toString();if(c==="width"||c==="height")d.indexOf("px")=== -1&&(d=d+"px");b.set(c,d)});return b},getContentType:function(a){var b;b=/(http(s?):)|([\/|.|\w|\s])*\.(?:jpg|gif|png)/.test(a.toLowerCase());return this.currentContent=a=this.options.iframe===true?"iframe":b?"image":a.length>1&&a.substr(0,1)==="#"?"div":"ajax"},validateHash:function(a){return $(a.substr(1,a.length))!==null},onLinkClick:function(a){if(this.options.stop_links){a.stop();if(a.target){a.target.removeEvents("click");a.target.addEvent("click",this.onLinkClick.bind(this))}}var b,c;b=$(a.target); b.get("data-lightbox")===null&&(b=$(a.target).getParents("[data-lightbox]")[0]);this.setOptions(this.defaultOptions);a=b?b.get("href"):null;c=b?b.get("data-lightbox-options"):null;b=$H(this.defaultOptions);if(c!==null&&typeof c!=="object"&&c.length>0){c=this.parseInlineOptions(c);Object.append(b,c)}c=b.getClean();this.setOptions(c);b=this.options.url;if(this.options.title&&this.options.description)this.loadHTML(this.createBasicLightbox(this.options.title,this.options.description));else{if(b!==null)a= b.toString();else if(a!==null)a=a.toString();else{if(this.options.html){this.loadHTML(this.options.html);return}console.info(c);throw Error('Your element must have an "href" property or you must pass a custom URL in the options parameter of this class');}a!==this.container.get("data-url")?this.load(a,this.options.data):this.open()}},createBasicLightbox:function(a,b){return"

"+a+'

'+b+"

"},onCloseClick:function(){this.close()},onKeyUp:function(a){a.key=== "esc"&&this.close()},onWindowResize:function(){this.centerWindow()},onAjaxSuccess:function(){this.options.cache===true?this.container.set("data-url",this.lastUrlRequest):this.container.set("data-url",(new Date).getTime());this.fireEvent("onLoad");this.open()},onImageSuccess:function(){this.content.empty().adopt(new Element("img",{src:this.lastUrlRequest}));this.options.cache===true?this.container.set("data-url",this.lastUrlRequest):this.container.set("data-url",(new Date).getTime());this.fireEvent("onLoad"); this.open()},load:function(a,b){var c=this.options.url||a,d=this.getContentType(c),e=c!==null;d==="div"&&(e=this.validateHash(c));if(e)d==="ajax"?this.loadAjax(c,b):d==="iframe"?this.loadIFrame(c):d==="image"?this.loadImage(c):this.loadDiv(c);else throw Error("A null URL was passed to Lightbox.load()");},loadIFrame:function(a){this.lastUrlRequest=a;a=new IFrame({src:a,frameborder:0,events:{load:function(){this.fireEvent("onLoad")}},styles:{width:this.options.width,height:this.options.height}});this.content.empty().adopt(a); this.container.set("data-url",this.lastUrlRequest);this.open()},loadAjax:function(a,b){this.request||this.createRequest();this.lastUrlRequest=a;this.request.send({url:a,data:b||this.options.data});this.fireEvent("onOpen")},loadImage:function(a){this.lastUrlRequest=a;new Asset.image(a,{onLoad:this.onImageSuccess.bind(this)});this.fireEvent("onOpen")},loadDiv:function(a){a=$(a.substr(1,a.length));this.placeholder=(new Element("div#lightbox_placeholder")).wraps(a);this.content.empty().adopt(a);this.container.set("data-url", "#"+a.get("id"));this.fireEvent("onLoad");this.open()},loadHTML:function(a){a=Elements.from(a);this.content.empty().adopt(a);this.container.set("data-url",(new Date).getTime());this.fireEvent("onLoad");this.open()},open:function(){var a=this,b=this.options,c=this.content.getElement(":textfield");this.updateStyles();var d=this.overlay.getStyle("opacity"),e=this.container.getStyle("opacity");this.overlay.setStyle("opacity",0).show();this.container.setStyle("opacity",0).show();this.centerWindow();setTimeout(function(){a.overlay.setStyle("opacity", d);a.container.setStyle("opacity",e)},100);c&&(!c.get("disabled")&&c.get("autofocus"))&&setTimeout(function(){c.focus()},100);if(b.position==="absolute"&&(b.scrollIntoView===true||b.scrollIntoView==="true")){this.scroll=this.scroll||new Fx.Scroll(window,{duration:200,transition:Fx.Transitions.Expo.easeOut});this.scroll.toTop()}$(document).addEvent("keyup",this.onKeyUp.bind(this));$(window).addEvent("resize",this.onWindowResize.bind(this));this.fireEvent("onOpen")},close:function(){var a;this.overlay.hide(); this.container.hide();$(document).removeEvent("keyup",this.onKeyUp.bind(this));$(window).removeEvent("resize",this.onWindowResize.bind(this));if(this.placeholder){this.content.getFirst().replaces(this.placeholder);this.placeholder=null;this.container.set("data-url","")}var b=this.content.getElement("form");if(b){b.retrieve("validator")&&b.retrieve("validator").reset();b.reset()}this.fireEvent("onClose");try{a=document.createEvent("UIEvent");a.initEvent("close",false,false);document.dispatchEvent(a)}catch(c){}}}), Singletonbox={instance:null,open:function(a){var b,c;this.instance!==null&&this.instance.close();this.instance=new Lightbox(null,a);(b=a.url)&&b.length>1?b.substr(0,1)==="#"?this.instance.loadDiv(b):this.instance.loadAjax(a.url):(c=a.html)&&this.instance.loadHTML(c);return this},close:function(){if(this.instance===null)throw Error("Singletonbox has not been instantiated. Unable to close.");this.instance.close();this.instance=null},centerWindow:function(){if(this.instance===null)throw Error("Singletonbox has not been instantiated. Unable to close."); this.instance.centerWindow()},alert:function(a,b){Singletonbox.open({width:"500px",html:"

"+a+'

'+b+"

"})}},ToggleBox=new Class({Implements:[Options,Events],options:{onOpen:function(){},onClose:function(){},onToggle:function(){}},initialize:function(a,b){if($(a)===null)throw Error("Invalid element");if($($(a).get("data-trigger"))===null)throw Error("Toggle box is missing a trigger");this.setOptions(b);this.element=$(a);this.trigger=$(this.element.get("data-trigger")); if(!this.trigger.hasClass("toggle_box_trigger")){this.element.store("togglebox",this);this.trigger.store("togglebox",this);this.trigger.addClass("toggle_box_trigger");this.attachEvents()}},attachEvents:function(){this.trigger.get("type")==="radio"?this.trigger.getParent("form").addEvent('click:relay(input[name="'+this.trigger.get("name")+'"])',this.onToggleRadio.bind(this)):this.trigger.addEvent("click",this.onToggle.bind(this))},onToggle:function(a){if(this.trigger.get("type")==="checkbox")this.toggleRadioCheck(); else{this.toggleNormal();a&&a.stop()}},onToggleRadio:function(){this.toggleRadioCheck()},toggleRadioCheck:function(){this.trigger.get("checked")?this.show():this.hide()},toggleNormal:function(){var a,b;if(this.trigger.get("data-swap-text")){a=this.trigger.get("text");b=this.trigger.get("data-swap-text");this.trigger.set("text",b);this.trigger.set("data-swap-text",a)}this.trigger.get("data-checked")||this.trigger.set("data-checked","off");if(this.trigger.get("data-checked")==="off"){this.trigger.set("data-checked", "on");this.show()}else if(this.trigger.get("data-checked")==="on"){this.trigger.set("data-checked","off");this.hide()}},show:function(){var a=this.element.getElement(":input");this.element.show();a&&(!a.get("value")&&a.get("autofocus"))&&a.focus();a&&a.get("data-autoselect")&&a.select();this.fireEvent("open");this.fireEvent("toggle")},hide:function(){this.element.hide();this.fireEvent("close");this.fireEvent("toggle")}}),Toggler=new Class({Implements:[Options,Events],options:{className:"skinned_checkbox", content:"•"},initialize:function(a,b){this.setOptions(b);this.checkboxes=$$(a);if(this.checkboxes===null)return false;this.checkboxes.each(function(a){this.createReplacement(a)},this)},createReplacement:function(a){var b=this.options.className,c=a.get("id")||["checkbox_",Math.floor(Math.random()*999999999)].join(""),d=new Element("label",{"class":b,html:this.options.content});a.get("checked")===true&&d.addClass(b+"_active");d.inject(a,"after");a.set("id",c).addEvent("change",this.onCheckboxChange.bind(this)); a.setStyles({position:"absolute",left:"-9999px"});a.store("replacement",d);d.store("original",a);d.getParent().get("tag")!=="label"&&d.set("for",c);a.get("disabled")&&$$('label[for="'+c+'"]').each(function(a){a.addClass("disabled")})},onCheckboxChange:function(a){var b=this.options.className+"_active",a=$(a.target),c=a.retrieve("replacement");if(a.type=="radio"){if(a.get("checked")===true){this.checkboxes.each(function(a){a.retrieve("replacement").removeClass(b)},this);c.addClass(b)}}else a.get("checked")=== true?c.addClass(b):c.removeClass(b)}}),KeyManager=new Class({inputFocused:!1,initialize:function(){this.document=$(document);this.bound={onKeyUp:this.onKeyUp.bind(this),onInputClick:this.onInputClick.bind(this),onInputFocus:this.onInputFocus.bind(this),onInputBlur:this.onInputBlur.bind(this)};this.attachEvents()},attachEvents:function(){this.document.addEvent("keyup",this.bound.onKeyUp);if(!document.activeElement){this.document.addEvent("click:relay(input)",this.bound.onInputClick);this.document.addEvent("click:relay(textarea)", this.bound.onInputClick)}},trigger:function(a){var b=this["keycode_"+a+"_method"],c;if(document.activeElement){c=$(document.activeElement);c=c.get("tag");c=c==="input"||c==="textarea"}else c=this.inputFocused;!c&&b&&b.attempt(this["keycode_"+a+"_params"])},onKeyUp:function(a){this.trigger(a.key)},onInputClick:function(a){a=$(a.target);a.addEvents({focus:this.bound.onInputFocus,blur:this.bound.onInputBlur});a.removeEvent("click",this.bound.onInputClick)},onInputFocus:function(){this.inputFocused=true}, onInputBlur:function(){this.inputFocused=false},register:function(a,b,c){this["keycode_"+a+"_method"]=b;this["keycode_"+a+"_params"]=c},unregister:function(a){this["keycode_"+a+"_method"]=null;this["keycode_"+a+"_params"]=null}}),TimeUpdater={interval:null,TIMEOUT:3E4,update:function(){$$("#comments time").each(function(a){var b=Math.floor((new Date).getTime()/1E3),c=Math.floor((new Date(a.get("datetime"))).getTime()/1E3),d=b-c,e=null,f="";if(d<60&&(f="seconds_ago"))e=Math.floor(d);else if(d<3600&& (f="minutes_ago"))e=Math.floor(d/60);else if(d<86E3&&(f="hours_ago"))e=Math.floor((b-c)/3600);d<86400&&a.set("html",Copy.translate(f,e!==1,{COUNT:e}))})},start:function(){TimeUpdater.interval=setInterval(TimeUpdater.update,TimeUpdater.TIMEOUT)},stop:function(){clearInterval(TimeUpdater.interval);TimeUpdater.interval=null}},Share={storage:null,initialize:function(){var a=$("share_popup");Share.loadDependencies();Share.columns=a.getElements(".col");if(Share.columns.length>=2)Share.columnPadding=Share.columns[0].getStyle("padding-top").toInt()+ Share.columns[0].getStyle("padding-bottom").toInt();if(Cookie.read("embed_preferences"))Share.storage=JSON.decode(Cookie.read("embed_preferences"));a.getElements(".toggle_box").each(function(a){new ToggleBox(a,{onToggle:function(){Share.equalize()}})});Share.equalize();$("message_input")&&$("message_input").addEvent("keyup",this.onMessageUpdate);if(typeof FB!=="undefined"){FB.Event.subscribe("edge.create",function(){_gaq.push(["_trackSocial","facebook","like"])});FB.Event.subscribe("edge.remove", function(){_gaq.push(["_trackSocial","facebook","unlike"])})}$$('#social_share img[src*="btn_fb_share"]').addEvent("click",function(){_gaq.push(["_trackSocial","facebook","post"])})},loadDependencies:function(){Share.onForageLoaded()},equalize:function(){var a,b;if(Share.columns.length<2)return false;Share.columns.each(function(a){a.erase("style")});Share.columns.each(function(c,d){a=c.measure(function(){return this.getSize().y});if(d===0||a>b)b=a-Share.columnPadding});Share.columns.each(function(a){a.setStyle("height", b+"px")});return true},onForageLoaded:function(){Share.forage=new Forage.Share("fg",{addEmails:!$("fg").hasClass("no_email"),form:"mailer",onUserAdded:function(){setTimeout(function(){Share.equalize()},50)},onUserRemoved:function(){setTimeout(function(){Share.equalize()},50)}});Global.lightbox.centerWindow();Global.shareLightbox&&Global.shareLightbox.centerWindow();Global.xsrfProtect()},onColorPickerLoaded:function(){var a;if($("share_embed")){if(Share.storage)a=Share.storage.color;if($("color_picker_toggle"))Embed.colorPicker= new ColorPicker("color_picker_toggle",{initial_color:a||$("embed_color").get("value"),onUpdate:function(a){a=a.hex.toLowerCase();Embed.customizations.colorInput.set("value",a);Embed.setColor(a)},onSelect:function(a){a=a.hex.toLowerCase();Embed.customizations.colorInput.set("value",a);Embed.setColor(a);Embed.refreshEmbedCode()}})}},onMessageUpdate:function(){$("message").set("text",this.value)}},Embed={customizations:{},warnings:{},originalValues:{},codeRequest:null,initialize:function(){if(!$("share_embed"))return false; Embed.clipId=$("embed_clip_id").get("value");Embed.textArea=$("embed_code");Embed.customizeView=$("embed_customize");Embed.customizeToggle=$("embed_customize_toggle");Embed.codeToggles=$("embed_generator").getElements("a.embed_code_toggle");Embed.previewPlayer=$("embed_preview").getElement(['*[id*="player',Embed.clipId,'"]'].join(""));Embed.customizations={widthInput:$("embed_width"),heightInput:$("embed_height"),titleCheckbox:$("embed_title"),bylineCheckbox:$("embed_byline"),portraitCheckbox:$("embed_portrait"), badgeCheckbox:$("embed_badge"),autoplayCheckbox:$("embed_autoplay"),loopCheckbox:$("embed_loop"),linkCheckbox:$("embed_link"),descriptionCheckbox:$("embed_description"),staticColors:$("embed_customize").getElements(".color_block"),colorInput:$("embed_color")};Embed.warnings={size:$("size_alert"),autoplay:$("autoplay_alert"),loop:$("loop_alert"),caption:$("text_alert"),link:$("link_alert"),description:$("description_alert"),link_description:$("link_description_alert")};Embed.originalValues={width:$("embed_orig_width").get("value"), height:$("embed_orig_height").get("value")};Embed.codeRequest=new Request({url:"/embed",method:"get",link:"cancel",onSuccess:Embed.onEmbedCodeSuccess});$("embed_customize").getElements(".toggle_box").each(function(a){(new ToggleBox(a)).addEvent("onToggle",function(){Share.equalize()})});Share.onColorPickerLoaded();Embed.attachEvents();Embed.refreshEmbedCode();try{Singletonbox.centerWindow()}catch(a){}},attachEvents:function(){Object.each(Embed.customizations,function(a){$(a)&&$(a).addEvent("change", Embed.onOptionChange)});[Embed.customizations.widthInput,Embed.customizations.heightInput].each(function(a){a.addEvent("keydown",Embed.onDimensionKeyDown);a.addEvent("blur",Embed.onDimensionBlur)});Embed.customizations.staticColors.addEvent("click",Embed.onStaticColorSelected);Embed.customizations.colorInput.addEvent("keydown",Embed.onColorKeyDown);Embed.textArea.addEvent("click",Embed.onTextAreaClick);$("old_code").addEvent("click",function(){Embed.refreshEmbedCode(true)})},resetSize:function(){Embed.customizations.widthInput.set("value", Embed.originalValues.width);Embed.customizations.heightInput.set("value",Embed.originalValues.height)},calculateSize:function(a){var b;switch(a){case "x":case "width":a=Embed.customizations.heightInput.get("value");b=Embed.originalValues.width/Embed.originalValues.height;break;case "y":case "height":a=Embed.customizations.widthInput.get("value");b=Embed.originalValues.height/Embed.originalValues.width;break;default:throw Error("Invalid direction");}return Math.round(a*b)},resetWarnings:function(){Object.each(Embed.warnings, function(a){$(a).hide()})},checkWarnings:function(){var a=Embed.customizations,b=Embed.warnings;Embed.resetWarnings();a.autoplayCheckbox.get("checked")&&b.autoplay.show();a.loopCheckbox.get("checked")&&b.loop.show();if(a.linkCheckbox.get("checked")||a.descriptionCheckbox.get("checked")){b.caption.show();a.descriptionCheckbox.get("checked")&&a.linkCheckbox.get("checked")?b.link_description.show("inline"):a.descriptionCheckbox.get("checked")?b.description.show("inline"):a.linkCheckbox.get("checked")&& b.link.show("inline")}Share.equalize()},refreshEmbedCode:function(a){var b=Embed.customizations;Embed.checkWarnings();Embed.savePreferences();Embed.codeRequest.send({data:{clip_id:Embed.clipId,width:b.widthInput.get("value"),height:b.heightInput.get("value"),title:b.titleCheckbox.get("checked")?1:0,byline:b.bylineCheckbox.get("checked")?1:0,portrait:b.portraitCheckbox.get("checked")?1:0,badge:b.badgeCheckbox&&b.badgeCheckbox.get("checked")?1:0,autoplay:b.autoplayCheckbox.get("checked")?1:0,loop:b.loopCheckbox.get("checked")? 1:0,color:b.colorInput.get("value"),link:b.linkCheckbox.get("checked")?1:0,caption:b.descriptionCheckbox.get("checked")?1:0,iframe:a===true?false:true}});a===true?$("code_notice").setStyle("visibility","hidden"):$("code_notice").setStyle("visibility","visible")},savePreferences:function(){var a=Embed.customizations,a=JSON.encode({width:a.widthInput.get("value").toInt(),title:a.titleCheckbox.get("checked")?1:0,byline:a.bylineCheckbox.get("checked")?1:0,badge:a.badgeCheckbox&&a.badgeCheckbox.get("checked")? 1:0,portrait:a.portraitCheckbox.get("checked")?1:0,autoplay:a.autoplayCheckbox.get("checked")?1:0,loop:a.loopCheckbox.get("checked")?1:0,color:a.colorInput.get("value"),link:a.linkCheckbox.get("checked")?1:0,caption:a.descriptionCheckbox.get("checked")?1:0});Cookie.write("embed_preferences",a,{domain:vimeo.domain,path:"/",duration:365})},refreshPreview:function(a){var b=Embed.customizations,c=a.get("checked");switch(a){case b.titleCheckbox:Embed.toggleElement("title",c);break;case b.bylineCheckbox:Embed.toggleElement("byline", c);break;case b.portraitCheckbox:Embed.toggleElement("portrait",c);break;case b.badgeCheckbox:Embed.toggleElement("badge",c);break;default:throw Error("Invalid option supplied.");}},onTextAreaClick:function(a){if(!this.get("data-ios")){a.stop();this.focus();this.select()}},onDimensionKeyDown:function(a){var b=this,c=a.code,d=a.key,e=Embed.customizations.widthInput,f=Embed.customizations.heightInput;(c>47&&c<58||c>95&&c<106)&&!a.shift||d==="delete"||d==="backspace"||d==="tab"||d==="left"||d==="right"|| d==="up"||d==="down"?setTimeout(function(){b===e?f.set("value",Embed.calculateSize("height")):e.set("value",Embed.calculateSize("width"))},50):a.preventDefault()},onDimensionBlur:function(){(Embed.customizations.widthInput.get("value")===""||Embed.customizations.heightInput.get("value")==="")&&Embed.resetSize()},onOptionChange:function(){var a=Embed.customizations;(this===a.titleCheckbox||this===a.bylineCheckbox||this===a.portraitCheckbox||this===a.badgeCheckbox)&&Embed.refreshPreview(this);Embed.refreshEmbedCode()}, onStaticColorSelected:function(a){var b=["#",this.get("data-hex")].join("");a.stop();Embed.customizations.colorInput.set("value",b);Embed.onOptionChange(null);Embed.colorPicker.setColor(b)},onColorKeyDown:function(a){var b=a.key,c=a.shift,d=b==="delete"||b==="backspace"||b==="tab"||b==="left"||b==="right"||b==="up"||b==="down",e=!c&&/[a-fA-F0-9]/.test(b);!e&&(!(c&&b==="3")&&!d)&&a.preventDefault()},onEmbedCodeSuccess:function(a){Embed.textArea.set("value",a.clean());Share.equalize()},onPlayerLoaded:function(){}, toggleElement:function(a,b){Embed.previewPlayer=Embed.previewPlayer||$("embed_preview").getElement(['*[id*="player',Embed.clipId,'"]'].join(""));Embed.previewPlayer.api_toggleElement(a,b)},setColor:function(a){Embed.previewPlayer=Embed.previewPlayer||$("embed_preview").getElement(['*[id*="player',Embed.clipId,'"]'].join(""));a.substr(0,1)==="#"&&(a=a.substr(1));try{Embed.previewPlayer.api_changeColor(a)}catch(b){}}},Hashtag={patterns:[],get:function(a){a=a?(new URI(location.toString())).get("fragment").toString().match(a): (new URI(location.toString())).get("fragment").toString();return a!==null?a.toString():null},set:function(a){location.hash=a},register:function(a,b){Hashtag.patterns.push({pattern:a,selector:b})},find:function(){for(var a,b=0,c=Hashtag.patterns,d=c.length;b-1&&(!Object.contains(objects,b)&&e.toUpperCase()===e&&e!=="$"&&e!=="_")&&(a[b.toLowerCase()+".js"]=b)}}objects=Object.merge(objects,a);return a} var Global={resize_callbacks:[],initialize:function(){Global.lightbox=new Lightbox("[data-lightbox]",{onLoad:Global.onLightboxLoad});Global.keyManager=new KeyManager;Global.testForConsole();Global.xsrfProtect();Global.protectSubmits();Global.trackAnalytics();Global.setupFormPlaceholders();Global.setupVoicetron();Global.attachSmoothScroll();Global.teleportElements();Global.setupLanguageSelector();Global.setupContentFilterSelector();Global.createRatingRequest();Global.bindPrefTips();Global.resize_callbacks.push(Global.onResizeAutoWidth); $(window).addEvent("resize",Global.onWindowResize);Global.onWindowResize();Signal.browse.ajax.success.add(Global.bindPrefTips);Signal.browse.cache.success.add(Global.bindPrefTips);if("pushState"in window.history){Global.checkConvertPushState();window.History&&History.addEvent&&History.addEvent("change",Global.onHistoryChange)}else window.location.toString().indexOf("#")>-1&&Global.checkConvertPushState();Global.scroll=Global.scroll||new Fx.Scroll(window,{duration:500,transition:Fx.Transitions.Expo.easeOut}); Global.initToggleBoxes();var a=$("search_field");if(a){Global.oracle=a.get("data-search-engine")==="illuminati"?new Illuminati(a,{disableParentForm:false,maxHeight:400}):new Oracle(a,{disableParentForm:false,maxHeight:400});Global.oracle.addEvent("onSuggestionSelect",function(a){a=a.getElement("a").get("href");if(a.toString().trim().length>0){window.location=a;return false}})}var b={duration:1E3,delay:5E3,transition:"quad:out"};$$("[data-ephemeral]").each(function(a){var d=b,e;try{e=JSON.decode(a.get("data-ephemeral"))}catch(f){}e&& (d=Object.merge(b,e));setTimeout(function(){(new Fx.Tween.CSS3(a,d)).addEvent("complete",function(){a.addClass("hide")}).start("opacity",100,0)},d.delay)});$$("[data-accordion]").length>0&&new Fx.Accordion("li.toggler",".description",{duration:125,transition:Fx.Transitions.Quad.easeOut,onActive:function(a,b){var e=$(b).getParents("li")[0].addClass("active");e.getElement(".toggle")&&e.getElement(".toggle").set("html","")},onBackground:function(a,b){var e=$(b).getParents("li")[0].removeClass("active"); e.getElement(".toggle")&&e.getElement(".toggle").set("html","+")}});window.embedWindowPopup=window.shareWindowPopup=function(a){var b=typeof ClipConfig!=="undefined";Singletonbox.open({url:"/"+a+"?action=share",uid:"_share",width:540,position:"absolute",top:b?111:"auto",onClose:function(){this.container.dispose()}});b&&Global.scroll.toElement("wrap");return true};window.editWindowPopup=function(a,b,e){Singletonbox.open({url:"/tools/edit?type="+a+"&data="+b+"&clip_id="+e,width:960,position:"absolute", top:50});return true};Global.initLocale();Global.initNotifications()},initNotifications:function(){if(typeof GlobalNotifications!=="undefined"){var a=(new Element("ul")).set("id","global_notifications").inject($("wrap"),"top");GlobalNotifications.each(function(b){var c=(new Element("li")).set("id","notification_"+b.id).addClass("notification").set("html","

"+b.message+"

").set("data-ga-event-visible","notification|loaded|"+b.id).inject(a),d=c.getElements("a");d&&d.each(function(a){a.set("data-ga-event-click", "notification|clicked|"+b.id)});(new Element("a")).addClass("undertaker").set("html","×").addEvent("click",Global.hideNotification).set("data-ga-event-click","notification|closed|"+b.id).inject(c,"top")})}},initToggleBoxes:function(){$$(".toggle_box").each(function(a){new ToggleBox(a)})},initLocale:function(){if(typeof fullLocale!=="undefined"&&typeof localeConfig!=="undefined"){Locale.inherit(fullLocale,"en-US");for(var a in localeConfig)Locale.define(fullLocale,a,localeConfig[a]);Locale.use(fullLocale)}}, testForConsole:function(){if(typeof window.console==="undefined")window.console={log:function(){},info:function(){},warn:function(){},error:function(){},debug:function(){},clear:function(){}}},protectSubmits:function(){var a;$$("form").each(function(b){b.getElements("input[type=submit]").addEvent("click",function(){a=this});if(b.get("data-ds-protection"))return false;b.set("data-ds-protection","enabled");b.addEvent("submit",function(){if(!a||a.get("data-disable-protect")||b.retrieve("validator")&& !b.retrieve("validator").validate(null,true)||b.hasClass("disabled"))return false;a.addClass("btn_gray").set("data-reset-copy",a.get("value")).set("value",a.get("data-submit-text")||a.get("value"));setTimeout(function(){a.set("disabled",true)},100)});b.addEvent("reset",function(){var a;this.getElements("input[type=submit]").each(function(b){(a=b.get("data-reset-copy"))&&b.set("value",a).removeClass("btn_gray").removeProperties("disabled","data-reset-copy")})})})},trackAnalytics:function(){$$("[data-ga-event-click]:not([data-tracked])").addEvent("click", function(){var a=this.get("data-ga-event-click").split("|");window._gaq&&window._gaq.push(["_trackEvent",a[0],a[1],a[2]])}).set("data-tracked","tracked");$$("[data-ga-event-visible]:not([data-tracked])").each(function(a){a=a.get("data-ga-event-visible").split("|");window._gaq&&window._gaq.push(["_trackEvent",a[0],a[1],a[2],void 0,true])}).set("data-tracked","tracked")},setupFormPlaceholders:function(){"placeholder"in document.createElement("input")||$$("[placeholder]").each(function(a){new OverText(a, {textOverride:a.get("placeholder")})})},setupVoicetron:function(){if(document.createElement("input").webkitSpeech!==void 0){var a;$$("input[data-speech-enabled]").each(function(b){b.set("x-webkit-speech","x-webkit-speech");a=b.getParents("form")[0];a.addClass("voicetron");b.onwebkitspeechchange=function(a){a.results[0].utterance.toLowerCase()==="shut down everything"?Global.shutDownEverything():$(this).getParents("form")[0].submit()}})}},teleportElements:function(){var a;$$("[data-teleport]").each(function(b){(a= $(b.get("data-teleport")))&&b.replaces(a).erase("data-teleport")})},bindPrefTips:function(){var a,b,c,d;if(vimeo.cur_user!==null){a=$$("[data-tip-id]");if(a.length!==0){c=new Request({url:vimeo.cur_user.url,method:"post"});a.each(function(a){a.addEvent("click",function(f){f.preventDefault();c.send({data:{action:"set_tip",token:vimeo.xsrft,id:a.get("data-tip-id")}});if(b=a.getParent("[data-tip-action]")){d=b.get("data-tip-action");d==="destroy"?b.destroy():d==="hide"&&b.hide()}Signal.tip.close.dispatch({tipEl:b})})})}}}, checkConvertPushState:function(){var a=window.location.toString(),b=a.indexOf("#/"),c=a.substr(0,b);if(b!==-1){b=a.substr(b+1,a.length);c=c.lastIndexOf(b.substr(0,3));a=[a.substr(0,c),b].join("");Global.redirecting=true;window.removeEvents("domready");(new URI(a)).go()}},onResizeAutoWidth:function(){window.getSize().x<960?$(document.body).hasClass("min_width")||$(document.body).addClass("min_width"):$(document.body).removeClass("min_width")},onWindowResize:function(){Global.resize_callbacks.each(function(a){a(window)})}, onHistoryChange:function(a){Global.refreshAds();window._gaq&&_gaq.push(["_trackPageview",a])},onLightboxLoad:function(){var a=this.content.getElement('form input:not([type="hidden"])');a&&setTimeout(function(){a.focus()},500)},xsrfProtect:function(){$$("form[method=post]").each(function(a){if(a.getElement("input[name=token]")===null){(new Element("input",{type:"hidden",name:"token",value:vimeo.xsrft})).inject(a,"bottom");a.retrieve("form.request")===null&&a.addEvent("submit",function(){Cookie.write("xsrft", vimeo.xsrft,{domain:vimeo.domain,path:"/"})})}})},attachSmoothScroll:function(){$(document.body).addEvent("click:relay(a.smooth)",function(a){a.stop();Global.smoothScroll(this.get("href"),null,{set_hash:true})})},smoothScroll:function(a,b,c){var d,e=Object.merge({set_hash:false,full_href:false,callback:null},c);if(typeof a==="string"){d=a.contains("#")?a.split("#")[1]:a;c=$(d)}else{c=$(a);d=c.get("id")}b=Global.scroll.toElement(c,b?-20:0);d&&(window.Hashtag&&e.set_hash===true)&&b.chain(function(){Hashtag.set(typeof a=== "string"&&e.full_href?a:d)});typeof e.callback==="function"&&b.chain(e.callback);return b},getVersion:function(){var a=Object.clone(Browser);["Document","Element","Window","Event"].each(function(b){a[b]!==null&&delete a[b]});return JSON.encode(a)},insertAsset:function(a,b,c,d){d=d||{};if(a!=="css"&&a!=="javascript")throw Error('Invalid asset type supplied to Global.insertAsset(). Value can only be one of "css" or "javascript"');switch(a){case "javascript":a=(new URI(b)).parsed.file.replace(/[^0-9a-z.]/g, "").split(".min.").join(".");if(objects[a])Global.executeFunctionsInList(d,"onload");else{b=Asset.javascript(b,d);b.addEvent("load",checkObjects)}break;case "css":Asset.css(b,Object.merge({},{id:c},d))}},loadScripts:function(a,b){var c=a[a.length-1];Global.insertAsset("javascript",c+".js?"+BUILD_HASH,c+"_js",{onLoad:function(){a.pop();a.length>0?Global.loadScripts(a,b):b()}})},waitFor:function(a,b){var c,d,e=0;c=0;for(d=a.length;c ",id:"everything",styles:{position:"fixed",top:0,bottom:0,left:0,right:0,"z-index":9999,padding:"10px","background-color":"#000",color:"#0f0","font-family":"monospace","letter-spacing":"1px"},events:{click:function(){this.destroy();clearInterval(Global.dos_timer)},keydown:function(a){if(a.code===13){a.stop();this.set("value",this.get("value")+"\nInvalid command.\n\nc:\\> ")}}}})).adopt(new Element("span", {html:"_",id:"dos_cursor"})).inject(document.body);$("everything").focus();$("everything").setCaretPosition(5);Global.dos_timer=setInterval(function(){var a=$("dos_cursor");a.isVisible()?a.hide():a.show()},500)},refreshAds:function(){var a;(a=$$(".ad_box:not(.disable_refresh)"))&&a.each(function(a){var c="ad"+Math.random(),d=a.getElement("iframe"),e=a.get("data-type");if(e)if(e.indexOf("main:")>-1)e.split(":");else if(e.indexOf("plus:")>-1)e.split(":");else return false;a.set("id",c);d&&d.set("src", d.get("src"))})},hideNotification:function(){var a=$("notifications"),b=this.getParent();b.set("tween",{duration:300,onComplete:function(){Cookie.write(b.get("id"),Math.round((new Date).getTime()/1E3),{domain:vimeo.domain,path:"/",duration:7});b.destroy();a&&a.get("html").trim()===""&&a.getParent().hide()}});b.tween("opacity",0)}}; window.addEvent("domready",function(){Global.initialize();Global.vimeo_objects=checkObjects();window.whyYesIDoLikeJavaScript=function(){window.location="http://vimeo.com/jobs"};var a=["Ahhhh\u2026greetings, fellow internet developer! We\u2019ve been looking for you: http://vimeo.com/jobs","Do you like JavaScript too? --\> whyYesIDoLikeJavaScript()","Are you here for the Profiles tab? If performance and profiling is your cup of tea, we\u2019d love to chat! http://vimeo.com/jobs","You\u2019ll never see this printed to the console, but while you\u2019re here, why not see if you can \u201cshut down everything\u201d? Love, @restlessdesign"], b;a.pop();b=Math.floor(Math.random()*a.length);console.log(a[b])}); var Navigation={currentIndex:-1,drawerOpen:!1,DRAWER_OPENED_HEIGHT:110,DRAWER_CLOSED_HEIGHT:48,DRAWER_OPEN_DELAY:100,DRAWER_CLOSE_DELAY:400,SUB_MENU_OPENED_HEIGHT:74,SUB_MENU_CLOSED_HEIGHT:0,SUB_MENU_OPEN_DELAY:70,SUB_MENU_DELAY:50,initialize:function(){Navigation.header=$("site_header");if(Navigation.header){Navigation.bound={openDrawer:Navigation.openDrawer.bind(Navigation),closeDrawer:Navigation.closeDrawer.bind(Navigation),showMenu:Navigation.showMenu.bind(Navigation),hideMenu:Navigation.hideMenu.bind(Navigation), onHeaderOver:Navigation.onHeaderOver.bind(Navigation),onHeaderOut:Navigation.onHeaderOut.bind(Navigation)};Navigation.createElements();Navigation.setupAnimation();Navigation.attachEvents()}},createElements:function(){var a=$("menu"),b=0,c=["login","join","upload"],d=c.length,e;Navigation.container=Navigation.header.getFirst(".container");Navigation.mainLinks=a.getElements("li.subnav > a");Navigation.subMenus=a.getElements("li.subnav > ul");Navigation.staticLinks=[$("logo"),$("search_form")];for(b= 0;b a");e!==null&&Navigation.staticLinks.push(e)}},setupAnimation:function(){$(document.body);Navigation.container.set("tween",{property:"height",duration:120,transition:Fx.Transitions.Expo.easeInOut})},attachEvents:function(){var a=$("search_form");new Form.Validator(a);Navigation.mainLinks.each(function(a){a.addEvent("mouseover",Navigation.onLinkOver);a.addEvent("mouseout",Navigation.onLinkOut);a.addEvent("touchend",Navigation.onLinkOver)});Navigation.subMenus.each(function(a){a.addEvent("mouseover", Navigation.onSubMenuOver)})},openDrawer:function(){Global.oracle.hideSuggestions();Navigation.container.setStyle("overflow","hidden");if(!Navigation.container.hasClass("active")){Navigation.container.addClass("active");if(Navigation.transitions_suppported){Navigation.container.addEventListener("webkitTransitionEnd",Navigation.onDrawerOpenComplete,false);Navigation.container.addEventListener("oTransitionEnd",Navigation.onDrawerOpenComplete,false);Navigation.container.addEventListener("transitionend", Navigation.onDrawerOpenComplete,false)}else Navigation.container.get("tween").addEvent("complete",Navigation.onDrawerOpenComplete).start(Navigation.DRAWER_OPENED_HEIGHT)}},closeDrawer:function(){if(Navigation.container.hasClass("active")){Navigation.container.removeClass("active");if(Navigation.transitions_suppported){Navigation.container.addEventListener("webkitTransitionEnd",Navigation.onDrawerCloseComplete,false);Navigation.container.addEventListener("oTransitionEnd",Navigation.onDrawerCloseComplete, false);Navigation.container.addEventListener("transitionend",Navigation.onDrawerCloseComplete,false)}else Navigation.container.get("tween").addEvent("complete",Navigation.onDrawerCloseComplete).start(Navigation.DRAWER_CLOSED_HEIGHT)}},showMenu:function(a){var b=Navigation.subMenus[a];Navigation.currentIndex>-1&&Navigation.hideMenu();b.addClass("active");Navigation.currentIndex=a},hideMenu:function(){Navigation.subMenus[Navigation.currentIndex].removeClass("active")},subscribeClose:function(){Navigation.header.addEvent("mouseleave", Navigation.bound.onHeaderOut);Navigation.staticLinks.each(function(a){a.addEvent("mouseover",Navigation.bound.onHeaderOut)})},unsubscribeClose:function(){Navigation.header.removeEvent("mouseleave",Navigation.bound.onHeaderOut);Navigation.staticLinks.each(function(a){a.removeEvent("mouseover",Navigation.bound.onHeaderOut)})},cancelDrawerTimer:function(){clearTimeout(Navigation.drawerKiller);Navigation.drawerKiller=null},onDrawerOpenComplete:function(){Navigation.container.get("tween").removeEvent("complete", Navigation.onDrawerOpenComplete);Navigation.drawerOpen=true;Navigation.drawerOpenDelay=null},onDrawerCloseComplete:function(){Navigation.container.get("tween").removeEvent("complete",Navigation.onDrawerCloseComplete);Navigation.drawerOpen=false;Navigation.header.removeClass("force_open");Navigation.container.removeProperty("style");Navigation.subMenus.removeClass("active")},onLinkOver:function(a){Navigation.header.addClass("force_open");Navigation.queued_index=Navigation.mainLinks.indexOf($(a.target)); Navigation.drawerKiller!==null&&Navigation.cancelDrawerTimer();if(Navigation.drawerOpen){Navigation.subMenuDelay!==null&&clearTimeout(Navigation.subMenuDelay);Navigation.subMenuDelay=setTimeout(function(){Navigation.showMenu(Navigation.queued_index);Navigation.subscribeClose()},Navigation.SUB_MENU_DELAY)}else{if(!Navigation.drawerOpenDelay)Navigation.drawerOpenDelay=setTimeout(function(){Navigation.openDrawer();Navigation.transitions_suppported||Navigation.showMenu(Navigation.queued_index)},Navigation.DRAWER_OPEN_DELAY); Navigation.transitions_suppported&&Navigation.showMenu(Navigation.queued_index);Navigation.subscribeClose()}vimeo.config.prevent_nav&&a.stop()},onLinkOut:function(){Navigation.subMenuDelay!==null&&clearTimeout(Navigation.subMenuDelay);clearTimeout(Navigation.drawerOpenDelay);Navigation.drawerOpenDelay=null},onSubMenuOver:function(){Navigation.drawerKiller!==null&&Navigation.cancelDrawerTimer()},onHeaderOver:function(){Navigation.drawerKiller!==null&&Navigation.cancelDrawerTimer();Navigation.header.removeEvent("mouseenter", Navigation.bound.onHeaderOver)},onHeaderOut:function(){Navigation.drawerKiller!==null&&Navigation.cancelDrawerTimer();Navigation.header.addEvent("mouseenter",Navigation.bound.onHeaderOver);Navigation.drawerKiller=setTimeout(function(){if(Navigation.drawerKiller!==null){Navigation.closeDrawer();Navigation.unsubscribeClose()}},Navigation.DRAWER_CLOSE_DELAY)}};window.addEvent("domready",function(){Navigation.initialize()}); var AboutTip=function(){function a(){c.send({data:{action:"get_tip"}})}var b,c;return{initialize:function(){b=$("get_tip");c=new Request.HTML({url:"/about",method:"get",update:"tip_content"});b&&b.addEvent("click",a)}}}();window.addEvent("domready",function(){AboutTip.initialize()});