window.RT=window.RT||{};var asiPqTag=false;var cb=new Date().getTime();try{document.write("<script type='text/javascript' language='JavaScript' src='http://pq-direct.revsci.net/pql?placementIdList=s0IuO0,44he4c&cb="+cb+"'></script>")}catch(err){}var gptadslots=[];var googletag=googletag||{};googletag.cmd=googletag.cmd||[];RT.ads=(function(){function b(g){return g.toLowerCase().replace(/ /g,"")}function f(k,i,g){var j=document.createElement("script");j.async=true;j.type="text/javascript";var o="https:"==document.location.protocol;j.src=(o?"https:":"http:")+"//www.googletagservices.com/tag/js/gpt.js";var m=document.getElementsByTagName("script")[0];m.parentNode.insertBefore(j,m);googletag.cmd.push(function(){googletag.pubads().enableSingleRequest();googletag.pubads().enableAsyncRendering();googletag.pubads().collapseEmptyDivs();googletag.enableServices();for(target in i){var p=i[target];if(p!=""){googletag.pubads().setTargeting(target,[p])}}for(target in k){var q=k[target];if(q!=""){googletag.pubads().setTargeting(target,[q])}}});var n=d(i);var h=jQuery(".rt-dfp-ad");h.each(function(){var r=this.getAttribute("data-adkey");var q=this.getAttribute("data-pos");var p=this.id;if(q!="oop"){googletag.cmd.push(function(){var s=a(g[r]);googletag.defineSlot(n,c(g[r]),p).defineSizeMapping(s).addService(googletag.pubads()).setTargeting("pos",[q])})}else{googletag.cmd.push(function(){googletag.defineOutOfPageSlot(n,p).addService(googletag.pubads()).setTargeting("pos",[""])})}});h.each(function(){var p=this.id;googletag.cmd.push(function(){googletag.display(p)})})}function a(g){var j=googletag.sizeMapping();for(var h=0;h<g.length;h++){j.addSize(g[h][0],g[h][1])}return j.build()}function c(g){var h=[];for(var j=0;j<g.length;j++){h=h.concat(g[j][1])}return h}function d(g){return"/4817/P4681.radiotimes.com/"+b(g.channel)+"/"+b(g.cat)}function e(j,k,i,h){var o=d(i),n=j.attr("data-adkey"),m=j.attr("data-pos"),g=j.attr("id");googletag.cmd.push(function(){var p=googletag.defineSlot(o,h[n],g).setTargeting("pos",[m]).addService(googletag.pubads());googletag.display(g);googletag.pubads().refresh([p])})}return{init:function(i,h,g){this.keywords=i;this.adTargets=h;this.adSizes=g;f(i,h,g)},newAdvert:function(g){e(g,this.keywords,this.adTargets,this.adSizes)},positionMpuAdvert:function(){if($($("#mpu-mobile")[0]).height()!=$($("#mpu")[0]).height()){if($(window).width()<768){$($("#mpu-mobile")[0]).height($($("#mpu")[0]).height()+20);$("#mpu").css("position","absolute");$("#mpu").offset($("#mpu-mobile").offset());$("#mpu-mobile").css("display","block")}else{$($("#mpu")[0]).attr("style","");$("#mpu-mobile").css("display","none")}}}}})();var TypeHelpers=new function(){var a=this;a.hasSmoothing=function(){if(typeof(screen.fontSmoothingEnabled)!="undefined"){return screen.fontSmoothingEnabled}else{try{var c=document.createElement("canvas");c.width="35";c.height="35";c.style.display="none";document.body.appendChild(c);var d=c.getContext("2d");d.textBaseline="top";d.font="32px Arial";d.fillStyle="black";d.strokeStyle="black";d.fillText("O",0,0);for(var h=8;h<=32;h++){for(var f=1;f<=32;f++){var g=d.getImageData(f,h,1,1).data;var b=g[3];if(b!=255&&b!=0){return true}}}return false}catch(e){return null}}};a.insertClasses=function(){var c=a.hasSmoothing();var b=document.getElementsByTagName("html")[0];if(c==true){b.className+=" hasFontSmoothing-true"}else{if(c==false){b.className+=" hasFontSmoothing-false"}else{b.className+=" hasFontSmoothing-unknown"}}}};TypeHelpers.insertClasses();MooTools.More={version:"1.4.0.1",build:"a4244edf2aa97ac8a196fc96082dd35af1abab87"};String.implement({parseQueryString:function(a,b){if(a==null){a=true}if(b==null){b=true}var d=this.split(/[&;]/),c={};if(!d.length){return c}d.each(function(h){var e=h.indexOf("=")+1,i=e?h.substr(e):"",f=e?h.substr(0,e-1).match(/([^\]\[]+|(\B)(?=\]))/g):[h],g=c;if(!f){return}if(b){i=decodeURIComponent(i)}f.each(function(m,k){if(a){m=decodeURIComponent(m)}var j=g[m];if(k<f.length-1){g=g[m]=j||{}}else{if(typeOf(j)=="array"){j.push(i)}else{g[m]=j!=null?[j,i]:i}}})});return c},cleanQueryString:function(a){return this.split("&").filter(function(d){var b=d.indexOf("="),c=b<0?"":d.substr(0,b),e=d.substr(b+1);return a?a.call(null,c,e):(e||e===0)}).join("&")}});(function(){var a=function(){return this.get("value")};var b=this.URI=new Class({Implements:Options,options:{},regex:/^(?:(\w+):)?(?:\/\/(?:(?:([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?)?(\.\.?$|(?:[^?#\/]*\/)*)([^?#]*)(?:\?([^#]*))?(?:#(.*))?/,parts:["scheme","user","password","host","port","directory","file","query","fragment"],schemes:{http:80,https:443,ftp:21,rtsp:554,mms:1755,file:0},initialize:function(e,d){this.setOptions(d);var c=this.options.base||b.base;if(!e){e=c}if(e&&e.parsed){this.parsed=Object.clone(e.parsed)}else{this.set("value",e.href||e.toString(),c?new b(c):false)}},parse:function(e,c){var d=e.match(this.regex);if(!d){return false}d.shift();return this.merge(d.associate(this.parts),c)},merge:function(d,c){if((!d||!d.scheme)&&(!c||!c.scheme)){return false}if(c){this.parts.every(function(e){if(d[e]){return false}d[e]=c[e]||"";return true})}d.port=d.port||this.schemes[d.scheme.toLowerCase()];d.directory=d.directory?this.parseDirectory(d.directory,c?c.directory:""):"/";return d},parseDirectory:function(d,c){d=(d.substr(0,1)=="/"?"":(c||"/"))+d;if(!d.test(b.regs.directoryDot)){return d}var e=[];d.replace(b.regs.endSlash,"").split("/").each(function(f){if(f==".."&&e.length>0){e.pop()}else{if(f!="."){e.push(f)}}});return e.join("/")+"/"},combine:function(c){return c.value||c.scheme+"://"+(c.user?c.user+(c.password?":"+c.password:"")+"@":"")+(c.host||"")+(c.port&&c.port!=this.schemes[c.scheme]?":"+c.port:"")+(c.directory||"/")+(c.file||"")+(c.query?"?"+c.query:"")+(c.fragment?"#"+c.fragment:"")},set:function(d,f,c){if(d=="value"){var e=f.match(b.regs.scheme);if(e){e=e[1]}if(e&&this.schemes[e.toLowerCase()]==null){this.parsed={scheme:e,value:f}}else{this.parsed=this.parse(f,(c||this).parsed)||(e?{scheme:e,value:f}:{value:f})}}else{if(d=="data"){this.setData(f)}else{this.parsed[d]=f}}return this},get:function(d,c){switch(d){case"value":return this.combine(this.parsed,c?c.parsed:false);case"data":return this.getData()}return this.parsed[d]||""},go:function(){document.location.href=this.toString()},toURI:function(){return this},getData:function(c,e){var f=this.get(e||"query");if(!(f||f===0)){return c?null:{}}var d=f.parseQueryString();return c?d[c]:d},setData:function(f,d,e){if(typeof f=="string"){var c=this.getData();c[arguments[0]]=arguments[1];f=c}else{if(d){f=Object.merge(this.getData(),f)}}return this.set(e||"query",Object.toQueryString(f))},clearData:function(c){return this.set(c||"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(c){return new b(this,c)}})})();(function(){if(this.Hash){return}var a=this.Hash=new Type("Hash",function(c){if(typeOf(c)=="hash"){c=Object.clone(c.getClean())}for(var b in c){this[b]=c[b]}return this});this.$H=function(b){return new a(b)};a.implement({forEach:function(c,b){Object.forEach(this,c,b)},getClean:function(){var b={};for(var c in this){if(this.hasOwnProperty(c)){b[c]=this[c]}}return b},getLength:function(){var c=0;for(var b in this){if(this.hasOwnProperty(b)){c++}}return c}});a.alias("each","forEach");a.implement({has:Object.prototype.hasOwnProperty,keyOf:function(b){return Object.keyOf(this,b)},hasValue:function(b){return Object.contains(this,b)},extend:function(b){a.each(b||{},function(d,c){a.set(this,c,d)},this);return this},combine:function(b){a.each(b||{},function(d,c){a.include(this,c,d)},this);return this},erase:function(b){if(this.hasOwnProperty(b)){delete this[b]}return this},get:function(b){return(this.hasOwnProperty(b))?this[b]:null},set:function(b,c){if(!this[b]||this.hasOwnProperty(b)){this[b]=c}return this},empty:function(){a.each(this,function(c,b){delete this[b]},this);return this},include:function(b,c){if(this[b]==undefined){this[b]=c}return this},map:function(c,b){return new a(Object.map(this,c,b))},filter:function(c,b){return new a(Object.filter(this,c,b))},every:function(c,b){return Object.every(this,c,b)},some:function(c,b){return Object.some(this,c,b)},getKeys:function(){return Object.keys(this)},getValues:function(){return Object.values(this)},toQueryString:function(b){return Object.toQueryString(this,b)}});a.alias({indexOf:"keyOf",contains:"hasValue"})})();(function(){var a=function(c){return c!=null};var b=Object.prototype.hasOwnProperty;Object.extend({getFromPath:function(f,e){if(typeof e=="string"){e=e.split(".")}for(var c=0,d=e.length;c<d;c++){if(b.call(f,e[c])){f=f[e[c]]}else{return null}}return f},cleanValues:function(e,d){d=d||a;for(var c in e){if(!d(e[c])){delete e[c]}}return e},erase:function(d,c){if(b.call(d,c)){delete d[c]}return d},run:function(e){var c=Array.slice(arguments,1);for(var d in e){if(e[d].apply){e[d].apply(e,c)}}return e}})})();(function(){var a=null,e={},c={};var b=function(f){if(instanceOf(f,d.Set)){return f}else{return e[f]}};var d=this.Locale={define:function(g,i,f,j){var h;if(instanceOf(g,d.Set)){h=g.name;if(h){e[h]=g}}else{h=g;if(!e[h]){e[h]=new d.Set(h)}g=e[h]}if(i){g.define(i,f,j)}if(!a){a=g}return g},use:function(f){f=b(f);if(f){a=f;this.fireEvent("change",f)}return this},getCurrent:function(){return a},get:function(g,f){return(a)?a.get(g,f):""},inherit:function(g,f,h){g=b(g);if(g){g.inherit(f,h)}return this},list:function(){return Object.keys(e)}};Object.append(d,new Events);d.Set=new Class({sets:{},inherits:{locales:[],sets:{}},initialize:function(f){this.name=f||""},define:function(h,g,i){var f=this.sets[h];if(!f){f={}}if(g){if(typeOf(g)=="object"){f=Object.merge(f,g)}else{f[g]=i}}this.sets[h]=f;return this},get:function(k,g,f){var r=Object.getFromPath(this.sets,k);if(r!=null){var q=typeOf(r);if(q=="function"){r=r.apply(null,Array.from(g))}else{if(q=="object"){r=Object.clone(r)}}return r}var j=k.indexOf("."),p=j<0?k:k.substr(0,j),o=(this.inherits.sets[p]||[]).combine(this.inherits.locales).include("en-US");if(!f){f=[]}for(var h=0,m=o.length;h<m;h++){if(f.contains(o[h])){continue}f.include(o[h]);var n=e[o[h]];if(!n){continue}r=n.get(k,g,f);if(r!=null){return r}}return""},inherit:function(g,h){g=Array.from(g);if(h&&!this.inherits.sets[h]){this.inherits.sets[h]=[]}var f=g.length;while(f--){(h?this.inherits.sets[h]:this.inherits.locales).unshift(g[f])}return this}})})();Class.Mutators.Binds=function(a){if(!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(b){var c=this[b];if(c){this[b]=c.bind(this)}},this);return a.apply(this,arguments)}};Locale.define("en-US","Date",{months:["January","February","March","April","May","June","July","August","September","October","November","December"],months_abbr:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],days_abbr:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dateOrder:["month","date","year"],shortDate:"%m/%d/%Y",shortTime:"%I:%M%p",AM:"AM",PM:"PM",firstDayOfWeek:0,ordinal:function(a){return(a>3&&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 c=this.Date;var d=c.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(t){c.Methods[t.toLowerCase()]=t});var i=function(u,t,v){if(t==1){return u}return u<Math.pow(10,t-1)?(v||"0")+i(u,t-1,v):u};c.implement({set:function(u,v){u=u.toLowerCase();var t=d[u]&&"set"+d[u];if(t&&this[t]){this[t](v)}return this}.overloadSetter(),get:function(u){u=u.toLowerCase();var t=d[u]&&"get"+d[u];if(t&&this[t]){return this[t]()}return null}.overloadGetter(),clone:function(){return new c(this.get("time"))},increment:function(u,v){u=u||"day";v=v!=null?v:1;switch(u){case"year":return this.increment("month",v*12);case"month":var t=this.get("date");this.set("date",1).set("mo",this.get("mo")+v);return this.set("date",t.min(this.get("lastdayofmonth")));case"week":return this.increment("day",v*7);case"day":return this.set("date",this.get("date")+v)}if(!c.units[u]){throw new Error(u+" is not a supported interval")}return this.set("time",this.get("time")+v*c.units[u]())},decrement:function(t,u){return this.increment(t,-1*(u!=null?u:1))},isLeapYear:function(){return c.isLeapYear(this.get("year"))},clearTime:function(){return this.set({hr:0,min:0,sec:0,ms:0})},diff:function(t,u){if(typeOf(t)=="string"){t=c.parse(t)}return((t-this)/c.units[u||"day"](3,3)).round()},getLastDayOfMonth:function(){return c.daysInMonth(this.get("mo"),this.get("year"))},getDayOfYear:function(){return(c.UTC(this.get("year"),this.get("mo"),this.get("date")+1)-c.UTC(this.get("year"),0,1))/c.units.day()},setDay:function(u,v){if(v==null){v=c.getMsg("firstDayOfWeek");if(v===""){v=1}}u=(7+c.parseDay(u,true)-v)%7;var t=(7+this.get("day")-v)%7;return this.increment("day",u-t)},getWeek:function(w){if(w==null){w=c.getMsg("firstDayOfWeek");if(w===""){w=1}}var t=this,u=(7+t.get("day")-w)%7,v=0,x;if(w==1){var y=t.get("month"),A=t.get("date")-u;if(y==11&&A>28){return 1}if(y==0&&A<-2){t=new c(t).decrement("day",u);u=0}x=new c(t.get("year"),0,1).get("day")||7;if(x>4){v=-7}}else{x=new c(t.get("year"),0,1).get("day")}v+=t.get("dayofyear");v+=6-u;v+=(7+x-w)%7;return(v/7)},getOrdinal:function(t){return c.getMsg("ordinal",t||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 t=this.get("timezoneOffset");return((t>0)?"-":"+")+i((t.abs()/60).floor(),2)+i(t%60,2)},setAMPM:function(t){t=t.toUpperCase();var u=this.get("hr");if(u>11&&t=="AM"){return this.decrement("hour",12)}else{if(u<12&&t=="PM"){return this.increment("hour",12)}}return this},getAMPM:function(){return(this.get("hr")<12)?"AM":"PM"},parse:function(t){this.set("time",c.parse(t));return this},isValid:function(t){if(!t){t=this}return typeOf(t)=="date"&&!isNaN(t.valueOf())},format:function(u){if(!this.isValid()){return"invalid date"}if(!u){u="%x %X"}if(typeof u=="string"){u=e[u.toLowerCase()]||u}if(typeof u=="function"){return u(this)}var t=this;return u.replace(/%([a-z%])/gi,function(v,w){switch(w){case"a":return c.getMsg("days_abbr")[t.get("day")];case"A":return c.getMsg("days")[t.get("day")];case"b":return c.getMsg("months_abbr")[t.get("month")];case"B":return c.getMsg("months")[t.get("month")];case"c":return t.format("%a %b %d %H:%M:%S %Y");case"d":return i(t.get("date"),2);case"e":return i(t.get("date"),2," ");case"H":return i(t.get("hr"),2);case"I":return i((t.get("hr")%12)||12,2);case"j":return i(t.get("dayofyear"),3);case"k":return i(t.get("hr"),2," ");case"l":return i((t.get("hr")%12)||12,2," ");case"L":return i(t.get("ms"),3);case"m":return i((t.get("mo")+1),2);case"M":return i(t.get("min"),2);case"o":return t.get("ordinal");case"p":return c.getMsg(t.get("ampm"));case"s":return Math.round(t/1000);case"S":return i(t.get("seconds"),2);case"T":return t.format("%H:%M:%S");case"U":return i(t.get("week"),2);case"w":return t.get("day");case"x":return t.format(c.getMsg("shortDate"));case"X":return t.format(c.getMsg("shortTime"));case"y":return t.get("year").toString().substr(2);case"Y":return t.get("year");case"z":return t.get("GMTOffset");case"Z":return t.get("Timezone")}return w})},toISOString:function(){return this.format("iso8601")}}).alias({toJSON:"toISOString",compare:"diff",strftime:"format"});var p=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],q=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];var e={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(t){return p[t.get("day")]+t.format(", %d ")+q[t.get("month")]+t.format(" %Y %H:%M:%S %Z")},rfc2822:function(t){return p[t.get("day")]+t.format(", %d ")+q[t.get("month")]+t.format(" %Y %H:%M:%S %z")},iso8601:function(t){return(t.getUTCFullYear()+"-"+i(t.getUTCMonth()+1,2)+"-"+i(t.getUTCDate(),2)+"T"+i(t.getUTCHours(),2)+":"+i(t.getUTCMinutes(),2)+":"+i(t.getUTCSeconds(),2)+"."+i(t.getUTCMilliseconds(),3)+"Z")}};var j=[],h=c.parse;var k=function(x,y,u){var v=-1,w=c.getMsg(x+"s");switch(typeOf(y)){case"object":v=w[y.get(x)];break;case"number":v=w[y];if(!v){throw new Error("Invalid "+x+" index: "+y)}break;case"string":var t=w.filter(function(A){return this.test(A)},new RegExp("^"+y,"i"));if(!t.length){throw new Error("Invalid "+x+" string")}if(t.length>1){throw new Error("Ambiguous "+x)}v=t[0]}return(u)?w.indexOf(v):v};var r=1900,s=70;c.extend({getMsg:function(u,t){return Locale.get("Date."+u,t)},units:{ms:Function.from(1),second:Function.from(1000),minute:Function.from(60000),hour:Function.from(3600000),day:Function.from(86400000),week:Function.from(608400000),month:function(u,v){var t=new c;return c.daysInMonth(u!=null?u:t.get("mo"),v!=null?v:t.get("year"))*86400000},year:function(t){t=t||new c().get("year");return c.isLeapYear(t)?31622400000:31536000000}},daysInMonth:function(t,u){return[31,c.isLeapYear(u)?29:28,31,30,31,30,31,31,30,31,30,31][t]},isLeapYear:function(t){return((t%4===0)&&(t%100!==0))||(t%400===0)},parse:function(u){var w=typeOf(u);if(w=="number"){return new c(u)}if(w!="string"){return u}u=u.clean();if(!u.length){return null}var v;j.some(function(x){var t=x.re.exec(u);return(t)?(v=x.handler(t)):false});if(!(v&&v.isValid())){v=new c(h(u));if(!(v&&v.isValid())){v=new c(u.toInt())}}return v},parseDay:function(t,u){return k("day",t,u)},parseMonth:function(t,u){return k("month",t,u)},parseUTC:function(v){var t=new c(v);var u=c.UTC(t.get("year"),t.get("mo"),t.get("date"),t.get("hr"),t.get("min"),t.get("sec"),t.get("ms"));return new c(u)},orderIndex:function(t){return c.getMsg("dateOrder").indexOf(t)+1},defineFormat:function(u,t){e[u]=t;return this},clearParsers:function(){j.length=0;return this},defineParser:function(t){j.push((t.re&&t.handler)?t:a(t));return this},defineParsers:function(){Array.flatten(arguments).each(c.defineParser);return this},define2DigitYearStart:function(t){s=t%100;r=t-s;return this}}).extend({defineFormats:c.defineFormat.overloadSetter()});var n=function(t){return new RegExp("(?:"+c.getMsg(t).map(function(u){return u.substr(0,3)}).join("|")+")[a-z]*")};var o=function(t){switch(t){case"T":return"%H:%M:%S";case"x":return((c.orderIndex("month")==1)?"%m[-./]%d":"%d[-./]%m")+"([-./]%y)?";case"X":return"%H([.:]%M)?([.:]%S([.:]%s)?)? ?%p? ?%z?"}return null};var g={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})?/};g.m=g.I;g.S=g.M;var b;var m=function(t){b=t;g.a=g.A=n("days");g.b=g.B=n("months");j.each(function(v,u){if(v.format){j[u]=a(v.format)}})};var a=function(t){if(!b){return{format:t}}var u=[];var v=(t.source||t).replace(/%([a-z])/gi,function(w,x){return o(x)||w}).replace(/\((?!\?)/g,"(?:").replace(/ (?!\?|\*)/g,",? ").replace(/%([a-z%])/gi,function(w,x){var y=g[x];if(!y){return x}u.push(x);return"("+y.source+")"}).replace(/\[a-z\]/gi,"[a-z\\u00c0-\\uffff;&]");return{format:t,re:new RegExp("^"+v+"$","i"),handler:function(w){w=w.slice(1).associate(u);var x=new c().clearTime(),A=w.y||w.Y;if(A!=null){f.call(x,"y",A)}if("d" in w){f.call(x,"d",1)}if("m" in w||w.b||w.B){f.call(x,"m",1)}for(var y in w){f.call(x,y,w[y])}return x}}};var f=function(t,v){if(!v){return this}switch(t){case"a":case"A":return this.set("day",c.parseDay(v,true));case"b":case"B":return this.set("mo",c.parseMonth(v,true));case"d":return this.set("date",v);case"H":case"I":return this.set("hr",v);case"m":return this.set("mo",v-1);case"M":return this.set("min",v);case"p":return this.set("ampm",v.replace(/\./g,""));case"S":return this.set("sec",v);case"s":return this.set("ms",("0."+v)*1000);case"w":return this.set("day",v);case"Y":return this.set("year",v);case"y":v=+v;if(v<100){v+=r+(v<s?100:0)}return this.set("year",v);case"z":if(v=="Z"){v="+00"}var u=v.match(/([+-])(\d{2}):?(\d{2})?/);u=(u[1]+"1")*(u[2]*60+(+u[3]||0))+this.getTimezoneOffset();return this.set("time",this-u*60000)}return this};c.defineParsers("%Y([-./]%m([-./]%d((T| )%X)?)?)?","%Y%m%d(T%H(%M%S?)?)?","%x( %X)?","%d%o( %b( %Y)?)?( %X)?","%b( %d%o)?( %Y)?( %X)?","%Y %b( %d%o( %X)?)?","%o %b %d %X %z %Y","%T","%H:%M( ?%p)?");Locale.addEvent("change",function(t){if(Locale.get("Date")){m(t)}}).fireEvent("change",Locale.getCurrent())})();(function(){var b={a:/[àáâãäåaa]/g,A:/[ÀÁÂÃÄÅAA]/g,c:/[ccç]/g,C:/[CCÇ]/g,d:/[dd]/g,D:/[DÐ]/g,e:/[èéêëee]/g,E:/[ÈÉÊËEE]/g,g:/[g]/g,G:/[G]/g,i:/[ìíîï]/g,I:/[ÌÍÎÏ]/g,l:/[lll]/g,L:/[LLL]/g,n:/[ñnn]/g,N:/[ÑNN]/g,o:/[òóôõöøo]/g,O:/[ÒÓÔÕÖØ]/g,r:/[rr]/g,R:/[RR]/g,s:/[ššs]/g,S:/[ŠSS]/g,t:/[tt]/g,T:/[TT]/g,ue:/[ü]/g,UE:/[Ü]/g,u:/[ùúûuµ]/g,U:/[ÙÚÛU]/g,y:/[ÿý]/g,Y:/[ŸÝ]/g,z:/[žzz]/g,Z:/[ŽZZ]/g,th:/[þ]/g,TH:/[Þ]/g,dh:/[ð]/g,DH:/[Ð]/g,ss:/[ß]/g,oe:/[œ]/g,OE:/[Œ]/g,ae:/[æ]/g,AE:/[Æ]/g},c={" ":/[\xa0\u2002\u2003\u2009]/g,"*":/[\xb7]/g,"'":/[\u2018\u2019]/g,'"':/[\u201c\u201d]/g,"...":/[\u2026]/g,"-":/[\u2013]/g,"&raquo;":/[\uFFFD]/g};var d=function(h,f){var g=h,e;for(e in f){g=g.replace(f[e],e)}return g};var a=function(h,e){h=h||"";var g=e?"<"+h+"(?!\\w)[^>]*>([\\s\\S]*?)</"+h+"(?!\\w)>":"</?"+h+"([^>]+)?>",f=new RegExp(g,"gi");return f};String.implement({standardize:function(){return d(this,b)},repeat:function(e){return new Array(e+1).join(this)},pad:function(f,h,e){if(this.length>=f){return this}var g=(h==null?" ":""+h).repeat(f-this.length).substr(0,f-this.length);if(!e||e=="right"){return this+g}if(e=="left"){return g+this}return g.substr(0,(g.length/2).floor())+this+g.substr(0,(g.length/2).ceil())},getTags:function(f,e){return this.match(a(f,e))||[]},stripTags:function(f,e){return this.replace(a(f,e),"")},tidy:function(){return d(this,c)},truncate:function(g,i,e){var h=this;if(i==null&&arguments.length==1){i="…"}if(h.length>g){h=h.substring(0,g);if(e){var f=h.lastIndexOf(e);if(f!=-1){h=h.substr(0,f)}}if(i){h+=i}}return h}})})();Element.implement({tidy:function(){this.set("value",this.get("value").tidy())},getTextInRange:function(b,a){return this.get("value").substring(b,a)},getSelectedText:function(){if(this.setSelectionRange){return this.getTextInRange(this.getSelectionStart(),this.getSelectionEnd())}return document.selection.createRange().text},getSelectedRange:function(){if(this.selectionStart!=null){return{start:this.selectionStart,end:this.selectionEnd}}var c={start:0,end:0};var d=this.getDocument().selection.createRange();if(!d||d.parentElement()!=this){return c}var a=d.duplicate();if(this.type=="text"){c.start=0-a.moveStart("character",-100000);c.end=c.start+d.text.length}else{var e=this.get("value");var b=e.length;a.moveToElementText(this);a.setEndPoint("StartToEnd",d);if(a.text.length){b-=e.match(/[\n\r]*$/)[0].length}c.end=b-a.text.length;a.setEndPoint("StartToStart",d);c.start=b-a.text.length}return c},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(d,b){if(this.setSelectionRange){this.focus();this.setSelectionRange(d,b)}else{var e=this.get("value");var a=e.substr(d,b-d).replace(/\r/g,"").length;d=e.substr(0,d).replace(/\r/g,"").length;var c=this.createTextRange();c.collapse(true);c.moveEnd("character",d+a);c.moveStart("character",d);c.select()}return this},insertAtCursor:function(d,b){var a=this.getSelectedRange();var c=this.get("value");this.set("value",c.substring(0,a.start)+d+c.substring(a.end,c.length));if(b!==false){this.selectRange(a.start,a.start+d.length)}else{this.setCaretPosition(a.start+d.length)}return this},insertAroundCursor:function(b,d){b=Object.append({before:"",defaultMiddle:"",after:""},b);var g=this.getSelectedText()||b.defaultMiddle;var c=this.getSelectedRange();var f=this.get("value");if(c.start==c.end){this.set("value",f.substring(0,c.start)+b.before+g+b.after+f.substring(c.end,f.length));this.selectRange(c.start+b.before.length,c.end+b.before.length+g.length)}else{var a=f.substring(c.start,c.end);this.set("value",f.substring(0,c.start)+b.before+a+b.after+f.substring(c.end,f.length));var e=c.start+b.before.length;if(d!==false){this.selectRange(e,e+a.length)}else{this.setCaretPosition(e+f.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."});Element.implement({isDisplayed:function(){return this.getStyle("display")!="none"},isVisible:function(){var b=this.offsetWidth,a=this.offsetHeight;return(b==0&&a==0)?false:(b>0&&a>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){}if(a=="none"){return this}return 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(b,a){return this.removeClass(b).addClass(a)}});Document.implement({clearSelection:function(){if(window.getSelection){var b=window.getSelection();if(b&&b.removeAllRanges){b.removeAllRanges()}}else{if(document.selection&&document.selection.empty){try{document.selection.empty()}catch(a){}}}}});if(!window.Form){window.Form={}}var InputValidator=this.InputValidator=new Class({Implements:[Options],options:{errorMsg:"Validation failed.",test:Function.from(true)},initialize:function(a,b){this.setOptions(b);this.className=a},test:function(a,b){a=document.id(a);return(a)?this.options.test(a,b||this.getProps(a)):false},getError:function(b,c){b=document.id(b);var a=this.options.errorMsg;if(typeOf(a)=="function"){a=a(b,c||this.getProps(b))}return a},getProps:function(a){a=document.id(a);return(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(b){if(b){this.set(b)}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(a){return{}}}else{var c=this.get("validators").filter(function(d){return d.test(":")});if(!c.length){this.store("$moo:validatorProps",{})}else{b={};c.each(function(d){var g=d.split(":");if(g[1]){try{b[g[0]]=JSON.decode(g[1])}catch(f){}}});this.store("$moo:validatorProps",b)}}return this.retrieve("$moo:validatorProps")}};Form.Validator=new Class({Implements:[Options,Events],Binds:["onSubmit"],options:{fieldSelectors:"input, select, textarea",ignoreHidden:true,ignoreDisabled:true,useTitles:false,evaluateOnSubmit:true,evaluateFieldsOnBlur:true,evaluateFieldsOnChange:true,serial:true,stopOnFailure:true,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)();if(this.options.evaluateOnSubmit){this.element.addEvent("submit",this.onSubmit)}if(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(b){if(this.options.evaluateFieldsOnBlur){b.addEvent("blur",this.validationMonitor.pass([b,false],this))}if(this.options.evaluateFieldsOnChange){b.addEvent("change",this.validationMonitor.pass([b,true],this))}},this)},validationMonitor:function(){clearTimeout(this.timer);this.timer=this.validateField.delay(50,this,arguments)},onSubmit:function(a){if(this.validate(a)){this.reset()}},reset:function(){this.getFields().each(this.resetField,this);return this},validate:function(a){var b=this.getFields().map(function(c){return this.validateField(c,true)},this).every(function(c){return c});this.fireEvent("formValidate",[b,this.element,a]);if(this.options.stopOnFailure&&!b&&a){a.preventDefault()}return b},validateField:function(b,c){if(this.paused){return true}b=document.id(b);var d=!b.hasClass("validation-failed");var a,h;if(this.options.serial&&!c){a=this.element.getElement(".validation-failed");h=this.element.getElement(".warning")}if(b&&(!a||c||b.hasClass("validation-failed")||(a&&!this.options.serial))){var e=b.get("validators");var f=e.some(function(k){return this.getValidator(k)},this);var g=[];e.each(function(k){if(k&&!this.test(k,b)){g.include(k)}},this);d=g.length===0;if(f&&!this.hasValidator(b,"warnOnly")){if(d){b.addClass("validation-passed").removeClass("validation-failed");this.fireEvent("elementPass",[b])}else{b.addClass("validation-failed").removeClass("validation-passed");this.fireEvent("elementFail",[b,g])}}if(!h){var i=e.some(function(k){if(k.test("^warn")){return this.getValidator(k.replace(/^warn-/,""))}else{return null}},this);b.removeClass("warning");var j=e.map(function(k){if(k.test("^warn")){return this.test(k.replace(/^warn-/,""),b,true)}else{return null}},this)}}return d},test:function(a,b,e){b=document.id(b);if((this.options.ignoreHidden&&!b.isVisible())||(this.options.ignoreDisabled&&b.get("disabled"))){return true}var d=this.getValidator(a);if(e!=null){e=false}if(this.hasValidator(b,"warnOnly")){e=true}var c=this.hasValidator(b,"ignoreValidation")||(d?d.test(b):true);if(d&&b.isVisible()){this.fireEvent("elementValidate",[c,b,a,e])}if(e){return true}return c},hasValidator:function(a,b){return a.get("validators").contains(b)},resetField:function(a){a=document.id(a);if(a){a.get("validators").each(function(b){if(b.test("^warn-")){b=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){a=document.id(a);if(a){this.enforceField(a);if(b){a.addClass("warnOnly")}else{a.addClass("ignoreValidation")}}return this},enforceField:function(a){a=document.id(a);if(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);if(!this.initialize){this.implement({validators:this.validators})}},addAllThese:function(a){Array.from(a).each(function(b){this.add(b[0],b[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:false,test:function(a){if(a.type=="select-one"||a.type=="select"){return !(a.selectedIndex>=0&&a.options[a.selectedIndex].value!="")}else{return((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){if(typeOf(b.length)!="null"){return Form.Validator.getMsg("length").substitute({length:b.length,elLength:a.get("value").length})}else{return""}},test:function(a,b){if(typeOf(b.length)!="null"){return(a.get("value").length==b.length||a.get("value").length==0)}else{return true}}}],["minLength",{errorMsg:function(a,b){if(typeOf(b.minLength)!="null"){return Form.Validator.getMsg("minLength").substitute({minLength:b.minLength,length:a.get("value").length})}else{return""}},test:function(a,b){if(typeOf(b.minLength)!="null"){return(a.get("value").length>=(b.minLength||0))}else{return true}}}],["maxLength",{errorMsg:function(a,b){if(typeOf(b.maxLength)!="null"){return Form.Validator.getMsg("maxLength").substitute({maxLength:b.maxLength,length:a.get("value").length})}else{return""}},test:function(a,b){return a.get("value").length<=(b.maxLength||10000)}}],["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,c){if(Date.parse){var b=c.dateFormat||"%x";return Form.Validator.getMsg("dateSuchAs").substitute({date:new Date().format(b)})}else{return Form.Validator.getMsg("dateInFormatMDY")}},test:function(d,g){if(Form.Validator.getValidator("IsEmpty").test(d)){return true}var b=Locale.getCurrent().sets.Date,c=new RegExp([b.days,b.days_abbr,b.months,b.months_abbr].flatten().join("|"),"i"),h=d.get("value"),i=h.match(/[a-z]+/gi);if(i&&!i.every(c.exec,c)){return false}var a=Date.parse(h),e=g.dateFormat||"%x",f=a.format(e);if(f!="invalid date"){d.set("value",f)}return a.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,c){var b=document.id(c["validate-one-required"])||a.getParent(c["validate-one-required"]);return b.getElements("input").some(function(d){if(["checkbox","radio"].contains(d.get("type"))){return d.get("checked")}return d.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){if(a){this.set("validator",a)}return this.get("validator").validate()}});Form.Validator.Inline=new Class({Extends:Form.Validator,options:{showError:function(a){if(a.reveal){a.reveal()}else{a.setStyle("display","block")}},hideError:function(a){if(a.dissolve){a.dissolve()}else{a.setStyle("display","none")}},scrollToErrorsOnSubmit:true,scrollToErrorsOnBlur:false,scrollToErrorsOnChange:false,scrollFxOptions:{transition:"quad:out",offset:{y:-20}}},initialize:function(a,b){this.parent(a,b);this.addEvent("onElementValidate",function(f,e,d,h){var g=this.getValidator(d);if(!f&&g.getError(e)){if(h){e.addClass("warning")}var c=this.makeAdvice(d,e,g.getError(e),h);this.insertAdvice(c,e);this.showAdvice(d,e)}else{this.hideAdvice(d,e)}})},makeAdvice:function(b,f,d,g){var e=(g)?this.warningPrefix:this.errorPrefix;e+=(this.options.useTitles)?f.title||d:d;var c=(g)?"warning-advice":"validation-advice";var a=this.getAdvice(b,f);if(a){a=a.set("html",e)}else{a=new Element("div",{html:e,styles:{display:"none"},id:"advice-"+b.split(":")[0]+"-"+this.getFieldId(f)}).addClass(c)}f.store("$moo:advice-"+b,a);return a},getFieldId:function(a){return a.id?a.id:a.id="input_"+a.name},showAdvice:function(b,c){var a=this.getAdvice(b,c);if(a&&!c.retrieve("$moo:"+this.getPropName(b))&&(a.getStyle("display")=="none"||a.getStyle("visiblity")=="hidden"||a.getStyle("opacity")==0)){c.store("$moo:"+this.getPropName(b),true);this.options.showError(a);this.fireEvent("showAdvice",[c,a,b])}},hideAdvice:function(b,c){var a=this.getAdvice(b,c);if(a&&c.retrieve("$moo:"+this.getPropName(b))){c.store("$moo:"+this.getPropName(b),false);this.options.hideError(a);this.fireEvent("hideAdvice",[c,a,b])}},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(b,c){var a=[];if(b.hasClass("ignoreValidation")&&!c){return a}var d=b.get("validators").some(function(e){var g=e.test("^warn-")||b.hasClass("warnOnly");if(g){e=e.replace(/^warn-/,"")}var f=this.getValidator(e);if(!f){return}a.push({message:f.getError(b),warnOnly:g,passed:f.test(),validator:f})},this);return a},getAdvice:function(a,b){return b.retrieve("$moo:advice-"+a)},insertAdvice:function(a,b){var c=b.get("validatorProps");if(!c.msgPos||!document.id(c.msgPos)){if(b.type&&b.type.toLowerCase()=="radio"){b.getParent().adopt(a)}else{a.inject(document.id(b),"after")}}else{document.id(c.msgPos).grab(a)}},validateField:function(b,c,g){var f=this.parent(b,c);if(((this.options.scrollToErrorsOnSubmit&&g==null)||g)&&!f){var a=document.id(this).getElement(".validation-failed");var e=document.id(this).getParent();while(e!=document.body&&e.getScrollSize().y==e.getSize().y){e=e.getParent()}var d=e.retrieve("$moo:fvScroller");if(!d&&window.Fx&&Fx.Scroll){d=new Fx.Scroll(e,this.options.scrollFxOptions);e.store("$moo:fvScroller",d)}if(a){if(d){d.toElement(a)}else{e.scrollTo(e.getScroll().x,a.getPosition(e).y-20)}}}return f},watchFields:function(a){a.each(function(b){if(this.options.evaluateFieldsOnBlur){b.addEvent("blur",this.validationMonitor.pass([b,false,this.options.scrollToErrorsOnBlur],this))}if(this.options.evaluateFieldsOnChange){b.addEvent("change",this.validationMonitor.pass([b,true,this.options.scrollToErrorsOnChange],this))}},this)}});Form.Validator.addAllThese([["validate-enforce-oncheck",{test:function(a,c){var b=a.getParent("form").retrieve("validator");if(!b){return true}(c.toEnforce||document.id(c.enforceChildrenOf).getElements("input, select, textarea")).map(function(d){if(a.checked){b.enforceField(d)}else{b.ignoreField(d);b.resetField(d)}});return true}}],["validate-ignore-oncheck",{test:function(a,c){var b=a.getParent("form").retrieve("validator");if(!b){return true}(c.toIgnore||document.id(c.ignoreChildrenOf).getElements("input, select, textarea")).each(function(d){if(a.checked){b.ignoreField(d);b.resetField(d)}else{b.enforceField(d)}});return true}}],["validate-nospace",{errorMsg:function(){return Form.Validator.getMsg("noSpace")},test:function(a,b){return !a.get("value").test(/\s/)}}],["validate-toggle-oncheck",{test:function(b,d){var c=b.getParent("form").retrieve("validator");if(!c){return true}var a=d.toToggle||document.id(d.toToggleChildrenOf).getElements("input, select, textarea");if(!b.checked){a.each(function(e){c.ignoreField(e);c.resetField(e)})}else{a.each(function(e){c.enforceField(e)})}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(c){return c.checked})}}],["validate-required-check",{errorMsg:function(a,b){return b.useTitle?a.get("title"):Form.Validator.getMsg("requiredChk")},test:function(a,b){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,e){var c=e.groupName||a.get("name");var d=$$(document.getElementsByName(c)).some(function(g,f){return g.checked});var b=a.getParent("form").retrieve("validator");if(d&&b){b.resetField(a)}return d}}],["validate-match",{errorMsg:function(a,b){return Form.Validator.getMsg("match").substitute({matchName:b.matchName||document.id(b.matchInput).get("name")})},test:function(a,d){var b=a.get("value");var c=document.id(d.matchInput)&&document.id(d.matchInput).get("value");return b&&c?b==c: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,c){var d=document.id(c.afterElement)?Date.parse(document.id(c.afterElement).get("value")):new Date();var b=Date.parse(a.get("value"));return b&&d?b>=d: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,c){var d=Date.parse(a.get("value"));var b=document.id(c.beforeElement)?Date.parse(document.id(c.beforeElement).get("value")):new Date();return b&&d?b>=d: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,c){var d=document.id(c.sameMonthAs)&&document.id(c.sameMonthAs).get("value");var b=a.get("value");if(b!=""){return Form.Validator.getMsg(d?"sameMonth":"startMonth")}},test:function(c,d){var a=Date.parse(c.get("value"));var b=Date.parse(document.id(d.sameMonthAs)&&document.id(d.sameMonthAs).get("value"));return a&&b?a.format("%B")==b.format("%B"):true}}],["validate-cc-num",{errorMsg:function(b){var a=b.get("value").replace(/[^0-9]/g,"");return Form.Validator.getMsg("creditcard").substitute({length:a.length})},test:function(d){if(Form.Validator.getValidator("IsEmpty").test(d)){return true}var a=d.get("value");a=a.replace(/[^0-9]/g,"");var g=false;if(a.test(/^4[0-9]{12}([0-9]{3})?$/)){g="Visa"}else{if(a.test(/^5[1-5]([0-9]{14})$/)){g="Master Card"}else{if(a.test(/^3[47][0-9]{13}$/)){g="American Express"}else{if(a.test(/^6011[0-9]{12}$/)){g="Discover"}}}}if(g){var f=0;var c=0;for(var e=a.length-1;e>=0;--e){c=a.charAt(e).toInt();if(c==0){continue}if((a.length-e)%2==0){c+=c}if(c>9){c=c.toString().charAt(0).toInt()+c.toString().charAt(1).toInt()}f+=c}if((f%10)==0){return true}}var b="";while(a!=""){b+=" "+a.substr(0,4);a=a.substr(4)}d.getParent("form").retrieve("validator").ignoreField(d);d.set("value",b.clean());d.getParent("form").retrieve("validator").enforceField(d);return false}}]]);Fx.Elements=new Class({Extends:Fx.CSS,initialize:function(a,b){this.elements=this.subject=$$(a);this.parent(b)},compute:function(b,j,a){var g={};for(var c in b){var d=b[c],f=j[c],e=g[c]={};for(var h in d){e[h]=this.parent(d[h],f[h],a)}}return g},set:function(c){for(var a in c){if(!this.elements[a]){continue}var b=c[a];for(var d in b){this.render(this.elements[a],d,b[d],this.options.unit)}}return this},start:function(f){if(!this.check(f)){return this}var a={},j={};for(var b in f){if(!this.elements[b]){continue}var d=f[b],c=a[b]={},e=j[b]={};for(var g in d){var h=this.prepare(this.elements[b],g,d[g]);c[g]=h.from;e[g]=h.to}}return this.parent(a,j)}});(function(){var b=function(f,e){var d=[];Object.each(e,function(g){Object.each(g,function(h){f.each(function(i){d.push(i+"-"+h+(i=="border"?"-width":""))})})});return d};var a=function(d,e){var f=0;Object.each(e,function(h,g){if(g.test(d)){f=f+h.toInt()}});return f};var c=function(d){return !!(!d||d.offsetHeight||d.offsetWidth)};Element.implement({measure:function(d){if(c(this)){return d.call(this)}var e=this.getParent(),h=[];while(!c(e)&&e!=document.body){h.push(e.expose());e=e.getParent()}var f=this.expose(),g=d.call(this);f();h.each(function(i){i()});return g},expose:function(){if(this.getStyle("display")!="none"){return function(){}}var d=this.style.cssText;this.setStyles({display:"block",position:"absolute",visibility:"hidden"});return function(){this.style.cssText=d}.bind(this)},getDimensions:function(h){h=Object.merge({computeSize:false},h);var d={x:0,y:0};var g=function(e,j){return(j.computeSize)?e.getComputedSize(j):e.getSize()};var i=this.getParent("body");if(i&&this.getStyle("display")=="none"){d=this.measure(function(){return g(this,h)})}else{if(i){try{d=g(this,h)}catch(f){}}}return Object.append(d,(d.x||d.x===0)?{width:d.x,height:d.y}:{x:d.width,y:d.height})},getComputedSize:function(e){e=Object.merge({styles:["padding","border"],planes:{height:["top","bottom"],width:["left","right"]},mode:"both"},e);var g={},f={width:0,height:0},d;if(e.mode=="vertical"){delete f.width;delete e.planes.width}else{if(e.mode=="horizontal"){delete f.height;delete e.planes.height}}b(e.styles,e.planes).each(function(h){g[h]=this.getStyle(h).toInt()},this);Object.each(e.planes,function(i,j){var h=j.capitalize(),k=this.getStyle(j);if(k=="auto"&&!d){d=this.getDimensions()}k=g[j]=(k=="auto")?d[j]:k.toInt();f["total"+h]=k;i.each(function(m){var n=a(m,g);f["computed"+m.capitalize()]=n;f["total"+h]+=n})},this);return Object.append(f,g)}})})();(function(b){var a=Element.Position={options:{relativeTo:document.body,position:{x:"center",y:"center"},offset:{x:0,y:0}},getOptions:function(c,d){d=Object.merge({},a.options,d);a.setPositionOption(d);a.setEdgeOption(d);a.setOffsetOption(c,d);a.setDimensionsOption(c,d);return d},setPositionOption:function(c){c.position=a.getCoordinateFromValue(c.position)},setEdgeOption:function(d){var c=a.getCoordinateFromValue(d.edge);d.edge=c?c:(d.position.x=="center"&&d.position.y=="center")?{x:"center",y:"center"}:{x:"left",y:"top"}},setOffsetOption:function(c,e){var f={x:0,y:0},d=c.measure(function(){return document.id(this.getOffsetParent())}),g=d.getScroll();if(!d||d==c.getDocument().body){return}f=d.measure(function(){var h=this.getPosition();if(this.getStyle("position")=="fixed"){var i=window.getScroll();h.x+=i.x;h.y+=i.y}return h});e.offset={parentPositioned:d!=document.id(e.relativeTo),x:e.offset.x-f.x+g.x,y:e.offset.y-f.y+g.y}},setDimensionsOption:function(c,d){d.dimensions=c.getDimensions({computeSize:true,styles:["padding","border","margin"]})},getPosition:function(c,e){var f={};e=a.getOptions(c,e);var g=document.id(e.relativeTo)||document.body;a.setPositionCoordinates(e,f,g);if(e.edge){a.toEdge(f,e)}var d=e.offset;f.left=((f.x>=0||d.parentPositioned||e.allowNegative)?f.x:0).toInt();f.top=((f.y>=0||d.parentPositioned||e.allowNegative)?f.y:0).toInt();a.toMinMax(f,e);if(e.relFixedPosition||g.getStyle("position")=="fixed"){a.toRelFixedPosition(g,f)}if(e.ignoreScroll){a.toIgnoreScroll(g,f)}if(e.ignoreMargins){a.toIgnoreMargins(f,e)}f.left=Math.ceil(f.left);f.top=Math.ceil(f.top);delete f.x;delete f.y;return f},setPositionCoordinates:function(g,h,i){var f=g.offset.y,e=g.offset.x,c=(i==document.body)?window.getScroll():i.getPosition(),j=c.y,d=c.x,k=window.getSize();switch(g.position.x){case"left":h.x=d+e;break;case"right":h.x=d+e+i.offsetWidth;break;default:h.x=d+((i==document.body?k.x:i.offsetWidth)/2)+e;break}switch(g.position.y){case"top":h.y=j+f;break;case"bottom":h.y=j+f+i.offsetHeight;break;default:h.y=j+((i==document.body?k.y:i.offsetHeight)/2)+f;break}},toMinMax:function(d,c){var f={left:"x",top:"y"},e;["minimum","maximum"].each(function(g){["left","top"].each(function(h){e=c[g]?c[g][f[h]]:null;if(e!=null&&((g=="minimum")?d[h]<e:d[h]>e)){d[h]=e}})})},toRelFixedPosition:function(d,c){var e=window.getScroll();c.top+=e.y;c.left+=e.x},toIgnoreScroll:function(d,c){var e=d.getScroll();c.top-=e.y;c.left-=e.x},toIgnoreMargins:function(d,c){d.left+=c.edge.x=="right"?c.dimensions["margin-right"]:(c.edge.x!="center"?-c.dimensions["margin-left"]:-c.dimensions["margin-left"]+((c.dimensions["margin-right"]+c.dimensions["margin-left"])/2));d.top+=c.edge.y=="bottom"?c.dimensions["margin-bottom"]:(c.edge.y!="center"?-c.dimensions["margin-top"]:-c.dimensions["margin-top"]+((c.dimensions["margin-bottom"]+c.dimensions["margin-top"])/2))},toEdge:function(g,f){var e={},c=f.dimensions,d=f.edge;switch(d.x){case"left":e.x=0;break;case"right":e.x=-c.x-c.computedRight-c.computedLeft;break;default:e.x=-(Math.round(c.totalWidth/2));break}switch(d.y){case"top":e.y=0;break;case"bottom":e.y=-c.y-c.computedTop-c.computedBottom;break;default:e.y=-(Math.round(c.totalHeight/2));break}g.x+=e.x;g.y+=e.y},getCoordinateFromValue:function(c){if(typeOf(c)!="string"){return c}c=c.toLowerCase();return{x:c.test("left")?"left":(c.test("right")?"right":"center"),y:c.test(/upper|top/)?"top":(c.test("bottom")?"bottom":"center")}}};Element.implement({position:function(c){if(c&&(c.x!=null||c.y!=null)){return(b?b.apply(this,arguments):this)}var d=this.setStyle("position","absolute").calculatePosition(c);return(c&&c.returnPos)?d:this.setStyles(d)},calculatePosition:function(c){return a.getPosition(this,c)}})})(Element.prototype.position);Fx.Move=new Class({Extends:Fx.Morph,options:{relativeTo:document.body,position:"center",edge:false,offset:{x:0,y:0}},start:function(a){var b=this.element,c=b.getStyles("top","left");if(c.top=="auto"||c.left=="auto"){b.setPosition(b.getPosition(b.getOffsetParent()))}return this.parent(b.position(Object.merge({},this.options,a,{returnPos:true})))}});Element.Properties.move={set:function(a){this.get("move").cancel().setOptions(a);return this},get:function(){var a=this.retrieve("move");if(!a){a=new Fx.Move(this,{link:"cancel"});this.store("move",a)}return a}};Element.implement({move:function(a){this.get("move").start(a);return this}});(function(){var a=function(c){var b=c.options.hideInputs;if(window.OverText){var d=[null];OverText.each(function(e){d.include("."+e.options.labelClass)});if(d){b+=d.join(", ")}}return(b)?c.element.getElements(b):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 c=this.element.getComputedSize({styles:this.options.styles,mode:this.options.mode});if(this.options.transitionOpacity){c.opacity=this.options.opacity}var d={};Object.each(c,function(f,e){d[e]=[f,0]});this.element.setStyles({display:Function.from(this.options.display).call(this),overflow:"hidden"});var b=a(this);if(b){b.setStyle("visibility","hidden")}this.$chain.unshift(function(){if(this.hidden){this.hiding=false;this.element.style.cssText=this.cssText;this.element.setStyle("display","none");if(b){b.setStyle("visibility","visible")}}this.fireEvent("hide",this.element);this.callChain()}.bind(this));this.start(d)}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 c;this.element.measure(function(){c=this.element.getComputedSize({styles:this.options.styles,mode:this.options.mode})}.bind(this));if(this.options.heightOverride!=null){c.height=this.options.heightOverride.toInt()}if(this.options.widthOverride!=null){c.width=this.options.widthOverride.toInt()}if(this.options.transitionOpacity){this.element.setStyle("opacity",0);c.opacity=this.options.opacity}var d={height:0,display:Function.from(this.options.display).call(this)};Object.each(c,function(f,e){d[e]=0});d.overflow="hidden";this.element.setStyles(d);var b=a(this);if(b){b.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}if(b){b.setStyle("visibility","visible")}this.callChain();this.fireEvent("show",this.element)}.bind(this));this.start(c)}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(){if(this.element.getStyle("display")=="none"){this.reveal()}else{this.dissolve()}return this},cancel:function(){this.parent.apply(this,arguments);if(this.cssText!=null){this.element.style.cssText=this.cssText}this.hiding=false;this.showing=false;return this}});Element.Properties.reveal={set:function(b){this.get("reveal").cancel().setOptions(b);return this},get:function(){var b=this.retrieve("reveal");if(!b){b=new Fx.Reveal(this);this.store("reveal",b)}return b}};Element.Properties.dissolve=Element.Properties.reveal;Element.implement({reveal:function(b){this.get("reveal").setOptions(b).reveal();return this},dissolve:function(b){this.get("reveal").setOptions(b).dissolve();return this},nix:function(b){var c=Array.link(arguments,{destroy:Type.isBoolean,options:Type.isObject});this.get("reveal").setOptions(b).dissolve().chain(function(){this[c.destroy?"destroy":"dispose"]()}.bind(this));return this},wink:function(){var b=Array.link(arguments,{duration:Type.isNumber,options:Type.isObject});var c=this.get("reveal").setOptions(b.options);c.reveal().chain(function(){(function(){c.dissolve()}).delay(b.duration||2000)})}})})();(function(){Fx.Scroll=new Class({Extends:Fx,options:{offset:{x:0,y:0},wheelStops:true},initialize:function(c,d){this.element=this.subject=document.id(c);this.parent(d);if(typeOf(this.element)!="element"){this.element=document.id(this.element.getDocument().body)}if(this.options.wheelStops){var e=this.element,b=this.cancel.pass(false,this);this.addEvent("start",function(){e.addEvent("mousewheel",b)},true);this.addEvent("complete",function(){e.removeEvent("mousewheel",b)},true)}},set:function(){var b=Array.flatten(arguments);if(Browser.firefox){b=[Math.round(b[0]),Math.round(b[1])]}this.element.scrollTo(b[0],b[1]);return this},compute:function(c,d,b){return[0,1].map(function(e){return Fx.compute(c[e],d[e],b)})},start:function(c,d){if(!this.check(c,d)){return this}var b=this.element.getScroll();return this.parent([b.x,b.y],[c,d])},calculateScroll:function(h,i){var b=this.element,e=b.getScrollSize(),d=b.getScroll(),f=b.getSize(),c=this.options.offset,g={x:h,y:i};for(var j in g){if(!g[j]&&g[j]!==0){g[j]=d[j]}if(typeOf(g[j])!="number"){g[j]=e[j]-f[j]}g[j]+=c[j]}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(c,b){b=b?Array.from(b):["x","y"];var e=a(this.element)?{x:0,y:0}:this.element.getScroll();var d=Object.map(document.id(c).getPosition(this.element),function(g,f){return b.contains(f)?g+e[f]:false});return this.start.apply(this,this.calculateScroll(d.x,d.y))},toElementEdge:function(e,b,f){b=b?Array.from(b):["x","y"];e=document.id(e);var j={},g=e.getPosition(this.element),i=e.getSize(),h=this.element.getScroll(),c=this.element.getSize(),d={x:g.x+i.x,y:g.y+i.y};["x","y"].each(function(k){if(b.contains(k)){if(d[k]>h[k]+c[k]){j[k]=d[k]-c[k]}if(g[k]<h[k]){j[k]=g[k]}}if(j[k]==null){j[k]=h[k]}if(f&&f[k]){j[k]=j[k]+f[k]}},this);if(j.x!=h.x||j.y!=h.y){this.start(j.x,j.y)}return this},toElementCenter:function(d,b,e){b=b?Array.from(b):["x","y"];d=document.id(d);var i={},f=d.getPosition(this.element),h=d.getSize(),g=this.element.getScroll(),c=this.element.getSize();["x","y"].each(function(j){if(b.contains(j)){i[j]=f[j]-(c[j]-h[j])/2}if(i[j]==null){i[j]=g[j]}if(e&&e[j]){i[j]=i[j]+e[j]}},this);if(i.x!=g.x||i.y!=g.y){this.start(i.x,i.y)}return this}});function a(b){return(/^(?:body|html)$/i).test(b.tagName)}})();Fx.Slide=new Class({Extends:Fx,options:{mode:"vertical",wrapper:false,hideOverflow:true,resetHeight:false},initialize:function(a,b){a=this.element=this.subject=document.id(a);this.parent(b);b=this.options;var d=a.retrieve("wrapper"),c=a.getStyles("margin","position","overflow");if(b.hideOverflow){c=Object.append(c,{overflow:"hidden"})}if(b.wrapper){d=document.id(b.wrapper).setStyles(c)}if(!d){d=new Element("div",{styles:c}).wraps(a)}a.store("wrapper",d).setStyle("margin",0);if(a.getStyle("overflow")=="visible"){a.setStyle("overflow","hidden")}this.now=[];this.open=true;this.wrapper=d;this.addEvent("complete",function(){this.open=(d["offset"+this.layout.capitalize()]!=0);if(this.open&&this.options.resetHeight){d.setStyle("height","")}},true)},vertical:function(){this.margin="margin-top";this.layout="height";this.offset=this.element.offsetHeight},horizontal:function(){this.margin="margin-left";this.layout="width";this.offset=this.element.offsetWidth},set:function(a){this.element.setStyle(this.margin,a[0]);this.wrapper.setStyle(this.layout,a[1]);return this},compute:function(b,c,a){return[0,1].map(function(d){return Fx.compute(b[d],c[d],a)})},start:function(c,f){if(!this.check(c,f)){return this}this[f||this.options.mode]();var e=this.element.getStyle(this.margin).toInt(),d=this.wrapper.getStyle(this.layout).toInt(),a=[[e,d],[0,this.offset]],b=[[e,d],[-this.offset,0]],g;switch(c){case"in":g=a;break;case"out":g=b;break;case"toggle":g=(d==0)?a:b}return this.parent(g[0],g[1])},slideIn:function(a){return this.start("in",a)},slideOut:function(a){return this.start("out",a)},hide:function(a){this[a||this.options.mode]();this.open=false;return this.set([-this.offset,0])},show:function(a){this[a||this.options.mode]();this.open=true;return this.set([0,this.offset])},toggle:function(a){return this.start("toggle",a)}});Element.Properties.slide={set:function(a){this.get("slide").cancel().setOptions(a);return this},get:function(){var a=this.retrieve("slide");if(!a){a=new Fx.Slide(this,{link:"cancel"});this.store("slide",a)}return a}};Element.implement({slide:function(b,c){b=b||"toggle";var d=this.get("slide"),e;switch(b){case"hide":d.hide(c);break;case"show":d.show(c);break;case"toggle":var a=this.retrieve("slide:flag",d.open);d[a?"slideOut":"slideIn"](c);this.store("slide:flag",!a);e=true;break;default:d.start(b,c)}if(!e){this.eliminate("slide:flag")}return this}});var Drag=new Class({Implements:[Events,Options],options:{snap:6,unit:"px",grid:false,style:true,limit:false,handle:false,invert:false,preventDefault:false,stopPropagation:false,modifiers:{x:"left",y:"top"}},initialize:function(){var b=Array.link(arguments,{options:Type.isObject,element:function(c){return c!=null}});this.element=document.id(b.element);this.document=this.element.getDocument();this.setOptions(b.options||{});var a=typeOf(this.options.handle);this.handles=((a=="array"||a=="collection")?$$(this.options.handle):document.id(this.options.handle))||this.element;this.mouse={now:{},pos:{}};this.value={start:{},now:{}};this.selection=(Browser.ie)?"selectstart":"mousedown";if(Browser.ie&&!Drag.ondragstartFixed){document.ondragstart=Function.from(false);Drag.ondragstartFixed=true}this.bound={start:this.start.bind(this),check:this.check.bind(this),drag:this.drag.bind(this),stop:this.stop.bind(this),cancel:this.cancel.bind(this),eventStop:Function.from(false)};this.attach()},attach:function(){this.handles.addEvent("mousedown",this.bound.start);return this},detach:function(){this.handles.removeEvent("mousedown",this.bound.start);return this},start:function(b){var g=this.options;if(b.rightClick){return}if(g.preventDefault){b.preventDefault()}if(g.stopPropagation){b.stopPropagation()}this.mouse.start=b.page;this.fireEvent("beforeStart",this.element);var e=g.limit;this.limit={x:[],y:[]};var j,a;for(j in g.modifiers){if(!g.modifiers[j]){continue}var h=this.element.getStyle(g.modifiers[j]);if(h&&!h.match(/px$/)){if(!a){a=this.element.getCoordinates(this.element.getOffsetParent())}h=a[g.modifiers[j]]}if(g.style){this.value.now[j]=(h||0).toInt()}else{this.value.now[j]=this.element[g.modifiers[j]]}if(g.invert){this.value.now[j]*=-1}this.mouse.pos[j]=b.page[j]-this.value.now[j];if(e&&e[j]){var d=2;while(d--){var f=e[j][d];if(f||f===0){this.limit[j][d]=(typeof f=="function")?f():f}}}}if(typeOf(this.options.grid)=="number"){this.options.grid={x:this.options.grid,y:this.options.grid}}var c={mousemove:this.bound.check,mouseup:this.bound.cancel};c[this.selection]=this.bound.eventStop;this.document.addEvents(c)},check:function(b){if(this.options.preventDefault){b.preventDefault()}var a=Math.round(Math.sqrt(Math.pow(b.page.x-this.mouse.start.x,2)+Math.pow(b.page.y-this.mouse.start.y,2)));if(a>this.options.snap){this.cancel();this.document.addEvents({mousemove:this.bound.drag,mouseup:this.bound.stop});this.fireEvent("start",[this.element,b]).fireEvent("snap",this.element)}},drag:function(a){var b=this.options;if(b.preventDefault){a.preventDefault()}this.mouse.now=a.page;for(var c in b.modifiers){if(!b.modifiers[c]){continue}this.value.now[c]=this.mouse.now[c]-this.mouse.pos[c];if(b.invert){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]<this.limit[c][0])){this.value.now[c]=this.limit[c][0]}}}if(b.grid[c]){this.value.now[c]-=((this.value.now[c]-(this.limit[c][0]||0))%b.grid[c])}if(b.style){this.element.setStyle(b.modifiers[c],this.value.now[c]+b.unit)}else{this.element[b.modifiers[c]]=this.value.now[c]}}this.fireEvent("drag",[this.element,a])},cancel:function(a){this.document.removeEvents({mousemove:this.bound.check,mouseup:this.bound.cancel});if(a){this.document.removeEvent(this.selection,this.bound.eventStop);this.fireEvent("cancel",this.element)}},stop:function(a){var b={mousemove:this.bound.drag,mouseup:this.bound.stop};b[this.selection]=this.bound.eventStop;this.document.removeEvents(b);if(a){this.fireEvent("complete",[this.element,a])}}});Element.implement({makeResizable:function(b){var a=new Drag(this,Object.merge({modifiers:{x:"width",y:"height"}},b));this.store("resizer",a);return a.addEvent("drag",function(){this.fireEvent("resize",a)}.bind(this))}});Drag.Move=new Class({Extends:Drag,options:{droppables:[],container:false,precalculate:false,includeMargins:true,checkDroppables:true},initialize:function(a,b){this.parent(a,b);a=this.element;this.droppables=$$(this.options.droppables);this.container=document.id(this.options.container);if(this.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");if(c&&(d.left=="auto"||d.top=="auto")){a.setPosition(a.getPosition(c))}}if(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(b){return b.getCoordinates()})}this.parent(a)},calculateLimit:function(){var g=this.element,b=this.container,m=document.id(g.getOffsetParent())||document.body,d=b.getCoordinates(m),i={},h={},e={},c={},n={};["top","right","bottom","left"].each(function(r){i[r]=g.getStyle("margin-"+r).toInt();h[r]=g.getStyle("border-"+r).toInt();e[r]=b.getStyle("margin-"+r).toInt();c[r]=b.getStyle("border-"+r).toInt();n[r]=m.getStyle("padding-"+r).toInt()},this);var q=g.offsetWidth+i.left+i.right,j=g.offsetHeight+i.top+i.bottom,k=0,p=0,o=d.right-c.right-q,a=d.bottom-c.bottom-j;if(this.options.includeMargins){k+=i.left;p+=i.top}else{o+=i.right;a+=i.bottom}if(g.getStyle("position")=="relative"){var f=g.getCoordinates(m);f.left-=g.getStyle("left").toInt();f.top-=g.getStyle("top").toInt();k-=f.left;p-=f.top;if(b.getStyle("position")!="relative"){k+=c.left;p+=c.top}o+=i.left-f.left;a+=i.top-f.top;if(b!=m){k+=e.left+n.left;p+=((Browser.ie6||Browser.ie7)?0:e.top)+n.top}}else{k-=i.left;p-=i.top;if(b!=m){k+=d.left+c.left;p+=d.top+c.top}}return{x:[k,o],y:[p,a]}},getDroppableCoordinates:function(a){var b=a.getCoordinates();if(a.getStyle("position")=="fixed"){var c=window.getScroll();b.left+=c.x;b.right+=c.x;b.top+=c.y;b.bottom+=c.y}return b},checkDroppables:function(){var a=this.droppables.filter(function(b,c){b=this.positions?this.positions[c]:this.getDroppableCoordinates(b);var d=this.mouse.now;return(d.x>b.left&&d.x<b.right&&d.y<b.bottom&&d.y>b.top)},this).getLast();if(this.overed!=a){if(this.overed){this.fireEvent("leave",[this.element,this.overed])}if(a){this.fireEvent("enter",[this.element,a])}this.overed=a}},drag:function(a){this.parent(a);if(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(b){var a=new Drag.Move(this,b);this.store("dragger",a);return a}});var Sortables=new Class({Implements:[Events,Options],options:{opacity:1,clone:false,revert:false,handle:false,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(c){this.start.call(this,c,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(c,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,c,b,this.list)}var a=b.clone(true).setStyles({margin:0,position:"absolute",visibility:"hidden",width:b.getStyle("width")}).addEvent("mousedown",function(d){b.fireEvent("mousedown",d)});if(a.get("html").test("radio")){a.getElements("input[type=radio]").each(function(e,d){e.set("name","clone_"+d);if(e.get("checked")){b.getElements("input[type=radio]")[d].set("checked",true)}})}return a.inject(this.list).setPosition(b.getPosition(b.getOffsetParent()))},getDroppables:function(){var a=this.list.getChildren().erase(this.clone).erase(this.element);if(!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(b,a){if(!this.idle||b.rightClick||["button","input","a","textarea"].contains(b.target.get("tag"))){return}this.idle=false;this.element=a;this.opacity=a.getStyle("opacity");this.list=a.getParent();this.clone=this.getClone(b,a);this.drag=new Drag.Move(this.clone,Object.merge({droppables:this.getDroppables()},this.options.dragOptions)).addEvents({onSnap:function(){b.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(b)},end:function(){this.drag.detach();this.element.setStyle("opacity",this.opacity);if(this.effect){var c=this.element.getStyles("width","height"),a=this.clone,d=a.computePosition(this.element.getPosition(this.clone.getOffsetParent()));var b=function(){this.removeEvent("cancel",b);a.destroy()};this.effect.element=a;this.effect.start({top:d.top,left:d.left,width:c.width,height:c.height,opacity:0.25}).addEvent("cancel",b).chain(b)}else{this.clone.destroy()}this.reset()},reset:function(){this.idle=true;this.fireEvent("complete",this.element)},serialize:function(){var b=Array.link(arguments,{modifier:Type.isFunction,index:function(d){return d!=null}});var c=this.lists.map(function(d){return d.getChildren().map(b.modifier||function(e){return e.get("id")},this)},this);var a=b.index;if(this.lists.length==1){a=0}return(a||a===0)&&a>=0&&a<this.lists.length?c[a]:c}});Request.JSONP=new Class({Implements:[Chain,Events,Options],options:{onRequest:function(a){if(this.options.log&&window.console&&console.log){console.log("JSONP retrieving script with url:"+a)}},onError:function(a){if(this.options.log&&window.console&&console.warn){console.warn("JSONP "+a+" will fail in Internet Explorer, which enforces a 2083 bytes length limit on URIs")}},url:"",callbackKey:"callback",injectScript:document.head,data:"",link:"ignore",timeout:0,log:false},initialize:function(a){this.setOptions(a)},send:function(c){if(!Request.prototype.check.call(this,c)){return this}this.running=true;var f=typeOf(c);if(f=="string"||f=="element"){c={data:c}}c=Object.merge(this.options,c||{});var a=c.data;switch(typeOf(a)){case"element":a=document.id(a).toQueryString();break;case"object":case"hash":a=Object.toQueryString(a)}var b=this.index=Request.JSONP.counter++;var e=c.url+(c.url.test("\\?")?"&":"?")+(c.callbackKey)+"=Request.JSONP.request_map.request_"+b+(a?"&"+a:"");if(e.length>2083){this.fireEvent("error",e)}Request.JSONP.request_map["request_"+b]=function(){this.success(arguments,b)}.bind(this);var d=this.getScript(e).inject(c.injectScript);this.fireEvent("request",[e,d]);if(c.timeout){this.timeout.delay(c.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,b){if(!this.running){return}this.clear().fireEvent("complete",a).fireEvent("success",a).callChain()},cancel:function(){if(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:5000,delay:5000,limit:60000},startTimer:function(a){var b=function(){if(!this.running){this.send({data:a})}};this.lastDelay=this.options.initialDelay;this.timer=b.delay(this.lastDelay,this);this.completeCheck=function(c){clearTimeout(this.timer);this.lastDelay=(c)?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)}});Hash.Cookie=new Class({Extends:Cookie,options:{autoSave:true},initialize:function(a,b){this.parent(a,b);this.load()},save:function(){var a=JSON.encode(this.hash);if(!a||a.length>4096){return false}if(a=="{}"){this.dispose()}else{this.write(a)}return true},load:function(){this.hash=new Hash(JSON.decode(this.read(),true));return this}});Hash.each(Hash.prototype,function(a,b){if(typeof a=="function"){Hash.Cookie.implement(b,function(){var c=a.apply(this.hash,arguments);if(this.options.autoSave){this.save()}return c})}});var Scroller=new Class({Implements:[Events,Options],options:{area:20,velocity:1,onChange:function(a,b){this.element.scrollTo(a,b)},fps:50},initialize:function(a,b){this.setOptions(b);this.element=document.id(a);this.docBody=document.id(this.element.getDocument().body);this.listener=(typeOf(this.element)!="element")?this.docBody:this.element;this.timer=null;this.bound={attach:this.attach.bind(this),detach:this.detach.bind(this),getCoords:this.getCoords.bind(this)}},start:function(){this.listener.addEvents({mouseover:this.bound.attach,mouseleave:this.bound.detach});return this},stop:function(){this.listener.removeEvents({mouseover:this.bound.attach,mouseleave:this.bound.detach});this.detach();this.timer=clearInterval(this.timer);return this},attach:function(){this.listener.addEvent("mousemove",this.bound.getCoords)},detach:function(){this.listener.removeEvent("mousemove",this.bound.getCoords);this.timer=clearInterval(this.timer)},getCoords:function(a){this.page=(this.listener.get("tag")=="body")?a.client:a.page;if(!this.timer){this.timer=this.scroll.periodical(Math.round(1000/this.options.fps),this)}},scroll:function(){var f=this.element.getSize(),d=this.element.getScroll(),c=this.element!=this.docBody?this.element.getOffsets():{x:0,y:0},e=this.element.getScrollSize(),b={x:0,y:0},g=this.options.area.top||this.options.area,a=this.options.area.bottom||this.options.area;for(var h in this.page){if(this.page[h]<(g+c[h])&&d[h]!=0){b[h]=(this.page[h]-g-c[h])*this.options.velocity}else{if(this.page[h]+a>(f[h]+c[h])&&d[h]+f[h]!=e[h]){b[h]=(this.page[h]-f[h]+a-c[h])*this.options.velocity}}b[h]=b[h].round()}if(b.y||b.x){this.fireEvent("change",[d.x+b.x,d.y+b.y])}}});Element.implement({removeClassAll:function(){this.erase("class");return this},removeClasses:function(a){this.className=this.className.replace(new RegExp("\\b("+a.replace(/\s+/g,"|")+")\\b","g")," ").clean();return this}});Element.implement(function(){function a(f,d,c){var e=this;if(typeOf(d)=="function"){c=d;d=undefined}new Fx.Morph(this,{duration:(d==undefined)?500:d,onComplete:function(){if(c!=undefined){c.call(this)}}}).start({opacity:(f=="out")?[1,0]:[0,1]}).chain(function(){if(f=="out"&&this.element.retrieve("hiding")){this.element.setStyle("display","none")}if(f=="out"){this.element.store("hiding",false)}})}function b(c){return c.getStyle("display")!="none"}return{fadeIn:function(d,c){if(b(this)&&!this.retrieve("hiding")){return this}this.store("hiding",false);this.setStyles({visibility:"visible",display:(this.retrieve("displayState")!=null)?this.retrieve("displayState"):"block",opacity:0});a.apply(this,["in"].combine(arguments));return this},fadeOut:function(d,c){if(!b(this)){return this}this.store("displayState",this.getStyle("display"));this.store("hiding",true);a.apply(this,["out"].combine(arguments));return this}}}());Function.implement({bindEvent:function(b,a){var c=this;a=Array.from(a);return function(d){return c.apply(this,[d,b].combine(a))}}});String.implement({toBoolean:function(){return"true"==this},toElement:function(){var a=document.createElement("div");a.innerHTML=this;return new Elements(a.childNodes)},limitText:function(a,b){var c=this.split(" ").slice(0,a).join(" ");if(b!==undefined){c+=b}return c},cleanHtml:function(){var a=document.createElement("DIV");a.innerHTML=this;return a.textContent||a.innerText}});Class.Singleton=new Class({initialize:function(a,b){var c=new Class(a);return new c(b)}});(function(){var a={};$publish=function(c,b){a[c]&&a[c].each(function(d){d.apply(d,b)})};$subscribe=function(c,b){if(!a[c]){a[c]=[]}a[c].push(b);return[c,b]};$unsubscribe=function(b){var c=b[0];a[c]&&a[c].each(function(e,d){if(e==b[1]){a[c].erase(e)}})}})();window.innerShiv=(function(){var a;var b=document;var e;var d="abbr article aside audio canvas datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video".split(" ");function c(f,g,h){return(/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i).test(h)?f:g+"></"+h+">"}return function(f,m){if(!a){a=b.createElement("div");a.innerHTML="<nav></nav>";e=a.childNodes.length!==1;if(e){var o=b.createDocumentFragment();var g=d.length;while(g--){o.createElement(d[g])}o.appendChild(a)}}f=f.replace(/^\s\s*/,"").replace(/\s\s*$/,"").replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,"").replace(/(<([\w:]+)[^>]*?)\/>/g,c);var p;if(p=f.match(/^<(tbody|tr|td|col|colgroup|thead|tfoot)/i)){a.innerHTML="<table>"+f+"</table>"}else{a.innerHTML=f}var n;if(p){n=a.getElementsByTagName(p[1])[0].parentNode}else{n=a}if(m===false){return n.childNodes}var k=b.createDocumentFragment();var h=n.childNodes.length;while(h--){k.appendChild(n.firstChild)}return k}}());this.Handlebars={};(function(b){b.VERSION="1.0.rc.1";b.helpers={};b.partials={};b.registerHelper=function(f,d,e){if(e){d.not=e}this.helpers[f]=d};b.registerPartial=function(d,e){this.partials[d]=e};b.registerHelper("helperMissing",function(d){if(arguments.length===2){return undefined}else{throw new Error("Could not find property '"+d+"'")}});var c=Object.prototype.toString,a="[object Function]";b.registerHelper("blockHelperMissing",function(d,g){var f=g.inverse||function(){},e=g.fn;var h="";var i=c.call(d);if(i===a){d=d.call(this)}if(d===true){return e(this)}else{if(d===false||d==null){return f(this)}else{if(i==="[object Array]"){if(d.length>0){return b.helpers.each(d,g)}else{return f(this)}}else{return e(d)}}}});b.K=function(){};b.createFrame=Object.create||function(e){b.K.prototype=e;var d=new b.K();b.K.prototype=null;return d};b.registerHelper("each",function(d,m){var f=m.fn,h=m.inverse;var n="",e;if(m.data){e=b.createFrame(m.data)}if(d&&d.length>0){for(var g=0,k=d.length;g<k;g++){if(e){e.index=g}n=n+f(d[g],{data:e})}}else{n=h(this)}return n});b.registerHelper("if",function(d,e){var f=c.call(d);if(f===a){d=d.call(this)}if(!d||b.Utils.isEmpty(d)){return e.inverse(this)}else{return e.fn(this)}});b.registerHelper("unless",function(d,g){var e=g.fn,f=g.inverse;g.fn=f;g.inverse=e;return b.helpers["if"].call(this,d,g)});b.registerHelper("with",function(d,e){return e.fn(d)});b.registerHelper("log",function(d){b.log(d)})}(this.Handlebars));Handlebars.Exception=function(a){var c=Error.prototype.constructor.apply(this,arguments);for(var b in c){if(c.hasOwnProperty(b)){this[b]=c[b]}}this.message=c.message};Handlebars.Exception.prototype=new Error();Handlebars.SafeString=function(a){this.string=a};Handlebars.SafeString.prototype.toString=function(){return this.string.toString()};(function(){var b={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"};var a=/[&<>"'`]/g;var d=/[&<>"'`]/;var c=function(e){return b[e]||"&amp;"};Handlebars.Utils={escapeExpression:function(e){if(e instanceof Handlebars.SafeString){return e.toString()}else{if(e==null||e===false){return""}}if(!d.test(e)){return e}return e.replace(a,c)},isEmpty:function(e){if(typeof e==="undefined"){return true}else{if(e===null){return true}else{if(e===false){return true}else{if(Object.prototype.toString.call(e)==="[object Array]"&&e.length===0){return true}else{return false}}}}}}})();Handlebars.VM={template:function(b){var a={escapeExpression:Handlebars.Utils.escapeExpression,invokePartial:Handlebars.VM.invokePartial,programs:[],program:function(e,d,c){var f=this.programs[e];if(c){return Handlebars.VM.program(d,c)}else{if(f){return f}else{f=this.programs[e]=Handlebars.VM.program(d);return f}}},programWithDepth:Handlebars.VM.programWithDepth,noop:Handlebars.VM.noop};return function(c,d){d=d||{};return b.call(a,Handlebars,c,d.helpers,d.partials,d.data)}},programWithDepth:function(d,c,a){var b=Array.prototype.slice.call(arguments,2);return function(e,f){f=f||{};return d.apply(this,[e,f.data||c].concat(b))}},program:function(b,a){return function(c,d){d=d||{};return b(c,d.data||a)}},noop:function(){return""},invokePartial:function(f,d,a,c,g,b){var e={helpers:c,partials:g,data:b};if(f===undefined){throw new Handlebars.Exception("The partial "+d+" could not be found")}else{if(f instanceof Function){return f(a,e)}else{if(!Handlebars.compile){throw new Handlebars.Exception("The partial "+d+" could not be compiled when running in runtime-only mode")}else{g[d]=Handlebars.compile(f,{data:b!==undefined});return g[d](a,e)}}}}};Handlebars.template=Handlebars.VM.template;
/*
 * typeahead.js 0.9.3
 * https://github.com/twitter/typeahead
 * Copyright 2013 Twitter, Inc. and other contributors; Licensed MIT
 */
(function(a){var m="0.9.3";var k={isMsie:function(){var n=/(msie) ([\w.]+)/i.exec(navigator.userAgent);return n?parseInt(n[2],10):false},isBlankString:function(n){return !n||/^\s*$/.test(n)},escapeRegExChars:function(n){return n.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},isString:function(n){return typeof n==="string"},isNumber:function(n){return typeof n==="number"},isArray:a.isArray,isFunction:a.isFunction,isObject:a.isPlainObject,isUndefined:function(n){return typeof n==="undefined"},bind:a.proxy,bindAll:function(o){var p;for(var n in o){a.isFunction(p=o[n])&&(o[n]=a.proxy(p,o))}},indexOf:function(n,p){for(var o=0;o<n.length;o++){if(n[o]===p){return o}}return -1},each:a.each,map:a.map,filter:a.grep,every:function(n,p){var o=true;if(!n){return o}a.each(n,function(q,r){if(!(o=p.call(null,r,q,n))){return false}});return !!o},some:function(n,p){var o=false;if(!n){return o}a.each(n,function(q,r){if(o=p.call(null,r,q,n)){return false}});return !!o},mixin:a.extend,getUniqueId:function(){var n=0;return function(){return n++}}(),defer:function(n){setTimeout(n,0)},debounce:function(n,r,o){var q,p;return function(){var u=this,s=arguments,v,t;v=function(){q=null;if(!o){p=n.apply(u,s)}};t=o&&!q;clearTimeout(q);q=setTimeout(v,r);if(t){p=n.apply(u,s)}return p}},throttle:function(p,u){var o,n,t,s,r,q;r=0;q=function(){r=new Date();t=null;s=p.apply(o,n)};return function(){var v=new Date(),w=u-(v-r);o=this;n=arguments;if(w<=0){clearTimeout(t);t=null;r=v;s=p.apply(o,n)}else{if(!t){t=setTimeout(q,w)}}return s}},tokenizeQuery:function(n){return a.trim(n).toLowerCase().split(/[\s]+/)},tokenizeText:function(n){return a.trim(n).toLowerCase().split(/[\s\-_]+/)},getProtocol:function(){return location.protocol},noop:function(){}};var e=function(){var n=/\s+/;return{on:function(q,o){var p;if(!o){return this}this._callbacks=this._callbacks||{};q=q.split(n);while(p=q.shift()){this._callbacks[p]=this._callbacks[p]||[];this._callbacks[p].push(o)}return this},trigger:function(r,p){var q,o;if(!this._callbacks){return this}r=r.split(n);while(q=r.shift()){if(o=this._callbacks[q]){for(var s=0;s<o.length;s+=1){o[s].call(this,{type:q,data:p})}}}return this}}}();var d=function(){var o="typeahead:";function n(p){if(!p||!p.el){a.error("EventBus initialized without el")}this.$el=a(p.el)}k.mixin(n.prototype,{trigger:function(q){var p=[].slice.call(arguments,1);this.$el.trigger(o+q,p)}});return n}();var g=function(){var q,r;try{q=window.localStorage;q.setItem("~~~","!");q.removeItem("~~~")}catch(p){q=null}function t(u){this.prefix=["__",u,"__"].join("");this.ttlKey="__ttl__";this.keyMatcher=new RegExp("^"+this.prefix)}if(q&&window.JSON){r={_prefix:function(u){return this.prefix+u},_ttlKey:function(u){return this._prefix(u)+this.ttlKey},get:function(u){if(this.isExpired(u)){this.remove(u)}return n(q.getItem(this._prefix(u)))},set:function(u,w,v){if(k.isNumber(v)){q.setItem(this._ttlKey(u),o(s()+v))}else{q.removeItem(this._ttlKey(u))}return q.setItem(this._prefix(u),o(w))},remove:function(u){q.removeItem(this._ttlKey(u));q.removeItem(this._prefix(u));return this},clear:function(){var u,v,w=[],x=q.length;for(u=0;u<x;u++){if((v=q.key(u)).match(this.keyMatcher)){w.push(v.replace(this.keyMatcher,""))}}for(u=w.length;u--;){this.remove(w[u])}return this},isExpired:function(u){var v=n(q.getItem(this._ttlKey(u)));return k.isNumber(v)&&s()>v?true:false}}}else{r={get:k.noop,set:k.noop,remove:k.noop,clear:k.noop,isExpired:k.noop}}k.mixin(t.prototype,r);return t;function s(){return new Date().getTime()}function o(u){return JSON.stringify(k.isUndefined(u)?null:u)}function n(u){return JSON.parse(u)}}();var h=function(){function n(p){k.bindAll(this);p=p||{};this.sizeLimit=p.sizeLimit||10;this.cache={};this.cachedKeysByAge=[]}k.mixin(n.prototype,{get:function(o){return this.cache[o]},set:function(q,p){var o;if(this.cachedKeysByAge.length===this.sizeLimit){o=this.cachedKeysByAge.shift();delete this.cache[o]}this.cache[q]=p;this.cachedKeysByAge.push(q)}});return n}();var i=function(){var s=0,r={},q,t;function u(v){k.bindAll(this);v=k.isString(v)?{url:v}:v;t=t||new h();q=k.isNumber(v.maxParallelRequests)?v.maxParallelRequests:q||6;this.url=v.url;this.wildcard=v.wildcard||"%QUERY";this.filter=v.filter;this.replace=v.replace;this.ajaxSettings={type:"get",cache:v.cache,timeout:v.timeout,dataType:v.dataType||"json",beforeSend:v.beforeSend};this._get=(/^throttle$/i.test(v.rateLimitFn)?k.throttle:k.debounce)(this._get,v.rateLimitWait||300)}k.mixin(u.prototype,{_get:function(y,v){var x=this;if(n()){this._sendRequest(y).done(w)}else{this.onDeckRequestArgs=[].slice.call(arguments,0)}function w(B){var A=x.filter?x.filter(B):B;v&&v(A);t.set(y,B)}},_sendRequest:function(y){var x=this,w=r[y];if(!w){p();w=r[y]=a.ajax(y,this.ajaxSettings).always(v)}return w;function v(){o();r[y]=null;if(x.onDeckRequestArgs){x._get.apply(x,x.onDeckRequestArgs);x.onDeckRequestArgs=null}}},get:function(x,v){var A=this,w=encodeURIComponent(x||""),B,y;v=v||k.noop;B=this.replace?this.replace(this.url,w):this.url.replace(this.wildcard,w);if(y=t.get(B)){k.defer(function(){v(A.filter?A.filter(y):y)})}else{this._get(B,v)}return !!y}});return u;function p(){s++}function o(){s--}function n(){return s<q}}();var b=function(){var p={thumbprint:"thumbprint",protocol:"protocol",itemHash:"itemHash",adjacencyList:"adjacencyList"};function o(q){k.bindAll(this);if(k.isString(q.template)&&!q.engine){a.error("no template engine specified")}if(!q.local&&!q.prefetch&&!q.remote){a.error("one of local, prefetch, or remote is required")}this.name=q.name||k.getUniqueId();this.limit=q.limit||5;this.minLength=q.minLength||1;this.header=q.header;this.footer=q.footer;this.valueKey=q.valueKey||"value";this.template=n(q.template,q.engine,this.valueKey);this.local=q.local;this.prefetch=q.prefetch;this.remote=q.remote;this.itemHash={};this.adjacencyList={};this.storage=q.name?new g(q.name):null}k.mixin(o.prototype,{_processLocalData:function(q){this._mergeProcessedData(this._processData(q))},_loadPrefetchData:function(s){var y=this,A=m+(s.thumbprint||""),x,w,v,u,r,q;if(this.storage){x=this.storage.get(p.thumbprint);w=this.storage.get(p.protocol);v=this.storage.get(p.itemHash);u=this.storage.get(p.adjacencyList)}r=x!==A||w!==k.getProtocol();s=k.isString(s)?{url:s}:s;s.ttl=k.isNumber(s.ttl)?s.ttl:24*60*60*1000;if(v&&u&&!r){this._mergeProcessedData({itemHash:v,adjacencyList:u});q=a.Deferred().resolve()}else{q=a.getJSON(s.url).done(t)}return q;function t(C){var D=s.filter?s.filter(C):C,F=y._processData(D),E=F.itemHash,B=F.adjacencyList;if(y.storage){y.storage.set(p.itemHash,E,s.ttl);y.storage.set(p.adjacencyList,B,s.ttl);y.storage.set(p.thumbprint,A,s.ttl);y.storage.set(p.protocol,k.getProtocol(),s.ttl)}y._mergeProcessedData(F)}},_transformDatum:function(q){var t=k.isString(q)?q:q[this.valueKey],s=q.tokens||k.tokenizeText(t),r={value:t,tokens:s};if(k.isString(q)){r.datum={};r.datum[this.valueKey]=q}else{r.datum=q}r.tokens=k.filter(r.tokens,function(u){return !k.isBlankString(u)});r.tokens=k.map(r.tokens,function(u){return u.toLowerCase()});return r},_processData:function(r){var t=this,s={},q={};k.each(r,function(v,u){var x=t._transformDatum(u),w=k.getUniqueId(x.value);s[w]=x;k.each(x.tokens,function(B,C){var A=C.charAt(0),y=q[A]||(q[A]=[w]);!~k.indexOf(y,w)&&y.push(w)})});return{itemHash:s,adjacencyList:q}},_mergeProcessedData:function(q){var r=this;k.mixin(this.itemHash,q.itemHash);k.each(q.adjacencyList,function(t,s){var u=r.adjacencyList[t];r.adjacencyList[t]=u?u.concat(s):s})},_getLocalSuggestions:function(u){var v=this,q=[],r=[],s,t=[];k.each(u,function(x,y){var w=y.charAt(0);!~k.indexOf(q,w)&&q.push(w)});k.each(q,function(x,w){var y=v.adjacencyList[w];if(!y){return false}r.push(y);if(!s||y.length<s.length){s=y}});if(r.length<q.length){return[]}k.each(s,function(w,x){var B=v.itemHash[x],y,A;y=k.every(r,function(C){return ~k.indexOf(C,x)});A=y&&k.every(u,function(C){return k.some(B.tokens,function(D){return D.indexOf(C)===0})});A&&t.push(B)});return t},initialize:function(){var q;this.local&&this._processLocalData(this.local);this.transport=this.remote?new i(this.remote):null;q=this.prefetch?this._loadPrefetchData(this.prefetch):a.Deferred().resolve();this.local=this.prefetch=this.remote=null;this.initialize=function(){return q};return q},getSuggestions:function(t,r){var w=this,v,u,q=false;if(t.length<this.minLength){return}v=k.tokenizeQuery(t);u=this._getLocalSuggestions(v).slice(0,this.limit);if(u.length<this.limit&&this.transport){q=this.transport.get(t,s)}!q&&r&&r(u);function s(x){u=u.slice(0);k.each(x,function(A,y){var C=w._transformDatum(y),B;B=k.some(u,function(D){return C.value===D.value});!B&&u.push(C);return u.length<w.limit});r&&r(u)}}});return o;function n(t,r,u){var s,q;if(k.isFunction(t)){s=t}else{if(k.isString(t)){q=r.compile(t);s=k.bind(q.render,q)}else{s=function(v){return"<p>"+v[u]+"</p>"}}}return s}}();var f=function(){function p(q){var r=this;k.bindAll(this);this.specialKeyCodeMap={9:"tab",27:"esc",37:"left",39:"right",13:"enter",38:"up",40:"down"};this.$hint=a(q.hint);this.$input=a(q.input).on("blur.tt",this._handleBlur).on("focus.tt",this._handleFocus).on("keydown.tt",this._handleSpecialKeyEvent);if(!k.isMsie()){this.$input.on("input.tt",this._compareQueryToInputValue)}else{this.$input.on("keydown.tt keypress.tt cut.tt paste.tt",function(s){if(r.specialKeyCodeMap[s.which||s.keyCode]){return}k.defer(r._compareQueryToInputValue)})}this.query=this.$input.val();this.$overflowHelper=n(this.$input)}k.mixin(p.prototype,e,{_handleFocus:function(){this.trigger("focused")},_handleBlur:function(){this.trigger("blured")},_handleSpecialKeyEvent:function(q){var r=this.specialKeyCodeMap[q.which||q.keyCode];r&&this.trigger(r+"Keyed",q)},_compareQueryToInputValue:function(){var q=this.getInputValue(),r=o(this.query,q),s=r?this.query.length!==q.length:false;if(s){this.trigger("whitespaceChanged",{value:this.query})}else{if(!r){this.trigger("queryChanged",{value:this.query=q})}}},destroy:function(){this.$hint.off(".tt");this.$input.off(".tt");this.$hint=this.$input=this.$overflowHelper=null},focus:function(){this.$input.focus()},blur:function(){this.$input.blur()},getQuery:function(){return this.query},setQuery:function(q){this.query=q},getInputValue:function(){return this.$input.val()},setInputValue:function(r,q){this.$input.val(r);!q&&this._compareQueryToInputValue()},getHintValue:function(){return this.$hint.val()},setHintValue:function(q){this.$hint.val(q)},getLanguageDirection:function(){return(this.$input.css("direction")||"ltr").toLowerCase()},isOverflow:function(){this.$overflowHelper.text(this.getInputValue());return this.$overflowHelper.width()>this.$input.width()},isCursorAtEnd:function(){var s=this.$input.val().length,r=this.$input[0].selectionStart,q;if(k.isNumber(r)){return r===s}else{if(document.selection){q=document.selection.createRange();q.moveStart("character",-s);return s===q.text.length}}return true}});return p;function n(q){return a("<span></span>").css({position:"absolute",left:"-9999px",visibility:"hidden",whiteSpace:"nowrap",fontFamily:q.css("font-family"),fontSize:q.css("font-size"),fontStyle:q.css("font-style"),fontVariant:q.css("font-variant"),fontWeight:q.css("font-weight"),wordSpacing:q.css("word-spacing"),letterSpacing:q.css("letter-spacing"),textIndent:q.css("text-indent"),textRendering:q.css("text-rendering"),textTransform:q.css("text-transform")}).insertAfter(q)}function o(q,r){q=(q||"").replace(/^\s*/g,"").replace(/\s{2,}/g," ");r=(r||"").replace(/^\s*/g,"").replace(/\s{2,}/g," ");return q===r}}();var c=function(){var q={suggestionsList:'<span class="tt-suggestions"></span>'},n={suggestionsList:{display:"block"},suggestion:{whiteSpace:"nowrap",cursor:"pointer"},suggestionChild:{whiteSpace:"normal"}};function o(r){k.bindAll(this);this.isOpen=false;this.isEmpty=true;this.isMouseOverDropdown=false;this.$menu=a(r.menu).on("mouseenter.tt",this._handleMouseenter).on("mouseleave.tt",this._handleMouseleave).on("click.tt",".tt-suggestion",this._handleSelection).on("mouseover.tt",".tt-suggestion",this._handleMouseover)}k.mixin(o.prototype,e,{_handleMouseenter:function(){this.isMouseOverDropdown=true},_handleMouseleave:function(){this.isMouseOverDropdown=false},_handleMouseover:function(r){var s=a(r.currentTarget);this._getSuggestions().removeClass("tt-is-under-cursor");s.addClass("tt-is-under-cursor")},_handleSelection:function(r){var s=a(r.currentTarget);this.trigger("suggestionSelected",p(s))},_show:function(){this.$menu.css("display","block")},_hide:function(){this.$menu.hide()},_moveCursor:function(u){var s,r,v,t;if(!this.isVisible()){return}s=this._getSuggestions();r=s.filter(".tt-is-under-cursor");r.removeClass("tt-is-under-cursor");v=s.index(r)+u;v=(v+1)%(s.length+1)-1;if(v===-1){this.trigger("cursorRemoved");return}else{if(v<-1){v=s.length-1}}t=s.eq(v).addClass("tt-is-under-cursor");this._ensureVisibility(t);this.trigger("cursorMoved",p(t))},_getSuggestions:function(){return this.$menu.find(".tt-suggestions > .tt-suggestion")},_ensureVisibility:function(r){var u=this.$menu.height()+parseInt(this.$menu.css("paddingTop"),10)+parseInt(this.$menu.css("paddingBottom"),10),v=this.$menu.scrollTop(),t=r.position().top,s=t+r.outerHeight(true);if(t<0){this.$menu.scrollTop(v+t)}else{if(u<s){this.$menu.scrollTop(v+(s-u))}}},destroy:function(){this.$menu.off(".tt");this.$menu=null},isVisible:function(){return this.isOpen&&!this.isEmpty},closeUnlessMouseIsOverDropdown:function(){if(!this.isMouseOverDropdown){this.close()}},close:function(){if(this.isOpen){this.isOpen=false;this.isMouseOverDropdown=false;this._hide();this.$menu.find(".tt-suggestions > .tt-suggestion").removeClass("tt-is-under-cursor");this.trigger("closed")}},open:function(){if(!this.isOpen){this.isOpen=true;!this.isEmpty&&this._show();this.trigger("opened")}},setLanguageDirection:function(r){var s={left:"0",right:"auto"},t={left:"auto",right:" 0"};r==="ltr"?this.$menu.css(s):this.$menu.css(t)},moveCursorUp:function(){this._moveCursor(-1)},moveCursorDown:function(){this._moveCursor(+1)},getSuggestionUnderCursor:function(){var r=this._getSuggestions().filter(".tt-is-under-cursor").first();return r.length>0?p(r):null},getFirstSuggestion:function(){var r=this._getSuggestions().first();return r.length>0?p(r):null},renderSuggestions:function(v,A){var w="tt-dataset-"+v.name,B='<div class="tt-suggestion">%body</div>',u,t,r=this.$menu.find("."+w),x,y,s;if(r.length===0){t=a(q.suggestionsList).css(n.suggestionsList);r=a("<div></div>").addClass(w).append(v.header).append(t).append(v.footer).appendTo(this.$menu)}if(A.length>0){this.isEmpty=false;this.isOpen&&this._show();x=document.createElement("div");y=document.createDocumentFragment();k.each(A,function(C,D){D.dataset=v.name;u=v.template(D.datum);x.innerHTML=B.replace("%body",u);s=a(x.firstChild).css(n.suggestion).data("suggestion",D);s.children().each(function(){a(this).css(n.suggestionChild)});y.appendChild(s[0])});r.show().find(".tt-suggestions").html(y)}else{this.clearSuggestions(v.name)}this.trigger("suggestionsRendered")},clearSuggestions:function(t){var r=t?this.$menu.find(".tt-dataset-"+t):this.$menu.find('[class^="tt-dataset-"]'),s=r.find(".tt-suggestions");r.hide();s.empty();if(this._getSuggestions().length===0){this.isEmpty=true;this._hide()}}});return o;function p(r){return r.data("suggestion")}}();var j=function(){var q={wrapper:'<span class="twitter-typeahead"></span>',hint:'<input class="tt-hint" type="text" autocomplete="off" spellcheck="off" disabled>',dropdown:'<span class="tt-dropdown-menu"></span>'},o={wrapper:{position:"relative",display:"inline-block"},hint:{position:"absolute",top:"0",left:"0",borderColor:"transparent",boxShadow:"none"},query:{position:"relative",verticalAlign:"top",backgroundColor:"transparent"},dropdown:{position:"absolute",top:"100%",left:"0",zIndex:"100",display:"none"}};if(k.isMsie()){k.mixin(o.query,{backgroundImage:"url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)"})}if(k.isMsie()&&k.isMsie()<=7){k.mixin(o.wrapper,{display:"inline",zoom:"1"});k.mixin(o.query,{marginTop:"-1px"})}function r(v){var u,t,s;k.bindAll(this);this.$node=n(v.input);this.datasets=v.datasets;this.dir=null;this.eventBus=v.eventBus;u=this.$node.find(".tt-dropdown-menu");t=this.$node.find(".tt-query");s=this.$node.find(".tt-hint");this.dropdownView=new c({menu:u}).on("suggestionSelected",this._handleSelection).on("cursorMoved",this._clearHint).on("cursorMoved",this._setInputValueToSuggestionUnderCursor).on("cursorRemoved",this._setInputValueToQuery).on("cursorRemoved",this._updateHint).on("suggestionsRendered",this._updateHint).on("opened",this._updateHint).on("closed",this._clearHint).on("opened closed",this._propagateEvent);this.inputView=new f({input:t,hint:s}).on("focused",this._openDropdown).on("blured",this._closeDropdown).on("blured",this._setInputValueToQuery).on("enterKeyed tabKeyed",this._handleSelection).on("queryChanged",this._clearHint).on("queryChanged",this._clearSuggestions).on("queryChanged",this._getSuggestions).on("whitespaceChanged",this._updateHint).on("queryChanged whitespaceChanged",this._openDropdown).on("queryChanged whitespaceChanged",this._setLanguageDirection).on("escKeyed",this._closeDropdown).on("escKeyed",this._setInputValueToQuery).on("tabKeyed upKeyed downKeyed",this._managePreventDefault).on("upKeyed downKeyed",this._moveDropdownCursor).on("upKeyed downKeyed",this._openDropdown).on("tabKeyed leftKeyed rightKeyed",this._autocomplete)}k.mixin(r.prototype,e,{_managePreventDefault:function(t){var s=t.data,u,v,w=false;switch(t.type){case"tabKeyed":u=this.inputView.getHintValue();v=this.inputView.getInputValue();w=u&&u!==v;break;case"upKeyed":case"downKeyed":w=!s.shiftKey&&!s.ctrlKey&&!s.metaKey;break}w&&s.preventDefault()},_setLanguageDirection:function(){var s=this.inputView.getLanguageDirection();if(s!==this.dir){this.dir=s;this.$node.css("direction",s);this.dropdownView.setLanguageDirection(s)}},_updateHint:function(){var B=this.dropdownView.getFirstSuggestion(),v=B?B.value:null,t=this.dropdownView.isVisible(),w=this.inputView.isOverflow(),x,A,u,s,y;if(v&&t&&!w){x=this.inputView.getInputValue();A=x.replace(/\s{2,}/g," ").replace(/^\s+/g,"");u=k.escapeRegExChars(A);s=new RegExp("^(?:"+u+")(.*$)","i");y=s.exec(v);this.inputView.setHintValue(x+(y?y[1]:""))}},_clearHint:function(){this.inputView.setHintValue("")},_clearSuggestions:function(){this.dropdownView.clearSuggestions()},_setInputValueToQuery:function(){this.inputView.setInputValue(this.inputView.getQuery())},_setInputValueToSuggestionUnderCursor:function(s){var t=s.data;this.inputView.setInputValue(t.value,true)},_openDropdown:function(){this.dropdownView.open()},_closeDropdown:function(s){this.dropdownView[s.type==="blured"?"closeUnlessMouseIsOverDropdown":"close"]()},_moveDropdownCursor:function(t){var s=t.data;if(!s.shiftKey&&!s.ctrlKey&&!s.metaKey){this.dropdownView[t.type==="upKeyed"?"moveCursorUp":"moveCursorDown"]()}},_handleSelection:function(t){var s=t.type==="suggestionSelected",u=s?t.data:this.dropdownView.getSuggestionUnderCursor();if(u){this.inputView.setInputValue(u.value);s?this.inputView.focus():t.data.preventDefault();s&&k.isMsie()?k.defer(this.dropdownView.close):this.dropdownView.close();this.eventBus.trigger("selected",u.datum,u.dataset)}},_getSuggestions:function(){var t=this,s=this.inputView.getQuery();if(k.isBlankString(s)){return}k.each(this.datasets,function(v,u){u.getSuggestions(s,function(w){if(s===t.inputView.getQuery()){t.dropdownView.renderSuggestions(u,w)}})})},_autocomplete:function(s){var v,u,w,t,x;if(s.type==="rightKeyed"||s.type==="leftKeyed"){v=this.inputView.isCursorAtEnd();u=this.inputView.getLanguageDirection()==="ltr"?s.type==="leftKeyed":s.type==="rightKeyed";if(!v||u){return}}w=this.inputView.getQuery();t=this.inputView.getHintValue();if(t!==""&&w!==t){x=this.dropdownView.getFirstSuggestion();this.inputView.setInputValue(x.value);this.eventBus.trigger("autocompleted",x.datum,x.dataset)}},_propagateEvent:function(s){this.eventBus.trigger(s.type)},destroy:function(){this.inputView.destroy();this.dropdownView.destroy();p(this.$node);this.$node=null},setQuery:function(s){this.inputView.setQuery(s);this.inputView.setInputValue(s);this._clearHint();this._clearSuggestions();this._getSuggestions()}});return r;function n(x){var v=a(q.wrapper),s=a(q.dropdown),u=a(x),t=a(q.hint);v=v.css(o.wrapper);s=s.css(o.dropdown);t.css(o.hint).css({backgroundAttachment:u.css("background-attachment"),backgroundClip:u.css("background-clip"),backgroundColor:u.css("background-color"),backgroundImage:u.css("background-image"),backgroundOrigin:u.css("background-origin"),backgroundPosition:u.css("background-position"),backgroundRepeat:u.css("background-repeat"),backgroundSize:u.css("background-size")});u.data("ttAttrs",{dir:u.attr("dir"),autocomplete:u.attr("autocomplete"),spellcheck:u.attr("spellcheck"),style:u.attr("style")});u.addClass("tt-query").attr({autocomplete:"off",spellcheck:false}).css(o.query);try{!u.attr("dir")&&u.attr("dir","auto")}catch(w){}return u.wrap(v).parent().prepend(t).append(s)}function p(t){var s=t.find(".tt-query");k.each(s.data("ttAttrs"),function(u,v){k.isUndefined(v)?s.removeAttr(u):s.attr(u,v)});s.detach().removeData("ttAttrs").removeClass("tt-query").insertAfter(t);t.remove()}}();(function(){var n={},p="ttView",o;o={initialize:function(q){var r;q=k.isArray(q)?q:[q];if(q.length===0){a.error("no datasets provided")}r=k.map(q,function(u){var t=n[u.name]?n[u.name]:new b(u);if(u.name){n[u.name]=t}return t});return this.each(s);function s(){var t=a(this),u,v=new d({el:t});u=k.map(r,function(w){return w.initialize()});t.data(p,new j({input:t,eventBus:v=new d({el:t}),datasets:r}));a.when.apply(a,u).always(function(){k.defer(function(){v.trigger("initialized")})})}},destroy:function(){return this.each(q);function q(){var r=a(this),s=r.data(p);if(s){s.destroy();r.removeData(p)}}},setQuery:function(q){return this.each(r);function r(){var s=a(this).data(p);s&&s.setQuery(q)}}};jQuery.fn.typeahead=function(q){if(o[q]){return o[q].apply(this,[].slice.call(arguments,1))}else{return o.initialize.apply(this,arguments)}}})()})(window.jQuery);(function(){var a=Handlebars.template,b=Handlebars.templates=Handlebars.templates||{};b.autocompleteSearchResult=a(function(h,e,i,j,d){this.compilerInfo=[3,">= 1.0.0-rc.4"];i=i||h.helpers;d=d||{};var c="",n,g="function",f=this.escapeExpression,m=this;function k(q,p){var o="",r;o+='\n    <span class="time">\n      ';if(r=i.Date){r=r.call(q,{hash:{},data:p})}else{r=q.Date;r=typeof r===g?r.apply(q):r}o+=f(r)+" ";if(r=i.Time){r=r.call(q,{hash:{},data:p})}else{r=q.Time;r=typeof r===g?r.apply(q):r}o+=f(r)+'\n    </span>\n    <span class="channelName">\n      ';if(r=i.Channel){r=r.call(q,{hash:{},data:p})}else{r=q.Channel;r=typeof r===g?r.apply(q):r}o+=f(r)+"\n    </span>\n  ";return o}c+='<img src="';if(n=i.Image){n=n.call(e,{hash:{},data:d})}else{n=e.Image;n=typeof n===g?n.apply(e):n}c+=f(n)+'&amp;width=60&amp;height=42" width="60px" height="42px"/>\n<div class="description">\n  <p>';if(n=i.Title){n=n.call(e,{hash:{},data:d})}else{n=e.Title;n=typeof n===g?n.apply(e):n}c+=f(n)+"</p>\n  ";n=i.each.call(e,e.Details,{hash:{},inverse:m.noop,fn:m.program(1,k,d),data:d});if(n||n===0){c+=n}c+="\n</div>";return c})})();(function(a){a.fn.bPopup=function(H,J){function N(){a.isFunction(b.onOpen)&&b.onOpen.call(v);E=(x.data("bPopup")||0)+1;w="__bPopup"+E;F="auto"!==b.position[1];G="auto"!==b.position[0];C="fixed"===b.positionStyle;D=L(v,b.amsl);y=F?b.position[1]:D[1];A=G?b.position[0]:D[0];K=M();b.modal&&a('<div class="bModal '+w+'"></div>').css({"background-color":b.modalColor,height:"100%",left:0,opacity:0,position:"fixed",top:0,width:"100%","z-index":b.zIndex+E}).each(function(){b.appending&&a(this).appendTo(b.appendTo)}).animate({opacity:b.opacity},b.fadeSpeed);v.data("bPopup",b).data("id",w).css({left:!b.follow[0]&&G||C?A:B.scrollLeft()+A,position:b.positionStyle||"absolute",top:!b.follow[1]&&F||C?y:B.scrollTop()+y,"z-index":b.zIndex+E+1}).each(function(){b.appending&&a(this).appendTo(b.appendTo);if(null!=b.loadUrl){switch(b.contentContainer=a(b.contentContainer||v),b.content){case"iframe":a('<iframe scrolling="no" frameborder="0"></iframe>').attr("src",b.loadUrl).appendTo(b.contentContainer);break;default:b.contentContainer.load(b.loadUrl)}}}).fadeIn(b.fadeSpeed,function(){a.isFunction(J)&&J.call(v);O()})}function I(){b.modal&&a(".bModal."+v.data("id")).fadeOut(b.fadeSpeed,function(){a(this).remove()});v.stop().fadeOut(b.fadeSpeed,function(){null!=b.loadUrl&&b.contentContainer.empty()});x.data("bPopup",0<x.data("bPopup")-1?x.data("bPopup")-1:null);b.scrollBar||a("html").css("overflow","auto");a("."+b.closeClass).die("click."+w);a(".bModal."+w).die("click");B.unbind("keydown."+w);x.unbind("."+w);v.data("bPopup",null);a.isFunction(b.onClose)&&setTimeout(function(){b.onClose.call(v)},b.fadeSpeed);return !1}function O(){x.data("bPopup",E);a("."+b.closeClass).live("click."+w,I);b.modalClose&&a(".bModal."+w).live("click",I).css("cursor","pointer");(b.follow[0]||b.follow[1])&&x.bind("scroll."+w,function(){K&&v.stop().animate({left:b.follow[0]&&!C?B.scrollLeft()+A:A,top:b.follow[1]&&!C?B.scrollTop()+y:y},b.followSpeed)}).bind("resize."+w,function(){if(K=M()){D=L(v,b.amsl),b.follow[0]&&(A=G?A:D[0]),b.follow[1]&&(y=F?y:D[1]),v.stop().each(function(){C?a(this).css({left:A,top:y},b.followSpeed):a(this).animate({left:G?A:A+B.scrollLeft(),top:F?y:y+B.scrollTop()},b.followSpeed)})}});b.escClose&&B.bind("keydown."+w,function(c){27==c.which&&I()})}function L(e,f){var g=(x.width()-e.outerWidth(!0))/2,h=(x.height()-e.outerHeight(!0))/2-f;return[g,20>h?20:h]}function M(){return x.height()>v.outerHeight(!0)+20&&x.width()>v.outerWidth(!0)+20}a.isFunction(H)&&(J=H,H=null);var b=a.extend({},a.fn.bPopup.defaults,H);b.scrollBar||a("html").css("overflow","hidden");var v=this,B=a(document),x=a(window),E,w,K,F,G,C,D,y,A;this.close=function(){b=v.data("bPopup");I()};return this.each(function(){v.data("bPopup")||N()})};a.fn.bPopup.defaults={amsl:50,appending:!0,appendTo:"body",closeClass:"bClose",content:"ajax",contentContainer:null,escClose:!0,fadeSpeed:250,follow:[!0,!0],followSpeed:500,loadUrl:null,modal:!0,modalClose:!0,modalColor:"#000",onClose:null,onOpen:null,opacity:0.7,position:["auto","auto"],positionStyle:"absolute",scrollBar:!0,zIndex:9997}})(jQuery);Namespace("RT.utils").InputPlaceholder=new Class({initialize:function(a,c){a=document.getElement(a);var b=c||a.get("placeholder")||a.get("value");a.set("value",b);a.addEvents({focus:this.removeText.bind(a,b),blur:this.showText.bind(a,b)})},removeText:function(b,a){if(this.get("value")===b){this.set("value","")}},showText:function(b,a){if(this.get("value")===""){this.set("value",b)}}});var $searchBox=jQuery("input#keywords");$searchBox.typeahead([{header:"<h1>Upcoming Episodes</h1>",name:"episodes",remote:"/rt-service/newsearch/episode?q=%QUERY",template:Handlebars.templates.autocompleteSearchResult},{header:"<h1>Latest News</h1>",name:"articles",remote:"/rt-service/newsearch/article?q=%QUERY",template:Handlebars.templates.autocompleteSearchResult}]);$searchBox.on("typeahead:selected",function(a,b,c){document.location.href=b.Url});Namespace("RT.utils").WidgetLoader=new Class({Implements:[Options,Events],initialize:function(b,a){this.setOptions(a);this.widgets=$$(b);this.checkCookie()},options:{maxIntervals:4,timeOutDelay:500,onComplete:function(){}},requestWidget:function(c){var b=this;var a=0;Array.each(c,function(f,d){var e=f.get("data-widget-urls").split(";");Array.each(e,function(h,g){a=a+1;new Request({url:h,method:"get",evalScripts:true,onRequest:function(){f.adopt(new Element("img.loadspinner[src=/assets/images/ajax-loaders/apple-style-trans.gif]"))},onSuccess:function(j){if(f.getElement(".loadspinner")){f.getElement(".loadspinner").destroy()}a=a-1;if(!Browser.ie){var i=new Element("div",{html:j});f.adopt(i.getChildren())}else{f.appendChild(innerShiv(j))}if(a<1){b.fireEvent("complete")}f.removeClass("loading");b.fireEvent("loaded",f)},onTimeout:function(){if(f.getElement(".loadspinner")){f.getElement(".loadspinner").destroy()}a=a-1;if(a<1){this.fireEvent("complete")}f.removeClass("loading");f.addClass("loadFailed")},onFailure:function(i){if(f.getElement(".loadspinner")){f.getElement(".loadspinner").destroy()}a=a-1;if(a<1){this.fireEvent("complete")}f.removeClass("loading");f.addClass("loadFailed")}}).send()})})},checkCookie:function(){if(Cookie.read("purple")){this.requestWidget(this.widgets)}else{var b=0,c=this.options.maxIntervals;var a=setInterval(function(){if(Cookie.read("purple")||b>c){clearInterval(a);this.requestWidget(this.widgets)}b=b+1}.bind(this),this.options.timeOutDelay)}}});new RT.utils.WidgetLoader($$(".widget-container"),{});var loginLocationCookie=new Class(function(){var a=[/^\/$/i,/^\/film/i,/^\/tv/i,/^\/radio/i,/^\/news/i,/^\/blog/i,/^\/photos/i,/^\/episode/i,/^\/programme/i,/^\/search/i,/^\/person/i,/^\/watchlist/i,/^\/offers/i,/^\/win/i];var b=function(d){Cookie.write("RTCurrentPage",d)};var c=function(d){d=d.trim();if(d.indexOf("http:")>=0){d=d.substring(7)}return d.substring(d.indexOf("/"))};return{initialize:function(){var d=c(location.href);for(var e=0;e<a.length;e++){if(a[e].test(d)){b(d)}}}}}());new loginLocationCookie();Namespace("RT.utils").Dialog=new Class(function(){var e=function(f){var k=window,g=f.getDimensions(),m=k.getSize(),j=k.getScroll().y,n=m.y,o=m.x,h=(o/2)-(g.x/2),i=(n/2)+(j)-(g.y/2);f.setStyles({left:h>0?h:0,top:i>0?i:20,position:"absolute","z-index":10003})};var d=function(){var g=window.getScrollSize(),f=this;return new Element("div.overlay",{styles:{position:"absolute","z-index":10002,left:0,top:0,width:g.x,height:g.y},events:{click:function(){f.hide()}}}).hide()};var c=function(){var g=this;var f=new Element("div",{role:"dialog","aria-hidden":true,"class":this.options["class"]}).grab(new Element("div")).hide();new Element("a.dialog-close[role=button][href=#][title=Close][text=Close]",{styles:{position:"absolute",top:"-12px",right:"-12px"},events:{click:function(h){g.hide();h.preventDefault()}}}).inject(f);f.addClass("dialog");return f};var b=function(){var f=this;$(document).addEvent("keyup",function(g){if(g.key=="esc"){f.hide()}});window.addEvent("resize",function(){var g=window;e(f.dialog);f.overlay.setStyles({width:g.getSize().x,height:g.getScrollSize().y})})};var a=function(f){(typeOf(f)=="element")?$(this).getElement("div").grab(f):$(this).getElement("div").set("html",f)};return{Implements:[Options,Events],initialize:function(g,h){var f=$$(".overlay"),i;this.setOptions(h);this.dialog=c.call(this);(f.length==0?i=d.call(this):i=f);this.overlay=i;this.overlay.inject($(document.body));a.call(this,g);$(this).inject($(document.body));b.call(this)},options:{"class":null},show:function(f){if(f!=undefined){a.call(this,f)}e($(this));$(this).show();$(this).set("aria-hidden",false);this.overlay.show();this.fireEvent("dialogShown")},hide:function(){var f=$$(".dialog");f.hide();f.set("aria-hidden",true);this.overlay.hide();this.fireEvent("dialogHidden")},toElement:function(){return this.dialog}}}());Namespace("RT.personalisation").LoginStatus=new Class.Singleton(function(){var a="AuthToken";return{initialize:function(){if(this.userIsLogedIn()){}else{$$(".logedout-visibile").show()}},userIsLogedIn:function(){var b=Cookie.read(a);return b&&b!=""}}}());var imPolicyCookieOverlay={init:function(){var e=document.createElement("div");e.id="imPolicycookiemessage";e.innerHTML='<div class="imPolicycookieinner">We use cookies to improve your experience of our website. Cookies perform functions like recognising you each time you visit and delivering advertising messages that are relevant to you. Read more <a href="http://www.immediate.co.uk/cookies-policy" target="_blank">here</a></div><div class="overlayPolicycookieinner"></div>';var a="#imPolicycookiemessage{position:fixed;bottom:0;left:0;right:0; margin-left:auto; margin-right:auto; width:960px; display:none;}.imPolicycookieinner a{color:#fff;} .imPolicycookieinner{position:relative; background-color:#000; padding:5px 10px; z-index:10; color:#fff; font-family:arial, verdana, helvetica; font-size:13px; opacity:0.7; filter: alpha(opacity=70); text-align:left;} .overlayPolicycookieinner{float:left; position: absolute; bottom:0;left:0; right:0; margin-left:auto; margin-right:auto; width:960px; background-color:#000; z-index:0;}";var f=document.getElementsByTagName("head")[0];var b=document.createElement("style");b.type="text/css";b.media="screen";if(b.styleSheet){b.styleSheet.cssText=a}else{b.appendChild(document.createTextNode(a))}f.appendChild(b);var d=document.getElementsByTagName("body")[0];d.appendChild(e);var c=imPolicyCookieOverlay.readCookie("imPolicyCookieDisplay");if(!c){imPolicyCookieOverlay.showLayer("imPolicycookiemessage");setTimeout("imPolicyCookieOverlay.hideLayer('imPolicycookiemessage')",12000);imPolicyCookieOverlay.createCookie("imPolicyCookieDisplay","true",99)}},showLayer:function(a){if(document.all){document.all[a].style.display="block"}else{document.getElementById(a).style.display="block"}},hideLayer:function(a){if(document.all){document.all[a].style.display="none"}else{document.getElementById(a).style.display="none"}},createCookie:function(d,e,b){if(b){var a=new Date();a.setTime(a.getTime()+(b*24*60*60*1000));var c="; expires="+a.toGMTString()}else{var c=""}document.cookie=d+"="+e+c+"; path=/"},readCookie:function(e){var f=e+"=";var b=document.cookie.split(";");for(var d=0;d<b.length;d++){var a=b[d];while(a.charAt(0)==" "){a=a.substring(1,a.length)}if(a.indexOf(f)==0){return a.substring(f.length,a.length)}}return null},eraseCookie:function(a){imPolicyCookieOverlay.createCookie(a,"",-1)}};(function(a){if(a.fn.dotdotdot){return}a.fn.dotdotdot=function(s){if(this.length==0){e(true,'No element found for "'+this.selector+'".');return this}if(this.length>1){return this.each(function(){a(this).dotdotdot(s)})}var p=this;if(p.data("dotdotdot")){p.trigger("destroy.dot")}p.bind_events=function(){p.bind("update.dot",function(A,y){A.preventDefault();A.stopPropagation();t.maxHeight=(typeof t.height=="number")?t.height:m(p);t.maxHeight+=t.tolerance;if(typeof y!="undefined"){if(typeof y=="string"||y instanceof HTMLElement){y=a("<div />").append(y).contents()}if(y instanceof a){u=y}}q=p.wrapInner('<div class="dotdotdot" />').children();q.empty().append(u.clone(true)).css({height:"auto",width:"auto",border:"none",padding:0,margin:0});var x=false,B=false;if(r.afterElement){x=r.afterElement.clone(true);r.afterElement.remove()}if(o(q,t)){if(t.wrap=="children"){B=d(q,t,x)}else{B=g(q,p,q,t,x)}}q.replaceWith(q.contents());q=null;if(a.isFunction(t.callback)){t.callback.call(p[0],B,u)}r.isTruncated=B;return B}).bind("isTruncated.dot",function(x,y){x.preventDefault();x.stopPropagation();if(typeof y=="function"){y.call(p[0],r.isTruncated)}return r.isTruncated}).bind("originalContent.dot",function(x,y){x.preventDefault();x.stopPropagation();if(typeof y=="function"){y.call(p[0],u)}return u}).bind("destroy.dot",function(x){x.preventDefault();x.stopPropagation();p.unwatch().unbind_events().empty().append(u).data("dotdotdot",false)});return p};p.unbind_events=function(){p.unbind(".dot");return p};p.watch=function(){p.unwatch();if(t.watch=="window"){var x=a(window),A=x.width(),y=x.height();x.bind("resize.dot"+r.dotId,function(){if(A!=x.width()||y!=x.height()||!t.windowResizeFix){A=x.width();y=x.height();if(v){clearInterval(v)}v=setTimeout(function(){p.trigger("update.dot")},10)}})}else{w=j(p);v=setInterval(function(){var B=j(p);if(w.width!=B.width||w.height!=B.height){p.trigger("update.dot");w=j(p)}},100)}return p};p.unwatch=function(){a(window).unbind("resize.dot"+r.dotId);if(v){clearInterval(v)}return p};var u=p.contents(),t=a.extend(true,{},a.fn.dotdotdot.defaults,s),r={},w={},v=null,q=null;r.afterElement=i(t.after,p);r.isTruncated=false;r.dotId=f++;p.data("dotdotdot",true).bind_events().trigger("update.dot");if(t.watch){p.watch()}return p};a.fn.dotdotdot.defaults={ellipsis:"... ",wrap:"word",lastCharacter:{remove:[" ",",",";",".","!","?"],noEllipsis:[]},tolerance:0,callback:null,after:null,height:null,watch:false,windowResizeFix:true,debug:false};var f=1;function d(q,w,t){var r=q.children(),u=false;q.empty();for(var s=0,v=r.length;s<v;s++){var p=r.eq(s);q.append(p);if(t){q.append(t)}if(o(q,w)){p.remove();u=true;break}else{if(t){t.remove()}}}return u}function g(r,p,t,C,v){var s=r.contents(),y=false;r.empty();var B="table, thead, tbody, tfoot, tr, col, colgroup, object, embed, param, ol, ul, dl, select, optgroup, option, textarea, script, style";for(var u=0,A=s.length;u<A;u++){if(y){break}var w=s[u],q=a(w);if(typeof w=="undefined"){continue}r.append(q);if(v){var x=(r.is(B))?"after":"append";r[x](v)}if(w.nodeType==3){if(o(t,C)){y=h(q,p,t,C,v)}}else{y=g(q,p,t,C,v)}if(!y){if(v){v.remove()}}}return y}function h(q,p,r,A,t){var w=false,u=q[0];if(typeof u=="undefined"){return false}var C=(A.wrap=="letter")?"":" ",E=k(u).split(C),B=-1,y=-1,D=0,v=E.length-1;while(D<=v){var x=Math.floor((D+v)/2);if(x==y){break}y=x;n(u,E.slice(0,y+1).join(C)+A.ellipsis);if(!o(r,A)){B=y;D=y}else{v=y}}if(B!=-1){var F=E.slice(0,B+1).join(C);w=true;while(a.inArray(F.slice(-1),A.lastCharacter.remove)>-1){F=F.slice(0,-1)}if(a.inArray(F.slice(-1),A.lastCharacter.noEllipsis)<0){F+=A.ellipsis}n(u,F)}else{var s=q.parent();q.remove();$n=s.contents().eq(-1);w=h($n,p,r,A,t)}return w}function o(p,q){return p.innerHeight()>q.maxHeight}function j(p){return{width:p.innerWidth(),height:p.innerHeight()}}function n(q,p){if(q.innerText){q.innerText=p}else{if(q.nodeValue){q.nodeValue=p}else{if(q.textContent){q.textContent=p}}}}function k(p){if(p.innerText){return p.innerText}else{if(p.nodeValue){return p.nodeValue}else{if(p.textContent){return p.textContent}else{return""}}}}function i(q,p){if(typeof q=="undefined"){return false}if(!q){return false}if(typeof q=="string"){q=a(q,p);return(q.length)?q:false}if(typeof q=="object"){return(typeof q.jquery=="undefined")?false:q}return false}function m(p){var r=p.innerHeight(),q=["paddingTop","paddingBottom"];for(z=0,l=q.length;z<l;z++){var s=parseInt(p.css(q[z]),10);if(isNaN(s)){s=0}r-=s}return r}function e(p,q){if(!p){return false}if(typeof q=="string"){q="dotdotdot: "+q}else{q=["dotdotdot:",q]}if(window.console&&window.console.log){window.console.log(q)}return false}var b=a.fn.html;a.fn.html=function(p){if(typeof p!="undefined"){if(this.data("dotdotdot")){if(typeof p!="function"){return this.trigger("update",[p])}}return b.call(this,p)}return b.call(this)};var c=a.fn.text;a.fn.text=function(p){if(typeof p!="undefined"){if(this.data("dotdotdot")){var q=a("<div />");q.text(p);p=q.html();q.remove();return this.trigger("update",[p])}return c.call(this,p)}return c.call(this)}})(jQuery);
/*
 * jCarousel - Riding carousels with jQuery
 *   http://sorgalla.com/jcarousel/
 *
 * Copyright (c) 2006 Jan Sorgalla (http://sorgalla.com)
 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
 *
 * Built on top of the jQuery library
 *   http://jquery.com
 *
 * Inspired by the "Carousel Component" by Bill Scott
 *   http://billwscott.com/carousel/
 */
(function(b){var d={vertical:!1,rtl:!1,start:1,offset:1,size:null,scroll:3,visible:null,animation:"normal",easing:"swing",auto:0,wrap:null,initCallback:null,setupCallback:null,reloadCallback:null,itemLoadCallback:null,itemFirstInCallback:null,itemFirstOutCallback:null,itemLastInCallback:null,itemLastOutCallback:null,itemVisibleInCallback:null,itemVisibleOutCallback:null,animationStepCallback:null,buttonNextHTML:"<div></div>",buttonPrevHTML:"<div></div>",buttonNextEvent:"click",buttonPrevEvent:"click",buttonNextCallback:null,buttonPrevCallback:null,itemFallbackDimension:null},c=!1;b(window).bind("load.jcarousel",function(){c=!0});b.jcarousel=function(g,m){this.options=b.extend({},d,m||{});this.autoStopped=this.locked=!1;this.buttonPrevState=this.buttonNextState=this.buttonPrev=this.buttonNext=this.list=this.clip=this.container=null;if(!m||m.rtl===void 0){this.options.rtl=(b(g).attr("dir")||b("html").attr("dir")||"").toLowerCase()=="rtl"}this.wh=!this.options.vertical?"width":"height";this.lt=!this.options.vertical?this.options.rtl?"right":"left":"top";for(var k="",n=g.className.split(" "),p=0;p<n.length;p++){if(n[p].indexOf("jcarousel-skin")!=-1){b(g).removeClass(n[p]);k=n[p];break}}g.nodeName.toUpperCase()=="UL"||g.nodeName.toUpperCase()=="OL"?(this.list=b(g),this.clip=this.list.parents(".jcarousel-clip"),this.container=this.list.parents(".jcarousel-container")):(this.container=b(g),this.list=this.container.find("ul,ol").eq(0),this.clip=this.container.find(".jcarousel-clip"));if(this.clip.size()===0){this.clip=this.list.wrap("<div></div>").parent()}if(this.container.size()===0){this.container=this.clip.wrap("<div></div>").parent()}k!==""&&this.container.parent()[0].className.indexOf("jcarousel-skin")==-1&&this.container.wrap('<div class=" '+k+'"></div>');this.buttonPrev=b(".jcarousel-prev",this.container);if(this.buttonPrev.size()===0&&this.options.buttonPrevHTML!==null){this.buttonPrev=b(this.options.buttonPrevHTML).appendTo(this.container)}this.buttonPrev.addClass(this.className("jcarousel-prev"));this.buttonNext=b(".jcarousel-next",this.container);if(this.buttonNext.size()===0&&this.options.buttonNextHTML!==null){this.buttonNext=b(this.options.buttonNextHTML).appendTo(this.container)}this.buttonNext.addClass(this.className("jcarousel-next"));this.clip.addClass(this.className("jcarousel-clip")).css({position:"relative"});this.list.addClass(this.className("jcarousel-list")).css({overflow:"hidden",position:"relative",top:0,margin:0,padding:0}).css(this.options.rtl?"right":"left",0);this.container.addClass(this.className("jcarousel-container")).css({position:"relative"});!this.options.vertical&&this.options.rtl&&this.container.addClass("jcarousel-direction-rtl").attr("dir","rtl");var s=this.options.visible!==null?Math.ceil(this.clipping()/this.options.visible):null,k=this.list.children("li"),o=this;if(k.size()>0){var q=0,r=this.options.offset;k.each(function(){o.format(this,r++);q+=o.dimension(this,s)});this.list.css(this.wh,q+100+"px");if(!m||m.size===void 0){this.options.size=k.size()}}this.container.css("display","block");this.buttonNext.css("display","block");this.buttonPrev.css("display","block");this.funcNext=function(){o.next()};this.funcPrev=function(){o.prev()};this.funcResize=function(){o.resizeTimer&&clearTimeout(o.resizeTimer);o.resizeTimer=setTimeout(function(){o.reload()},100)};this.options.initCallback!==null&&this.options.initCallback(this,"init");!c&&b.browser.safari?(this.buttons(!1,!1),b(window).bind("load.jcarousel",function(){o.setup()})):this.setup()};var a=b.jcarousel;a.fn=a.prototype={jcarousel:"0.2.8"};a.fn.extend=a.extend=b.extend;a.fn.extend({setup:function(){this.prevLast=this.prevFirst=this.last=this.first=null;this.animating=!1;this.tail=this.resizeTimer=this.timer=null;this.inTail=!1;if(!this.locked){this.list.css(this.lt,this.pos(this.options.offset)+"px");var e=this.pos(this.options.start,!0);this.prevFirst=this.prevLast=null;this.animate(e,!1);b(window).unbind("resize.jcarousel",this.funcResize).bind("resize.jcarousel",this.funcResize);this.options.setupCallback!==null&&this.options.setupCallback(this)}},reset:function(){this.list.empty();this.list.css(this.lt,"0px");this.list.css(this.wh,"10px");this.options.initCallback!==null&&this.options.initCallback(this,"reset");this.setup()},reload:function(){this.tail!==null&&this.inTail&&this.list.css(this.lt,a.intval(this.list.css(this.lt))+this.tail);this.tail=null;this.inTail=!1;this.options.reloadCallback!==null&&this.options.reloadCallback(this);if(this.options.visible!==null){var e=this,g=Math.ceil(this.clipping()/this.options.visible),f=0,h=0;this.list.children("li").each(function(i){f+=e.dimension(this,g);i+1<e.first&&(h=f)});this.list.css(this.wh,f+"px");this.list.css(this.lt,-h+"px")}this.scroll(this.first,!1)},lock:function(){this.locked=!0;this.buttons()},unlock:function(){this.locked=!1;this.buttons()},size:function(e){if(e!==void 0){this.options.size=e,this.locked||this.buttons()}return this.options.size},has:function(e,g){if(g===void 0||!g){g=e}if(this.options.size!==null&&g>this.options.size){g=this.options.size}for(var f=e;f<=g;f++){var h=this.get(f);if(!h.length||h.hasClass("jcarousel-item-placeholder")){return !1}}return !0},get:function(e){return b(">.jcarousel-item-"+e,this.list)},add:function(f,h){var g=this.get(f),i=0,n=b(h);if(g.length===0){for(var m,k=a.intval(f),g=this.create(f);;){if(m=this.get(--k),k<=0||m.length){k<=0?this.list.prepend(g):m.after(g);break}}}else{i=this.dimension(g)}n.get(0).nodeName.toUpperCase()=="LI"?(g.replaceWith(n),g=n):g.empty().append(h);this.format(g.removeClass(this.className("jcarousel-item-placeholder")),f);n=this.options.visible!==null?Math.ceil(this.clipping()/this.options.visible):null;i=this.dimension(g,n)-i;f>0&&f<this.first&&this.list.css(this.lt,a.intval(this.list.css(this.lt))-i+"px");this.list.css(this.wh,a.intval(this.list.css(this.wh))+i+"px");return g},remove:function(e){var g=this.get(e);if(g.length&&!(e>=this.first&&e<=this.last)){var f=this.dimension(g);e<this.first&&this.list.css(this.lt,a.intval(this.list.css(this.lt))+f+"px");g.remove();this.list.css(this.wh,a.intval(this.list.css(this.wh))-f+"px")}},next:function(){this.tail!==null&&!this.inTail?this.scrollTail(!1):this.scroll((this.options.wrap=="both"||this.options.wrap=="last")&&this.options.size!==null&&this.last==this.options.size?1:this.first+this.options.scroll)},prev:function(){this.tail!==null&&this.inTail?this.scrollTail(!0):this.scroll((this.options.wrap=="both"||this.options.wrap=="first")&&this.options.size!==null&&this.first==1?this.options.size:this.first-this.options.scroll)},scrollTail:function(e){if(!this.locked&&!this.animating&&this.tail){this.pauseAuto();var f=a.intval(this.list.css(this.lt)),f=!e?f-this.tail:f+this.tail;this.inTail=!e;this.prevFirst=this.first;this.prevLast=this.last;this.animate(f)}},scroll:function(e,f){!this.locked&&!this.animating&&(this.pauseAuto(),this.animate(this.pos(e),f))},pos:function(f,q){var p=a.intval(this.list.css(this.lt));if(this.locked||this.animating){return p}this.options.wrap!="circular"&&(f=f<1?1:this.options.size&&f>this.options.size?this.options.size:f);for(var r=this.first>f,t=this.options.wrap!="circular"&&this.first<=1?1:this.first,w=r?this.get(t):this.get(this.last),s=r?t:t-1,u=null,v=0,x=!1,y=0;r?--s>=f:++s<f;){u=this.get(s);x=!u.length;if(u.length===0&&(u=this.create(s).addClass(this.className("jcarousel-item-placeholder")),w[r?"before":"after"](u),this.first!==null&&this.options.wrap=="circular"&&this.options.size!==null&&(s<=0||s>this.options.size))){w=this.get(this.index(s)),w.length&&(u=this.add(s,w.clone(!0)))}w=u;y=this.dimension(u);x&&(v+=y);if(this.first!==null&&(this.options.wrap=="circular"||s>=1&&(this.options.size===null||s<=this.options.size))){p=r?p+y:p-y}}for(var t=this.clipping(),A=[],C=0,B=0,w=this.get(f-1),s=f;++C;){u=this.get(s);x=!u.length;if(u.length===0){u=this.create(s).addClass(this.className("jcarousel-item-placeholder"));if(w.length===0){this.list.prepend(u)}else{w[r?"before":"after"](u)}if(this.first!==null&&this.options.wrap=="circular"&&this.options.size!==null&&(s<=0||s>this.options.size)){w=this.get(this.index(s)),w.length&&(u=this.add(s,w.clone(!0)))}}w=u;y=this.dimension(u);if(y===0){throw Error("jCarousel: No width/height set for items. This will cause an infinite loop. Aborting...")}this.options.wrap!="circular"&&this.options.size!==null&&s>this.options.size?A.push(u):x&&(v+=y);B+=y;if(B>=t){break}s++}for(u=0;u<A.length;u++){A[u].remove()}v>0&&(this.list.css(this.wh,this.dimension(this.list)+v+"px"),r&&(p-=v,this.list.css(this.lt,a.intval(this.list.css(this.lt))-v+"px")));v=f+C-1;if(this.options.wrap!="circular"&&this.options.size&&v>this.options.size){v=this.options.size}if(s>v){C=0;s=v;for(B=0;++C;){u=this.get(s--);if(!u.length){break}B+=this.dimension(u);if(B>=t){break}}}s=v-C+1;this.options.wrap!="circular"&&s<1&&(s=1);if(this.inTail&&r){p+=this.tail,this.inTail=!1}this.tail=null;if(this.options.wrap!="circular"&&v==this.options.size&&v-C+1>=1&&(r=a.intval(this.get(v).css(!this.options.vertical?"marginRight":"marginBottom")),B-r>t)){this.tail=B-t-r}if(q&&f===this.options.size&&this.tail){p-=this.tail,this.inTail=!0}for(;f-->s;){p+=this.dimension(this.get(f))}this.prevFirst=this.first;this.prevLast=this.last;this.first=s;this.last=v;return p},animate:function(e,h){if(!this.locked&&!this.animating){this.animating=!0;var g=this,i=function(){g.animating=!1;e===0&&g.list.css(g.lt,0);!g.autoStopped&&(g.options.wrap=="circular"||g.options.wrap=="both"||g.options.wrap=="last"||g.options.size===null||g.last<g.options.size||g.last==g.options.size&&g.tail!==null&&!g.inTail)&&g.startAuto();g.buttons();g.notify("onAfterAnimation");if(g.options.wrap=="circular"&&g.options.size!==null){for(var f=g.prevFirst;f<=g.prevLast;f++){f!==null&&!(f>=g.first&&f<=g.last)&&(f<1||f>g.options.size)&&g.remove(f)}}};this.notify("onBeforeAnimation");if(!this.options.animation||h===!1){this.list.css(this.lt,e+"px"),i()}else{var j=!this.options.vertical?this.options.rtl?{right:e}:{left:e}:{top:e},i={duration:this.options.animation,easing:this.options.easing,complete:i};if(b.isFunction(this.options.animationStepCallback)){i.step=this.options.animationStepCallback}this.list.animate(j,i)}}},startAuto:function(e){if(e!==void 0){this.options.auto=e}if(this.options.auto===0){return this.stopAuto()}if(this.timer===null){this.autoStopped=!1;var f=this;this.timer=window.setTimeout(function(){f.next()},this.options.auto*1000)}},stopAuto:function(){this.pauseAuto();this.autoStopped=!0},pauseAuto:function(){if(this.timer!==null){window.clearTimeout(this.timer),this.timer=null}},buttons:function(e,g){if(e==null&&(e=!this.locked&&this.options.size!==0&&(this.options.wrap&&this.options.wrap!="first"||this.options.size===null||this.last<this.options.size),!this.locked&&(!this.options.wrap||this.options.wrap=="first")&&this.options.size!==null&&this.last>=this.options.size)){e=this.tail!==null&&!this.inTail}if(g==null&&(g=!this.locked&&this.options.size!==0&&(this.options.wrap&&this.options.wrap!="last"||this.first>1),!this.locked&&(!this.options.wrap||this.options.wrap=="last")&&this.options.size!==null&&this.first==1)){g=this.tail!==null&&this.inTail}var f=this;this.buttonNext.size()>0?(this.buttonNext.unbind(this.options.buttonNextEvent+".jcarousel",this.funcNext),e&&this.buttonNext.bind(this.options.buttonNextEvent+".jcarousel",this.funcNext),this.buttonNext[e?"removeClass":"addClass"](this.className("jcarousel-next-disabled")).attr("disabled",e?!1:!0),this.options.buttonNextCallback!==null&&this.buttonNext.data("jcarouselstate")!=e&&this.buttonNext.each(function(){f.options.buttonNextCallback(f,this,e)}).data("jcarouselstate",e)):this.options.buttonNextCallback!==null&&this.buttonNextState!=e&&this.options.buttonNextCallback(f,null,e);this.buttonPrev.size()>0?(this.buttonPrev.unbind(this.options.buttonPrevEvent+".jcarousel",this.funcPrev),g&&this.buttonPrev.bind(this.options.buttonPrevEvent+".jcarousel",this.funcPrev),this.buttonPrev[g?"removeClass":"addClass"](this.className("jcarousel-prev-disabled")).attr("disabled",g?!1:!0),this.options.buttonPrevCallback!==null&&this.buttonPrev.data("jcarouselstate")!=g&&this.buttonPrev.each(function(){f.options.buttonPrevCallback(f,this,g)}).data("jcarouselstate",g)):this.options.buttonPrevCallback!==null&&this.buttonPrevState!=g&&this.options.buttonPrevCallback(f,null,g);this.buttonNextState=e;this.buttonPrevState=g},notify:function(e){var f=this.prevFirst===null?"init":this.prevFirst<this.first?"next":"prev";this.callback("itemLoadCallback",e,f);this.prevFirst!==this.first&&(this.callback("itemFirstInCallback",e,f,this.first),this.callback("itemFirstOutCallback",e,f,this.prevFirst));this.prevLast!==this.last&&(this.callback("itemLastInCallback",e,f,this.last),this.callback("itemLastOutCallback",e,f,this.prevLast));this.callback("itemVisibleInCallback",e,f,this.first,this.last,this.prevFirst,this.prevLast);this.callback("itemVisibleOutCallback",e,f,this.prevFirst,this.prevLast,this.first,this.last)},callback:function(g,n,m,o,q,t,p){if(!(this.options[g]==null||typeof this.options[g]!="object"&&n!="onAfterAnimation")){var r=typeof this.options[g]=="object"?this.options[g][n]:this.options[g];if(b.isFunction(r)){var s=this;if(o===void 0){r(s,m,n)}else{if(q===void 0){this.get(o).each(function(){r(s,this,o,m,n)})}else{for(var g=function(e){s.get(e).each(function(){r(s,this,e,m,n)})},u=o;u<=q;u++){u!==null&&!(u>=t&&u<=p)&&g(u)}}}}}},create:function(e){return this.format("<li></li>",e)},format:function(e,g){for(var e=b(e),f=e.get(0).className.split(" "),h=0;h<f.length;h++){f[h].indexOf("jcarousel-")!=-1&&e.removeClass(f[h])}e.addClass(this.className("jcarousel-item")).addClass(this.className("jcarousel-item-"+g)).css({"float":this.options.rtl?"right":"left","list-style":"none"}).attr("jcarouselindex",g);return e},className:function(e){return e+" "+e+(!this.options.vertical?"-horizontal":"-vertical")},dimension:function(e,g){var f=b(e);if(g==null){return !this.options.vertical?f.outerWidth(!0)||a.intval(this.options.itemFallbackDimension):f.outerHeight(!0)||a.intval(this.options.itemFallbackDimension)}else{var h=!this.options.vertical?g-a.intval(f.css("marginLeft"))-a.intval(f.css("marginRight")):g-a.intval(f.css("marginTop"))-a.intval(f.css("marginBottom"));b(f).css(this.wh,h+"px");return this.dimension(f)}},clipping:function(){return !this.options.vertical?this.clip[0].offsetWidth-a.intval(this.clip.css("borderLeftWidth"))-a.intval(this.clip.css("borderRightWidth")):this.clip[0].offsetHeight-a.intval(this.clip.css("borderTopWidth"))-a.intval(this.clip.css("borderBottomWidth"))},index:function(e,f){if(f==null){f=this.options.size}return Math.round(((e-1)/f-Math.floor((e-1)/f))*f)+1}});a.extend({defaults:function(e){return b.extend(d,e||{})},intval:function(e){e=parseInt(e,10);return isNaN(e)?0:e},windowLoaded:function(){c=!0}});b.fn.jcarousel=function(e){if(typeof e=="string"){var g=b(this).data("jcarousel"),f=Array.prototype.slice.call(arguments,1);return g[e].apply(g,f)}else{return this.each(function(){var h=b(this).data("jcarousel");h?(e&&b.extend(h.options,e),h.reload()):b(this).data("jcarousel",new a(this,e))})}}})(jQuery);(function(a){a.fn.extend({setEqualHeight:function(c){var b={height:null,minHeight:0,maxHeight:null};c=a.extend(b,c);if(c.height!==null){this.height(c.height)}else{this.css("height","auto");this.each(function(){if(a(this).height()+1>c.minHeight){c.minHeight=a(this).height()+1}if(c.maxHeight!==null){if(c.minHeight>c.maxHeight){c.minHeight=c.maxHeight}}});if(c.minHeight>0){this.css("min-height",c.minHeight)}else{this.css("height","inherit")}if(c.maxHeight!=null&&c.maxHeight>0){this.css("max-height",c.maxHeight)}}return this}})})($j);(function(a){a.fn.extend({setEqualWidth:function(c){var b={width:null,minWidth:0,maxWidth:null};c=a.extend(b,c);if(c.width!==null){this.width(c.width)}else{this.css("width","auto");this.each(function(){if(a(this).width()+1>c.minWidth){c.minWidth=a(this).width()+1}if(c.maxWidth!==null){if(c.minWidth>c.maxWidth){c.minWidth=c.maxWidth}}});if(c.minWidth>0){this.css("min-width",c.minWidth)}else{this.css("width","inherit")}if(c.maxWidth!=null&&c.maxWidth>0){this.css("max-width",c.maxWidth)}}return this}})})($j);(function(a){a.fn.extend({equalHeight:function(c){var b={height:null,minHeight:0,maxHeight:null};c=a.extend(b,c);this.each(function(e){var d=a(this).children(".equal-height-item");if(d.length==0){d=a(this).children()}d.setEqualHeight(c)});return this}})})($j);(function(a){a.fn.extend({equalWidth:function(c){var b={width:null,minWidth:0,maxWidth:null};c=a.extend(b,c);this.each(function(e){var d=a(this).children(".equal-width-item");if(d.length==0){d=a(this).children()}d.setEqualWidth(c)});return this}})})($j);$j(document).ready(function(){$j("#site-nav li > div").hover(function(){$j(this).parent().toggleClass("hover")});$j(".ie7 .equal-height").equalHeight();$j(document).on("click","#signinoptions .radiotimes",function(h){h.preventDefault();$j("#signinoptions").hide();$j("#signinform").show()});$j(document).on("click","#signinform .loginpopup-cancelbutton",function(h){h.preventDefault();$j("#signinform").hide();$j("#signinoptions").show()});$j(document).on("click","#loginbutton",function(h){h.preventDefault();f(h)});$j(document).on("click","#registerbutton",function(h){h.preventDefault();g(h)});var a=null;var b=null;var c=null;function d(){$j(".loginpopup").hide();c=null;b=null;a=null;$j("#loginbutton").removeClass("popupopen");$j("#registerbutton").removeClass("popupopen");$j("#dashboard").removeClass("popupopen")}function f(h){if(b!=null){d();b=null}else{d();b=1;$j("#loginpopup").css("display","block");$j("#loginbutton").addClass("popupopen")}h.stopPropagation()}function g(h){if(c!=null){d();c=null}else{d();c=1;$j("#registerpopup").css("display","block");$j("#registerbutton").addClass("popupopen")}h.stopPropagation()}function e(h){if(a!=null){d();a=null}else{d();a=1;$j("#loggedinpopup").css("display","block");$j("#dashboard").addClass("popupopen")}if(h&&h.stopPropagation){h.stopPropagation()}}window.RT=window.RT||{};window.RT.login=window.RT.login||{};window.RT.login.showLoginPopup=f;$j(document).on("click","body",function(){d()});$j(document).on("click","#loginpopup",function(h){h.stopPropagation()});$j(document).on("click","#eyebrowmembername",function(h){h.preventDefault();e(h)});$j(document).on("click","#editprofilepic",function(h){Shadowbox.open(this);return false});if($j().dotdotdot){if(!$j("html").hasClass("ie7")){$j(".hideoverflow").dotdotdot()}$j(".img-text-list-item-text").dotdotdot();$j(".hideoverflow").addClass("overflow-height");$j("#full-width-content #slide header h1").dotdotdot()}$j(".vertical-center").each(function(){var h=parseInt($j(this).parent().css("height"));var i=parseInt($j(this).css("height"));if(h>0&&i>0){$j(this).css("margin-top",Math.round((h-(i+8))/2)+"px")}});if($j().tablight){$j(".tabbed").tablight()}});function LoadJCarouselForImageAndTextList(b,c){var a=$j(b);if(a.hasClass("one-column-list")){a.children("li").css("width",a.width())}$j(b).jcarousel({wrap:"circular",scroll:parseInt(c),animation:"slow",initCallback:JCarouselForImageAndTextListInitCallback})}function JCarouselForImageAndTextListInitCallback(a,c){if(c=="init"){a.buttonNext.bind("mousedown.disableTextSelect",function(){return false});var b=a.list.find(".img-text-list-item-image");if(b.length>0){var d=$j(b).outerHeight()/2;a.buttonNext.css("top",d);a.buttonPrev.css("top",d)}a.container.parent().removeClass("scrollable-carousel-wrapper")}else{if(c=="reset"){}}}var RTResponsiveheader=(function(a){var d={};d.config={navMainEl:a(".js-main-navigation"),navMainOpenClass:"js-main-navigation-open",navEl:a(".js-main-navigation .js-main-navigation-inner > ul"),itemEl:a(".js-main-navigation .js-main-navigation-inner > ul").find("> li"),subContainerEl:a(".subnav-container"),navToggle:a(".js-header-menu-toggle"),selectedSectionText:a(".js-main-navigation .selected > a").text(),headerTitleEl:a("#header .header-title"),mobileBreakpoint:768,navHeight:0};d.init=function(){f();g();e();c();b();i();h()};var h=function(){a(".share-links .morebtn").on("click",function(){var j=a(this).closest(".share-links").find("ul.extra");if(a(window).width()>d.config.mobileBreakpoint){a(j).toggleClass("visible right")}else{a(j).toggleClass("visible")}})};var f=function(){a(".js-log-in, .js-logged-in").live("click",function(j){j.preventDefault();d.config.navMainEl.removeClass(d.config.navMainOpenClass).removeAttr("style");if(a(window).width()>d.config.mobileBreakpoint){a(this).next(".dropdown").toggle()}else{e();a(this).next(".dropdown").animate({height:"toggle"},300)}})};var c=function(){d.config.navMainEl.css({display:"block",visibility:"hidden"});d.config.navHeight=a(".js-main-navigation-inner").outerHeight();d.config.navMainEl.css({visibility:"visible"});a(".main-navigation__mobile-subnav").css("min-height",d.config.navHeight)};var i=function(){d.config.navToggle.on("click",function(){var j;a(".js-log-in, .js-logged-in").next(".dropdown").removeAttr("style");d.config.navMainEl.toggleClass(d.config.navMainOpenClass);if(d.config.navMainEl.hasClass(d.config.navMainOpenClass)){j="0%"}else{j="-100%"}d.config.navMainEl.css("left",function(){return a(this).offset().left}).animate({left:j},300)});a(".primary-nav").on("click",function(k){if(a(window).width()<d.config.mobileBreakpoint){k.preventDefault()}var j=a(this).attr("data-id"),m=d.config.subContainerEl.find('.main-navigation__mobile-subnav[data-id="'+j+'"]');a(".main-navigation__mobile-subnav").removeClass("js-show-subnav");m.addClass("js-show-subnav");d.config.subContainerEl.css("left",function(){return a(this).offset().left}).animate({left:"0%"},300)});a(".js-close-subnav").on("click",function(){d.config.subContainerEl.css("left",function(){return a(this).offset().left}).animate({left:"120%"},300)});a(window).on("resize",function(){e()})};var e=function(){if(a(window).width()<=d.config.mobileBreakpoint){var j=a("#header").height()-a(".quick-navigation").height();a(".login-widget .dropdown").css("top",j);c()}else{a(".login-widget .dropdown").removeAttr("style")}};var b=function(){var m=a(".quick-links li"),k=a(".quick-links h3").outerWidth(),j=a(".quick-links"),n=0;a.each(m,function(){n+=a(this).outerWidth()+2});j.width(n+k)};var g=function(){var j=d.config.selectedSectionText;d.config.headerTitleEl.text(j)};return d})(jQuery);jQuery(document).ready(function(){RTResponsiveheader.init()});var RTGA=(function(a){var e={};e.init=function(){d();b();c()};var d=function(){a("#header .register").click(function(){_gaq.push(["_trackEvent","Registration","Register","1_Home_Button"])});a("#header .account-register a").live("click",function(){_gaq.push(["_trackEvent","Registration","Register","2_RadioTimes"])});a("#header .account-social a").live("click",function(){_gaq.push(["_trackEvent","Registration","Register","2_"+a(this).text()])});a(".register-page .register").click(function(){_gaq.push(["_trackEvent","Registration","Register","Register"])});a(".members-profile-container .action-btn").click(function(){_gaq.push(["_trackEvent","Registration","Register","Save"])})};var b=function(){a(".channel .programme-detail a").live("click",function(g){var j=a(this).closest(".programme-dialog").parent("li").find("a.short-title").data("hover");var m=j.Title;var k=j.EpisodeId;var i=j.Specialisation;var h=m+" ["+k+"]";var f=a(g.target);if(f.hasClass("read-more")){_gaq.push(["_trackEvent",i+"Listings","Hover_More_Click",h])}else{if(f.parent("h1").length){_gaq.push(["_trackEvent",i+"Listings","Hover_Title_Click",h])}else{if(f.parent("div.headlines").length){_gaq.push(["_trackEvent",i+"Listings","Hover_LatestNews_Click",h])}else{if(f.parent("li").length){_gaq.push(["_trackEvent",i+"Listings","Hover_News_Click",h]);_gaq.push(["_trackEvent",i+"Listings","Hover_News_Click",f.text()])}}}}})};var c=function(){a("#new-suggestions .programme-slot a").live("click",function(){var f=a(this).closest("article").find("h1").text();_gaq.push(["_trackEvent","tvListings","Recommendations",f])})};return e})(jQuery);jQuery(document).ready(function(){RTGA.init()});
/*
 * jQuery Cookie Plugin v1.4.1
 * https://github.com/carhartl/jquery-cookie
 *
 * Copyright 2013 Klaus Hartl
 * Released under the MIT license
 */
(function(a){if(typeof define==="function"&&define.amd){define(["jquery"],a)}else{if(typeof exports==="object"){a(require("jquery"))}else{a(jQuery)}}}(function(a){var f=/\+/g;function d(i){return b.raw?i:encodeURIComponent(i)}function c(i){return b.raw?i:decodeURIComponent(i)}function h(i){return d(b.json?JSON.stringify(i):String(i))}function e(j){if(j.indexOf('"')===0){j=j.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\")}try{j=decodeURIComponent(j.replace(f," "));return b.json?JSON.parse(j):j}catch(i){}}function g(j,i){var k=b.raw?j:e(j);return a.isFunction(i)?i(k):k}var b=a.cookie=function(o,w,r){if(w!==undefined&&!a.isFunction(w)){r=a.extend({},b.defaults,r);if(typeof r.expires==="number"){var m=r.expires,v=r.expires=new Date();v.setTime(+v+m*86400000)}return(document.cookie=[d(o),"=",h(w),r.expires?"; expires="+r.expires.toUTCString():"",r.path?"; path="+r.path:"",r.domain?"; domain="+r.domain:"",r.secure?"; secure":""].join(""))}var u=o?undefined:{};var k=document.cookie?document.cookie.split("; "):[];for(var n=0,p=k.length;n<p;n++){var s=k[n].split("=");var q=c(s.shift());var j=s.join("=");if(o&&o===q){u=g(j,w);break}if(!o&&(j=g(j))!==undefined){u[q]=j}}return u};b.defaults={};a.removeCookie=function(i,j){if(a.cookie(i)===undefined){return false}a.cookie(i,"",a.extend({},j,{expires:-1}));return !a.cookie(i)}}));Namespace("RT.utils").LoginWidgetLoader=(function(a){var c=function(){return a.cookie("AuthToken")?true:false};var b=function(e){this.widget=a(e);if(c()){d(this.widget)}else{this.widget.show()}},d=function(f){var e=f.attr("data-widget-url");f.empty();f.addClass("loading");f.show();a.get(e,function(g){f.removeClass("loading");f.append(g)})};return{init:b}});new RT.utils.LoginWidgetLoader(jQuery).init(jQuery(".login-widget-container")[0]);Namespace("RT.utils").LoadingSpinner=new Class({Implements:Options,initialize:function(c){var a,b;this.setOptions(c);this.spinner=new Element("div",{"class":this.options.spinnerClass});if(typeOf(this.options.imgPath)=="string"){b=new Element("div.throbber");a=new Element("img",{src:this.options.imgPath});a.inject(b);this.spinner.grab(b)}if(typeOf(this.options.message)=="string"){this.spinner.grab(new Element("p",{text:this.options.message,"class":"loading-message"}))}},options:{spinnerClass:"loading",imgPath:null,message:null,position:"bottom"},showSpinner:function(a){if(typeOf(a)=="element"){this.target=a}$(this.spinner).inject(this.target,this.options.position)},hideSpinner:function(){$(this.spinner).destroy()}});function initializeChiefCarousel(){$j(".picksoftheday").mpsCarousel({animateHeight:false,animateBackgroundColor:false,animateOpacity:false})}(function(a){a.fn.mpsCarousel=function(k){var f={backgroundColour:"#46B3E1",inactiveBackgroundColor:"#666666",activeItemTargetHeight:25,inActiveItemTargetHeight:50,intervalSpeed:4000,animationSpeed:600,animateBackgroundColor:true,animateHeight:true,animateOpacity:true};var k=a.extend(f,k);var j;var h=true;var i=false;var d=$j(this).find(".carousel-item").length;function c(o){if(o==d+1){o=1}if(h){g(o);j=setTimeout(function(){i=true;o++;if(o<=d+1){c(o)}},k.intervalSpeed)}else{i=false}}function b(p){h=false;$j(".carousel-item").stop();$j(".carouselimage").stop();var o=$j(".carousel-item").index(p);g(o+1)}function e(o){}function m(o){clearTimeout(j);h=false;i=false;$j(".carousel-item").stop();$j(".carouselimage").stop()}function n(p){h=true;if(!i){var o=$j(p).find(".carousel-item").index($j(".carousel-item-active"));j=setTimeout(function(){c(o+1)},600)}}function g(o){if(k.animateBackgroundColor){$j("#carousel-item"+o+" .carousel-item-wrapper > div").stop().css({backgroundColor:k.backgroundColour})}if(k.animateHeight){$j("#carousel-item"+o+" .carousel-item-wrapper > div").stop().animate({height:k.activeItemTargetHeight,opacity:1},k.animationSpeed)}if(k.animateOpacity){$j("#carousel-item"+o+" .carousel-item-wrapper > div").stop().animate({opacity:1},k.animationSpeed)}$j("#carousel-item"+o).addClass("carousel-item-active");if(k.animateOpacity){$j("#para"+o).stop().animate({opacity:"1"},100)}$j("#carousel-image"+o).stop().animate({opacity:"1"},0);$j(".image-url").attr("href",$j("#carousel-image"+o).attr("imageurl"));if(k.animateOpacity){$j(".para:not(#para"+o+")").stop().animate({opacity:"0"},100)}if(k.animateHeight){$j(".carousel-item:not(#carousel-item"+o+") .carousel-item-wrapper > div").stop().animate({height:k.inActiveItemTargetHeight,opacity:"0.75"},0)}if(k.animateOpacity){$j(".carousel-item:not(#carousel-item"+o+") .carousel-item-wrapper > div").stop().animate({opacity:"0.75"},0)}if(k.animateBackgroundColor){$j(".carousel-item:not(#carousel-item"+o+") .carousel-item-wrapper > div").css({backgroundColor:k.inactiveBackgroundColor})}$j(".carouselimage:not(#carousel-image"+o+")").stop().animate({opacity:"0"},k.animationSpeed);$j(".carousel-item:not(#carousel-item"+o+")").removeClass("carousel-item-active")}return this.each(function(p,o){$j(".carousel-item").each(function(s,r){var q=$j(r).find(".carousel-item-wrapper");$j(q).mouseover(function(){b(r)}).mouseout(function(){e(r)})});$j(this).mouseover(function(){m(this)}).mouseout(function(){n(this)});c(1)})}})($j);(function(a,b){typeof module!="undefined"?module.exports=b():typeof define=="function"&&typeof define.amd=="object"?define(b):this[a]=b()})("Voila",function(){var a="Submitted. Please check your browsers network log to confirm success.",h=function(k,A){function j(i){w=setTimeout(function(){var n=null,e=i.target.attributes;for(p=e.length;p--;){e[p].nodeName==="data-content"&&(n=e[p].nodeValue)}v.logHover(n,function(o){o.error})},B)}function m(){clearTimeout(w)}var v=this,x=null,p=0,y=0,w=null,B=250;if(!k){throw new Error("No arguments supplied")}this.apiKey=null;this.version="1.0";this.content=null;this.url="https://voila.metabroadcast.com";this.hoverItems=[];this.trackingId=null;this.referrer=null;this.logging=!0;this.userCookie={name:!1,value:!1};this.timeout=2000;k&&k.hoverTimeout&&(B=k.hoverTimeout);k&&k.apiKey&&(this.apiKey=k.apiKey);k&&k.version&&(this.version=k.version);k&&k.content&&(this.content=k.content);k&&k.host&&(k&&k.host.indexOf("http")===-1?this.url="https://"+k.host:this.url=k.host);if(k&&k.hoverItems){for(p=k.hoverItems.length;p--;){x=qwery(k.hoverItems[p]);for(y=x.length;y--;){try{x[y].addEventListener("mouseover",j);x[y].addEventListener("mouseout",m)}catch(q){x[y].attachEvent("mouseover",j);x[y].attachEvent("mouseout",m)}this.hoverItems.push(x[y])}}}k&&k.trackingId&&(this.parent=k.trackingId);document.referrer&&(this.referrer=document.referrer);k&&typeof k.logging!="undefined"&&(this.logging=k.logging);k&&k.userCookieName&&(this.userCookie.name=k.userCookieName);k&&k.timeout&&(this.timeout=k.timeout)};h.prototype.pageLoad=function(i){var j=this;j.content?j.getTracking(function(e){if(!e.error){j.trackingId=e.success;j.logging===!0&&j.logLoad()}i&&i(e)}):j.logLoad(function(){i&&i({success:null})})};h.prototype.setContentId=function(i){this.content=i};h.prototype.setContentUri=function(i){this.content=i};h.prototype.getContent=function(j,v){var m=this,q=m.content,k=new jXHR,u=m.url+"/"+m.version+"/content?apiKey="+m.apiKey;j&&j.content&&(q=j.content);q.indexOf("http")!==-1?u+="&uri="+q:u+="&id="+q;j&&j.annotations&&(u+="&annotations="+j.annotations.join(","));var p=m.getCookie(m.userCookie.name);p&&(u+="&X-User-Id="+p);k.timeout=m.timeout;k.onerror=function(i,o){v&&v({error:i})};k.onreadystatechange=function(i){k.readyState===4&&v&&v({success:i})};u+="&callback=?";k.open("GET",u);k.send()};h.prototype.getTracking=function(j){var p=this,m=new jXHR,o=p.url+"/"+p.version+"/tracking?apiKey="+p.apiKey;m.timeout=p.timeout;m.onerror=function(i,e){j&&j({error:i})};m.onreadystatechange=function(e){if(m.readyState===4){if(e.tracking_id){p.trackingId=e.tracking_id;j&&j({success:e.tracking_id});return}j&&j({error:"No tracking id found"})}};p.content&&(p.content.indexOf("http")!==-1?o+="&contentUri="+p.content:o+="&contentId="+p.content);p.parent&&(o+="&parentTrackingId="+p.parent);var k=p.getCookie(p.userCookie.name);k&&(o+="&X-User-Id="+k);o+="&callback=?";m.open("GET",o);m.send()};h.prototype.logLoad=function(j){var v=this,m=new jXHR,q=null,k=!1,u=v.url;m.timeout=v.timeout;m.onerror=function(i,e){j&&j({error:i})};u=u+"/"+v.version+"/log?apiKey="+encodeURIComponent(v.apiKey)+"&event=page-load";v.trackingId&&(u+="&tracking_id="+encodeURIComponent(v.trackingId));if(v.content){k||(k=[]);v.content.indexOf("http")!==-1?u+="&x-purple-external-uri="+encodeURIComponent(v.content):u+="&x-purple-id="+encodeURIComponent(v.content)}var p=v.getCookie(v.userCookie.name);p&&(u+="&X-User-Id="+encodeURIComponent(p));v.referrer&&(u+="&referrer="+encodeURIComponent(v.referrer));u+="&cb="+(new Date).getTime();m.open("GET",u);m.send()};h.prototype.logHover=function(j,v){var m=this,q=new jXHR,k=m.content,u=m.url;q.timeout=m.timeout;q.onerror=function(i,o){v&&v({error:i})};u=u+"/"+m.version+"/log?apiKey="+encodeURIComponent(m.apiKey)+"&event=tv-listings-hover";m.trackingId&&(u+="&tracking_id="+encodeURIComponent(m.trackingId));j&&j.content&&(k=j.content);k.indexOf("http")!==-1?u+="&x-purple-external-uri="+encodeURIComponent(k):u+="&x-purple-id="+encodeURIComponent(k);var p=m.getCookie(m.userCookie.name);p&&(u+="&X-User-Id="+encodeURIComponent(p));m.referrer&&(u+="&referrer="+encodeURIComponent(m.referrer));u+="&cb="+(new Date).getTime();q.open("GET",u);q.send()};h.prototype.watching=function(j,v){var m=this,q=new jXHR,k=m.content,u=m.url;q.timeout=m.timeout;q.onerror=function(i,o){v&&v({error:i})};u=u+"/"+m.version+"/log?apiKey="+encodeURIComponent(m.apiKey)+"&event=content-play";m.trackingId&&(u+="&tracking_id="+encodeURIComponent(m.trackingId));j&&j.content&&(k=j.content);k.indexOf("http")!==-1?u+="&x-purple-external-uri="+encodeURIComponent(k):u+="&x-purple-id="+encodeURIComponent(k);var p=m.getCookie(m.userCookie.name);p&&(u+="&X-User-Id="+encodeURIComponent(p));m.referrer&&(u+="&referrer="+encodeURIComponent(m.referrer));u+="&cb="+(new Date).getTime();q.open("GET",u);q.send()};h.prototype.notWatching=function(i,j){j&&j({success:!0})};h.prototype.currentlyWatching=function(i,j){j&&j({success:!0})};h.prototype.suggestionsFeedback=function(j,p){var m=this,o=m.url;o=o+"/"+m.version+"/suggestions/feedback/me/@self?apiKey="+m.apiKey;m.trackingId&&(o+="&tracking_id="+encodeURIComponent(m.trackingId));j&&j.id&&(o+="&id="+encodeURIComponent(j.id));j&&j.action&&(o+="&action="+encodeURIComponent(j.action));var k=m.getCookie(m.userCookie.name);k&&(o+="&X-User-Id="+encodeURIComponent(k));m.referrer&&(o+="&referrer="+encodeURIComponent(m.referrer));o+="&cb="+(new Date).getTime();ajax.open("GET",o);ajax.send()};h.prototype.cookieOptOut=function(i){var m=this,j=new jXHR,k=m.url+"/"+m.version+"/optout/set?apiKey="+m.apiKey+"&callback=?";j.timeout=m.timeout;j.onerror=function(o,e){i&&i({error:o})};j.onreadystatechange=function(e){j.readyState===4&&i&&i({success:e})};j.open("GET",k);j.send()};h.prototype.cookieOptIn=function(i){var m=this,j=new jXHR,k=m.url+"/"+m.version+"/optout/remove?apiKey="+m.apiKey+"&callback=?";j.timeout=m.timeout;j.onerror=function(o,e){i&&i({error:o})};j.onreadystatechange=function(e){j.readyState===4&&i&&i({success:e})};j.open("GET",k);j.send()};h.prototype.cookieOptStatus=function(i){var m=this,j=new jXHR,k=m.url+"/"+m.version+"/optout?apiKey="+m.apiKey+"&callback=?";j.timeout=m.timeout;j.onerror=function(o,e){i&&i({error:o})};j.onreadystatechange=function(e){j.readyState===4&&i&&i({success:e})};j.open("GET",k);j.send()};h.prototype.getCookie=function(j){var w=this,m=w.userCookie.name,q=document.cookie,k={},v=!1;j&&(m=j);if(q.length>0&&q.indexOf(";")!==-1){q=q.split(";");for(var p=q.length;p--;){q[p].substr(0,1)===" "&&(q[p]=q[p].substr(1));if(q[p].indexOf("=")!==-1){q[p]=q[p].split("=");var x=q[p][0];k[x]=!1;q[p].splice(0,1);q[p].length>1?q[p]=q[p].join("="):q[p]=q[p][0];k[x]=q[p]}}k[j]&&(v=k[j])}return v};var c=function(j){qwery("#voilaframe").length!==0&&f();var o=document.createElement("iframe"),m='<!DOCTYPE html><html><head><link rel="canonical" href="'+window.location.href+'" /></head><body></body></html>';o.setAttribute("id","voilaframe");o.name="voilaframe";o.style.width=0;o.style.height=0;o.style.visibility="hidden";o.style.borderWidth=0;o.style.position="absolute";o.style.left="-9999px";o.style.top="-9999px";o.src="about:blank";try{o.contentWindow.document.open("text/html","replace");o.contentWindow.document.write(m);o.contentWindow.document.close()}catch(k){}document.body.appendChild(o);o.contentWindow.name="voilaframe";j&&j({success:o});return o},f=function(){document.body.removeChild(qwery("#voilaframe")[0])},b=function(i){var m=this,j=0,k=null;if(!i||!i.url||!i.id){return !1}k=qwery("#"+i.id);k.length>0&&g(i.id);k=document.createElement("form");k.setAttribute("id",i.id);k.setAttribute("target","voilaframe");k.setAttribute("method","POST");k.setAttribute("action",i.url+"&cb="+(new Date).getTime());k.style.width=0;k.style.height=0;k.style.visibility="hidden";k.style.borderWidth=0;k.style.position="absolute";k.style.left="-9999px";k.style.top="-9999px";if(i&&i.inputs){for(j=i.inputs.length;j--;){k.appendChild(d(i.inputs[j]))}}document.body.appendChild(k);return k},g=function(i){document.body.removeChild(qwery("#"+i)[0])},d=function(i){var j=document.createElement("input");j.setAttribute("type","hidden");j.setAttribute("name",i.name);j.setAttribute("value",i.value);return j};return h});(function(a,b){typeof module!="undefined"?module.exports=b():typeof define=="function"&&typeof define.amd=="object"?define(b):this[a]=b()})("qwery",function(){function aC(){this.c={}}function aj(a){return ad.g(a)||ad.s(a,"(^|\\s+)"+a+"(\\s+|$)",1)}function aL(a,d){var b=0,c=a.length;for(;b<c;b++){d(a[b])}}function at(a){for(var d=[],b=0,c=a.length;b<c;++b){aa(a[b])?d=d.concat(a[b]):d[d.length]=a[b]}return d}function af(a){var d=0,b=a.length,c=[];for(;d<b;d++){c[d]=a[d]}return c}function ax(a){while(a=a.previousSibling){if(a[aW]==1){break}}return a}function ao(a){return a.match(ah)}function av(q,F,B,D,x,E,f,k,w,C,o){var G,A,u,H,j;if(this[aW]!==1){return !1}if(F&&F!=="*"&&this[aI]&&this[aI].toLowerCase()!==F){return !1}if(B&&(A=B.match(an))&&A[1]!==this.id){return !1}if(B&&(j=B.match(aB))){for(G=j.length;G--;){if(!aj(j[G].slice(1)).test(this.className)){return !1}}}if(w&&aN.pseudos[w]&&!aN.pseudos[w](this,o)){return !1}if(D&&!f){H=this.attributes;for(u in H){if(Object.prototype.hasOwnProperty.call(H,u)&&(H[u].name||u)==x){return this}}}return D&&!aP(E,a7(this,x)||"",f)?!1:this}function aM(a){return aJ.g(a)||aJ.s(a,a.replace(ae,"\\$1"))}function aP(a,c,b){switch(a){case"=":return c==b;case"^=":return c.match(aE.g("^="+b)||aE.s("^="+b,"^"+aM(b),1));case"$=":return c.match(aE.g("$="+b)||aE.s("$="+b,aM(b)+"$",1));case"*=":return c.match(aE.g(b)||aE.s(b,aM(b),1));case"~=":return c.match(aE.g("~="+b)||aE.s("~="+b,"(?:^|\\s+)"+aM(b)+"(?:\\s+|$)",1));case"|=":return c.match(aE.g("|="+b)||aE.s("|="+b,"^"+aM(b)+"(-|$)",1))}return 0}function aX(j,C){var x=[],r=[],B,b,k,u,q,A,c,D,w=C,o=ab.g(j)||ab.s(j,j.split(aG)),E=j.match(aU);if(!o.length){return x}u=(o=o.slice(0)).pop();o.length&&(k=o[o.length-1].match(ag))&&(w=aA(C,k[1]));if(!w){return x}c=ao(u);A=w!==C&&w[aW]!==9&&E&&/^[+~]$/.test(E[E.length-1])?function(a){while(w=w.nextSibling){w[aW]==1&&(c[1]?c[1]==w[aI].toLowerCase():1)&&(a[a.length]=w)}return a}([]):w[aO](c[1]||"*");for(B=0,b=A.length;B<b;B++){if(D=av.apply(A[B],c)){x[x.length]=D}}if(!o.length){return x}aL(x,function(a){a1(a,o,E)&&(r[r.length]=a)});return r}function a6(a,g,c){if(a3(g)){return a==g}if(aa(g)){return !!~at(g).indexOf(a)}var d=g.split(","),b,f;while(g=d.pop()){b=ab.g(g)||ab.s(g,g.split(aG));f=g.match(aU);b=b.slice(0);if(av.apply(a,ao(b.pop()))&&(!b.length||a1(a,b,f,c))){return !0}}return !1}function a1(a,g,c,d){function f(h,j,i){while(i=az[c[j]](i,h)){if(a3(i)&&av.apply(i,ao(g[j]))){if(!j){return i}if(b=f(i,j-1,i)){return b}}}}var b;return(b=f(a,g.length-1,a))&&(!d||a5(b,d))}function a3(a,b){return a&&typeof a=="object"&&(b=a[aW])&&(b==1||b==9)}function aZ(a){var d=[],b,c;a:for(b=0;b<a.length;++b){for(c=0;c<d.length;++c){if(d[c]==a[b]){continue a}}d[d.length]=a[b]}return d}function aa(a){return typeof a=="object"&&isFinite(a.length)}function ay(a){return a?typeof a=="string"?aN(a)[0]:!a[aW]&&aa(a)?a[0]:a:ak}function aA(a,c,b){return a[aW]===9?a.getElementById(c):a.ownerDocument&&((b=a.ownerDocument.getElementById(c))&&a5(b,a)&&b||!a5(a,a.ownerDocument)&&ac('[id="'+c+'"]',a)[0])}function aN(a,f){var b,d,c=ay(f);if(!c||!a){return[]}if(a===window||a3(a)){return !f||a!==window&&a3(c)&&a5(a,c)?[a]:[]}if(a&&aa(a)){return at(a)}if(b=a.match(a2)){if(b[1]){return(d=aA(c,b[1]))?[d]:[]}if(b[2]){return af(c[aO](b[2]))}if(am&&b[3]){return af(c[aF](b[3]))}}return ac(a,c)}function aq(a,b){return function(d){var e,c;if(aY.test(d)){if(a[aW]!==9){(c=e=a.getAttribute("id"))||a.setAttribute("id",c="__qwerymeupscotty");d='[id="'+c+'"]'+d;b(a.parentNode||a,d,!0);e||a.removeAttribute("id")}return}d.length&&b(a,d,!1)}}var ak=document,aT=ak.documentElement,aF="getElementsByClassName",aO="getElementsByTagName",au="querySelectorAll",aR="useNativeQSA",aI="tagName",aW="nodeType",ac,an=/#([\w\-]+)/,aB=/\.[\w\-]+/g,ag=/^#([\w\-]+)$/,ar=/^\.([\w\-]+)$/,aK=/^([\w\-]+)$/,ai=/^([\w]+)?\.([\w\-]+)$/,aY=/(^|,)\s*[>~+]/,aD=/^\s+|\s*([,\s\+\~>]|$)\s*/g,ap=/[\s\>\+\~]/,a4=/(?![\s\w\-\/\?\&\=\:\.\(\)\!,@#%<>\{\}\$\*\^'"]*\]|[\s\w\+\-]*\))/,ae=/([.*+?\^=!:${}()|\[\]\/\\])/g,a0=/^(\*|[a-z0-9]+)?(?:([\.\#]+[\w\-\.#]+)?)/,al=/\[([\w\-]+)(?:([\|\^\$\*\~]?\=)['"]?([ \w\-\/\?\&\=\:\.\(\)\!,@#%<>\{\}\$\*\^]+)["']?)?\]/,aS=/:([\w\-]+)(\(['"]?([^()]+)['"]?\))?/,a2=new RegExp(ag.source+"|"+aK.source+"|"+ar.source),aU=new RegExp("("+ap.source+")"+a4.source,"g"),aG=new RegExp(ap.source+a4.source),ah=new RegExp(a0.source+"("+al.source+")?("+aS.source+")?"),az={" ":function(a){return a&&a!==aT&&a.parentNode},">":function(a,b){return a&&a.parentNode==b.parentNode&&a.parentNode},"~":function(a){return a&&a.previousSibling},"+":function(a,d,b,c){return a?(b=ax(a))&&(c=ax(d))&&b==c&&b:!1}};aC.prototype={g:function(a){return this.c[a]||undefined},s:function(a,c,b){c=b?new RegExp(c):c;return this.c[a]=c}};var ad=new aC,aJ=new aC,aE=new aC,ab=new aC,a5="compareDocumentPosition" in aT?function(a,b){return(b.compareDocumentPosition(a)&16)==16}:"contains" in aT?function(a,b){b=b[aW]===9||b==window?aT:b;return b!==a&&b.contains(a)}:function(a,b){while(a=a.parentNode){if(a===b){return 1}}return 0},a7=function(){var a=ak.createElement("p");return(a.innerHTML='<a href="#x">x</a>')&&a.firstChild.getAttribute("href")!="#x"?function(b,c){return c==="class"?b.className:c==="href"||c==="src"?b.getAttribute(c,2):b.getAttribute(c)}:function(b,c){return b.getAttribute(c)}}(),am=!!ak[aF],aV=ak.querySelector&&ak[au],aH=function(a,g){var b=[],d,f;try{if(g[aW]===9||!aY.test(a)){return af(g[au](a))}aL(d=a.split(","),aq(g,function(h,i){f=h[au](i);f.length==1?b[b.length]=f.item(0):f.length&&(b=b.concat(af(f)))}));return d.length>1&&b.length>1?aZ(b):b}catch(c){}return aQ(a,g)},aQ=function(c,p){var j=[],g,m,k,b,d,h;c=c.replace(aD,"$1");if(m=c.match(ai)){d=aj(m[2]);g=p[aO](m[1]||"*");for(k=0,b=g.length;k<b;k++){d.test(g[k].className)&&(j[j.length]=g[k])}return j}aL(h=c.split(","),aq(p,function(a,n,f){d=aX(n,a);for(k=0,b=d.length;k<b;k++){if(a[aW]===9||f||a5(d[k],p)){j[j.length]=d[k]}}}));return h.length>1&&j.length>1?aZ(j):j},aw=function(a){typeof a[aR]!="undefined"&&(ac=a[aR]?aV?aH:aQ:aQ)};aw({useNativeQSA:!0});aN.configure=aw;aN.uniq=aZ;aN.is=a6;aN.pseudos={};return aN});(function(a){var d=a.setTimeout,b=a.document,c=0;a.jXHR=function(){function j(){try{v.parentNode.removeChild(v)}catch(f){}}function n(){t=!1;m="";j();v=null;r(0)}function g(f){try{e.onerror.call(e,f,m)}catch(h){throw new Error(f)}}function k(){if(this.readyState&&this.readyState!=="complete"&&this.readyState!=="loaded"||t){return}this.onload=this.onreadystatechange=null;t=!0;e.readyState!==4&&e.readyState===2&&g("Script failed to load ["+m+"].");j()}function r(f,h){h=h||[];e.readyState=f;typeof e.onreadystatechange=="function"&&e.onreadystatechange.apply(e,h)}var m,t,q,v,e=null;e={onerror:null,onreadystatechange:null,readyState:0,open:function(h,f){n();internal_callback="cb"+c++;(function(i){a.jXHR[i]=function(){try{r.call(e,4,arguments)}catch(o){e.readyState=-1;g("Script failed to run ["+m+"].")}a.jXHR[i]=null}})(internal_callback);m=f.replace(/=\?/,"=jXHR."+internal_callback);r(1)},send:function(){d(function(){v=b.createElement("script");v.setAttribute("type","text/javascript");v.onload=v.onreadystatechange=function(){k.call(v)};v.setAttribute("src",m);b.getElementsByTagName("head")[0].appendChild(v)},0);r(2)},setRequestHeader:function(){},getResponseHeader:function(){return""},getAllResponseHeaders:function(){return[]}};n();return e}})(window);