var dateFormat=function(){var A=/d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g,B=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,D=/[^-+\dA-Z]/g,C=function(F,E){F=String(F);E=E||2;while(F.length99?Math.round(P/10):P),t:S<12?"a":"p",tt:S<12?"am":"pm",T:S<12?"A":"P",TT:S<12?"AM":"PM",Z:R?"UTC":(String(J).match(B)||[""]).pop().replace(D,""),o:(F>0?"-":"+")+C(Math.floor(Math.abs(F)/60)*100+Math.abs(F)%60,4),S:["th","st","nd","rd"][O%10>3?0:(O%100-O%10!=10)*O%10]};return V.replace(A,function(H){return H in I?I[H]:H.slice(1,H.length-1);});};}();dateFormat.masks={"default":"ddd mmm dd yyyy HH:MM:ss",shortDate:"m/d/yy",mediumDate:"mmm d, yyyy",longDate:"mmmm d, yyyy",fullDate:"dddd, mmmm d, yyyy",shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:ss",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'"};dateFormat.i18n={dayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec","January","February","March","April","May","June","July","August","September","October","November","December"]};Date.prototype.format=function(A,B){return dateFormat(this,A,B);};Date.prototype.setISO8601=function(D){var A=/(\d\d\d\d)(-)?(\d\d)(-)?(\d\d)(T)?(\d\d)(:)?(\d\d)(:)?(\d\d)(\.\d+)?(Z|([+-])(\d\d)(:)?(\d\d))/;if(D.toString().match(new RegExp(A))){var C=D.match(new RegExp(A));var B=0;this.setUTCDate(1);this.setUTCFullYear(parseInt(C[1],10));this.setUTCMonth(parseInt(C[3],10)-1);this.setUTCDate(parseInt(C[5],10));this.setUTCHours(parseInt(C[7],10));this.setUTCMinutes(parseInt(C[9],10));this.setUTCSeconds(parseInt(C[11],10));if(C[12]){this.setUTCMilliseconds(parseFloat(C[12])*1000);}else{this.setUTCMilliseconds(0);}if(C[13]!="Z"){B=(C[15]*60)+parseInt(C[17],10);B*=((C[14]=="-")?-1:1);this.setTime(this.getTime()-B*60*1000);}}else{this.setTime(Date.parse(D));}return this;};(function(A){TWP=window.TWP||{};TWP.Util=TWP.Util||{};TWP.Comments=TWP.Comments||{};TWP.Util.updateMongoDb=function(B){updateAction=B.config.action||"get";if(A.browser.msie&&window.XDomainRequest){var C=new XDomainRequest();C.open(updateAction,B.config.remoteUrl);C.onload=B.config.onSuccess||null;C.onerror=B.config.onError||null;C.send(A.toJSON(B.config.data));}else{if(A.browser.msie&&!window.XDomainRequest){A.getScript("/rw/sites/twpweb/js/plugin/xhr/flXHR.js",function(E,H,F){window.flensed.base_path="/rw/sites/twpweb/js/plugin/xhr/";var G=new flensed.flXHR({autoUpdatePlayer:true});G.xmlResponseText=false;G.onreadystatechange=D;G.onerror=B.config.onError;G.open(updateAction.toUpperCase(),B.config.remoteUrl);G.send(A.toJSON(B.config.data));function D(I){if(I.readyState==4){B.onSuccess;}}});}else{if(updateAction=="post"){thisPost=A.post(B.config.remoteUrl,A.toJSON(B.config.data),B.config.onSuccess).error(B.config.onError);}else{thisPost=A.get(B.config.remoteUrl,A.toJSON(B.config.data),B.config.onSuccess).error(B.config.onError);}}}};TWP.Comments.addSorts=function(F,B){if(typeof B=="undefined"||B.length<=0){B=['','',''];}var C=A(F.target).closest(".echo_container").attr("id");if(wp_e2[C].includesorts!=false){var D=A("#"+C+" .comment-header").attr("rel");var G=A(".comment-header",A("#"+C));if(G.children().length==0){G=A(A(".echo-stream-header",A("#"+C)).children()[0]);}var E=(A("#"+C+" .tab.active a").length>0)?A("#"+C+" .tab.active a").attr("rel"):wp_e2[C].defaulttab;if(G.length>0&&typeof D!="undefined"&&A(".comment-sortorder",A("#"+C)).length==0){var H=A('
'+"Sort:  "+'
");if(G.hasClass("comment-header")){G.append(H);}else{G.after(H);}if(wp_e2[C][D].streamSettings[E].displaysort=="false"){H.hide();}else{A('.comment-sortorder-select option[value="'+wp_e2[C][D].streamSettings[E].sortorder+'"]').attr("selected","selected");}A(".comment-sortorder-select",A("#"+C)).change(function(){var I=A(F.target).closest(".echo_container").attr("id");var J=A("#"+I+" .comment-header").attr("rel");var K=(A("#"+I+" .tab.active a").length>0)?A("#"+I+" .tab.active a").attr("rel"):wp_e2[I].defaulttab;wp_e2[I][J].streamSettings[K].sortorder=A(this).attr("value");wp_e2.renderCommentStream(K,I,J);});}}};})(jQuery);(function(B){B.fn.buildecho=function(D){return this.each(function(){new B.buildecho(this,D);});};var A=TWP.eidosBase||"http://www.washingtonpost.com";var C={config:{dserv:A,badgeText:A+"/Fragment/SysConfig/WebPortal/twpweb/modules/comments/badge_text.jpt",echoContainer:"echo_container",badgeTextContainer:"echo-tip-text-container",echoVars:"comment-vars"},submitboxTemplate:""+'
'+'
'+'{commentType} '+'"+" "+" "+''+'
 
'+"
",countTemplate:" "+'
'+' '+'Loading... '+' '+" "+'{commentType} '+"
"+"",streamTemplate:" "+'
'+'
'+"{tablinks}"+"
"+""+" "+'
'+"
",tablinks:'
'+'Read what others are saying'+'About Badges'+"
"+'',sortlinks:' "}; B.buildecho=function(E,D){this.options=B.extend(C,D);this.props={};this.init(E);};B.buildecho.fn=B.buildecho.prototype={};B.buildecho.fn.extend=B.buildecho.extend=jQuery.extend;B.buildecho.fn.extend({createDataObject:function(I){var F={};if(typeof I.attr("data")!=="undefined"&&I.attr("data").length>0){var G=I.attr("data").split("&");for(var E=0;E');L.append(J);if(B("#echo-tip-text-container").length==0){L.append('
');}if(B(".badgetext").length==0){D.loadTextFile(D.options.config.badgeText,B("#"+D.options.config.badgeTextContainer));}var N=L.attr("class").replace(/\s+/g," ").split(" ");var K=D.createDataObject(L);B.each(N,function(Q,R){if(R!=D.options.config.echoContainer&&R!=D.options.config.echoVars){R=R.replace("-","");var O="";var T="";try{T=D.options[R+"Template"];}catch(S){}if(R=="stream"){T=T.replace("{streamtarget}","echo_comment_stream"+M);T=(K.includetabs!=false)?T.replace("{tablinks}",D.options.tablinks):T.replace("{tablinks}","");}if(R=="count"){var P=(K.webtype=="discussion_story")?"Posts":"Comments";T=T.replace("{commentType}",P);}if(R=="submitbox"){var U="";if(K.webtype=="discussion_story"){U="Your Posts";}else{if(K.webtype=="ugc_photo_story"){U="Post a Photo";}else{if(K.webtype=="topic_story"){U=(typeof K.submitboxheading!="undefined"&&K.submitboxheading!="")?K.submitboxheading:"Weigh in";}else{if(K.webtype=="promo_story"){U="Add your thoughts";}else{U="Comment";}}}}T=T.replace("{commentType}",U);U=(K.webtype=="ugc_photo_story")?"About Photo Galleries":"About Discussions";T=T.replace("{linkText}",U);U=(K.webtype=="ugc_photo_story")?"        ":"";T=T.replace("{linkSpacer}",U);}if(R=="count"||R=="submitbox"||R=="stream"){O=B(T.replace(/{elementIndex}/gi,M));B(".echo-counter",O).attr("guid",K.guid);B(".echo-comment",O).attr("guid",K.guid);B(".echo-stream",O).attr("guid",K.guid);B(L).append(O);}}});L.addClass("comments");}else{}});},loadTextFile:function(F,D){var E="";E=B.ajax({url:F,async:false});D.append(B(E.responseText));}});})(jQuery);(function(A){if(typeof (A._$)!="undefined"){A.noConflict();}if(!window.Echo){window.Echo={};}if(!Echo.Global){Echo.Global={};}if(!Echo.Vars){Echo.Vars={"regexps":{"matchLabel":/{Label:([^:}]+[^}]*)}/g,"matchData":/{Data:(([a-z]+\.)*[a-z]+)}/ig,"matchSelf":/{Self:(([a-z_]+\.)*[a-z_]+)}/ig,"mobileUA":/mobile|midp-|opera mini|iphone|ipad|blackberry|nokia|samsung|docomo|symbian|windows ce|windows phone|android|up\.browser|ipod|netfront|skyfire|palm|webos|audiovox/i,"parseUrl":/^((([^:\/\?#]+):)?\/\/)?([^\/\?#]*)?([^\?#]*)(\?([^#]*))?(#(.*))?/,"w3cdtf":/^(\d{4})-(\d\d)-(\d\d)T(\d\d):(\d\d):(\d\d)Z$/}};}A.extend({"addCss":function(D,F){Echo.Vars.css=Echo.Vars.css||{"index":1,"processed":{}};if(F){if(Echo.Vars.css.processed[F]){return ;}Echo.Vars.css.processed[F]=true;}var C="";var B=Echo.Vars.css.anchor;if(B&&B.length){C=B.html();}if(C.length+D.length>100000){Echo.Vars.css.index++;B=null;C="";}var E=A('");if(B&&B.length){B.replaceWith(E);}else{if(Echo.Vars.css.anchor){Echo.Vars.css.anchor.after(E);}else{A(document.getElementsByTagName("head")[0]||document.documentElement).prepend(E);}}Echo.Vars.css.anchor=E;},"foldl":function(C,B,D){A.each(B,function(E,F){result=D(F,C,E);if(result!==undefined){C=result;}});return C;},"intersperse":function(B,C){return A.foldl([],B,function(E,F,D){if(F.length){F.push(C);}F.push(E);});},"getNestedValue":function(B,F,G,H){if(typeof B=="string"){B=B.split(/\./);}if(!B.length){return F;}var E=true;var C=function(J,I){if(H){H(I,J);}if(typeof I[J]=="undefined"){E=false;}else{return I[J];}};var D=B.length==1?C(B.pop(),F):A.foldl(F,B,C);return E?D:G;},"setNestedValue":function(G,B,E){var C=B.split(/\./);var F=C.pop();var D=A.getNestedValue(C,G,undefined,function(I,H){if(typeof I[H]=="undefined"){I[H]={};}});D[F]=E;},"htmlize":function(B){if(!B){return"";}return A("
").text(B).html();},"object2JSON":function(F){var D=function(G){var H={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};return G.replace(/[\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff\\]/g,function(I){return(H.hasOwnProperty(I))?H[I]:"\\u"+("0000"+I.charCodeAt(0).toString(16)).slice(-4);});};var C;switch(typeof F){case"number":C=isFinite(F)?F:"null";break;case"string":C='"'+D(F)+'"';break;case"boolean":C='"'+F.toString()+'"';break;default:if(F instanceof Array){var B=A.map(F,function(G){return A.object2JSON(G);});C="["+B.join(",")+"]";}else{if(F instanceof Object){var E=F.exportProperties||F;var B=A.foldl([],E,function(I,H,G){if(E instanceof Array){G=I;I=F[G];}H.push('"'+G+'":'+A.object2JSON(I));});C="{"+B.join(",")+"}";}else{C="null";}}}return C;},"htmlTextTruncate":function(N,E,M,G){if(!E||N.length",F);if(K<0){return N;}var B=N.substring(F+1,K);var O={"name":"","closing":false};if(B.charAt(0)=="/"){O.closing=true;B=B.substring(1);}O.name=B.match(/(\w)+/)[0];if(O.closing){var J=P.pop();if(!J||J.name!=O.name){return N;}}else{if(!C[O.name]){P.push(O);}}F=K;}else{if(D=="&"&&N.substring(F).match(/^(\S)+;/)){F=N.indexOf(";",F);}else{if(I==E){H=F;break;}I++;}}}if(H||G){if(H){N=N.substring(0,H)+(M||"");}for(var F=P.length-1;F>=0;F--){N+="";}}return N;},"mapClass2Object":function(C,B){B=B||{};C.find("*").andSelf().each(function(E,F){if(F.className){var D=F.className.split(/[ ]+/);A.each(D,function(G,H){B[H]=F;});}});return B;},"stripTags":function(B){return A("
").html(B).text();},"parseUrl":function(B){var C=B.match(Echo.Vars.regexps.parseUrl);return C?{"scheme":C[3],"domain":C[4],"path":C[5],"query":C[7],"fragment":C[9]}:undefined;},"toDOM":function(C,G,F){var D=A(C);var E=A.mapClass2Object(D);var H={"set":function(I,J){E[G+I]=J;},"get":function(I,K){var J=E[(K?"":G)+I];return J&&A(J);},"remove":function(J){var I;if(typeof J=="string"){I=G+J;}else{I=J.echo.name;}A(E[I]).remove();delete E[I];},"content":D};var B;if(typeof F=="object"){B=function(I,J,K){if(!F[I]){return ;}return F[I](J,K);};}else{B=F;}A.each(E,function(M,J){var L=M.match(G+"(.*)");var I=L?L[1]:undefined;if(I&&B){J=A(J);J.echo=J.echo||{};J.echo.name=M;var K=B(I,J,H);if(typeof K!="undefined"){J.empty().append(K);}}});return H;},"loadScriptContent":function(D,F){Echo.Vars.scriptState=Echo.Vars.scriptState||{};if(Echo.Vars.scriptState[D]=="loaded"){F();return ;}var E=Echo.Broadcast.subscribe("internal.scriptLoaded",function(G,H){if(D!=H){return ;}Echo.Broadcast.unsubscribe("internal.scriptLoaded",E);F();});if(Echo.Vars.scriptState[D]=="loading"){return ;}Echo.Vars.scriptState[D]="loading";var C=document.createElement("script");C.type="text/javascript";C.charset="utf-8";C.src=D;var B=document.getElementsByTagName("head")[0]||document.documentElement;B.insertBefore(C,B.firstChild);C.onload=C.onreadystatechange=function(){var G=C.readyState;if(!G||G=="loaded"||G=="complete"){Echo.Vars.scriptState[D]="loaded";Echo.Broadcast.publish("internal.scriptLoaded",D);C.onload=C.onreadystatechange=null;}};},"sendPostRequest":function(C,E,G){var F="echo-post-"+Math.random(); var B=A("#echo-post-request").length?A("#echo-post-request").empty():A('
').css({"height":0}).prependTo("body");A('').appendTo(B);var D=A("
",{"target":F,"method":"POST","enctype":"application/x-www-form-urlencoded","acceptCharset":"UTF-8","action":C}).appendTo(B);A.each(E,function(H,I){A("",{"type":"hidden","name":H,"value":I}).appendTo(D);});D.submit();G();},"getVisibleColor":function(C){var B;do{B=C.css("backgroundColor");if(B!=""&&B!="transparent"&&!/rgba\(0, 0, 0, 0\)/.test(B)||A.nodeName(C.get(0),"body")){break;}}while(C=C.parent());return B||"transparent";},"timestampFromW3CDTF":function(B){var E=["year","month","day","hours","minutes","seconds"];var C={};var D=B.match(Echo.Vars.regexps.w3cdtf);A.each(E,function(F,G){C[G]=D[F+1];});return Date.UTC(C["year"],C["month"]-1,C["day"],C["hours"],C["minutes"],C["seconds"])/1000;},"isMobileDevice":function(){return Echo.Vars.regexps.mobileUA.test(navigator.userAgent);}});if(!Echo.Plugins){Echo.Plugins={};}Echo.isExtended=function(B,D,C){if(!B){return false;}C=C||true;var E=[B].concat(D).join(".");Echo.Vars.extensions=Echo.Vars.extensions||{};if(Echo.Vars.extensions[E]==C){return true;}Echo.Vars.extensions[E]=C;return false;};Echo.extendRenderer=function(B,F,D,C){if(!B||!Echo[B]||!F||!D||!A.isFunction(D)||Echo.isExtended(C,[B,"renderer",F])){return ;}var E=Echo[B].prototype.renderers[F]||function(){};Echo[B].prototype.renderers[F]=function(){var H=C&&this.config.get("plugins."+C);if(!H||!H.enabled){return E.apply(this,arguments);}var G=this;if(!this.parentRenderer){this.parentRenderer=function(J,I){return G.parentRenderers[J].apply(G,I);};}this.parentRenderers=this.parentRenderers||{};this.parentRenderers[F]=E;return D.apply(this,arguments);};};Echo.extendTemplate=function(C,E,I,B,H){if(!C||!Echo[C]||!I||!B||!E||Echo.isExtended(H,[C,"template",B,I],E)){return ;}var G=Echo[C].prototype.template;var F=A.isFunction(G)?G:function(){return G;};var D={"insertBefore":"before","insertAfter":"after","insertAsFirstChild":"prepend","insertAsLastChild":"append","replace":"replaceWith"};Echo[C].prototype.template=function(){var J=H&&this.config.get("plugins."+H);if(!J||!J.enabled){return F.call(this);}var K=A("
").html(F.call(this));A("."+B,K)[D[I]](E);return K.html();};};Echo.include=function(B,D){if(!B.length){return D();}var C=B.pop();Echo.include(B,function(){if(typeof C.loaded=="undefined"){if(C.application){C.loaded=function(){return !!Echo[C.application];};}else{D();}}if(A.isFunction(C.loaded)&&!C.loaded()){A.loadScriptContent(C.url,D);}else{D();}});};Echo.createPlugin=function(C){if(!C||!C.name||!C.init||!C.applications){return{};}var B=C.name;var E=function(){var F=function(G){return"plugins."+B+(G?"."+G:"");};F.get=function(G,H,I,J){return G.config.get(F(H),J?G.config.get(H,I):I);};F.set=function(G,H,I){G.config.set(F(H),I);};F.remove=function(G,H){G.config.remove(F(H));};return F;};var D=C.init||function(){};Echo.Plugins[B]=Echo.Plugins[B]||A.extend(C,{"init":function(H,G){var F=H.config.get(G,"enabled");if(typeof F=="undefined"){H.config.set(G,"enabled",true);}D(H,G);},"set":function(F,G,H){F.vars=F.vars||{};F.vars[B]=F.vars[B]||{};A.setNestedValue(F.vars[B],G,H);},"get":function(F,G){var H=(F.vars||{})[B]||{};if(!G){return H;}return A.getNestedValue(G,H);},"addCss":function(F){A.addCss(F,"plugins-"+B);},"label":function(F,G){return Echo.Localization.label(F,"Plugins."+B,G);},"addLabels":function(F){Echo.Localization.extend(F,"Plugins."+B);},"topic":function(H,G){var F=typeof H=="string"?H:H.namespace;return F+".Plugins."+B+"."+G;},"config":E(),"subscribe":function(H,G,I){var F=this;return H.subscribe(G,function(){if(!H.isPluginEnabled(F.name)){return ;}I.apply(this,arguments);});},"publish":function(G,F,H){G.publish(F,H);},"unsubscribe":function(G,F,H){G.unsubscribe(F,H);},"extendRenderer":function(F,H,G){Echo.extendRenderer(F,H,G,B);},"extendTemplate":function(G,H,I,F){Echo.extendTemplate(G,H,I,F,B);},"addItemControl":function(G,H){var F=G.config.get("itemControls."+B,[]);G.config.set("itemControls."+B,F.concat(H));},"assembleConfig":function(F,G){G.user=F.user;G.appkey=F.config.get("appkey","");G.plugins=this.config.get(F,"nestedPlugins",[]);G.contextId=F.config.get("contextId");G.apiBaseURL=F.config.get("apiBaseURL");return(new Echo.Config(G,this.config.get(F))).getAsHash();}});return Echo.Plugins[B];};if(!Echo.Broadcast){Echo.Broadcast={};}Echo.Broadcast.initContext=function(C,B){B=B||"empty";Echo.Vars.subscriptions=Echo.Vars.subscriptions||{};Echo.Vars.subscriptions[B]=Echo.Vars.subscriptions[B]||{};Echo.Vars.subscriptions[B][C]=Echo.Vars.subscriptions[B][C]||{};return B;};Echo.Broadcast.subscribe=function(C,D,B){var E=(new Date()).valueOf()+Math.random();B=Echo.Broadcast.initContext(C,B);Echo.Vars.subscriptions[B][C][E]=D;return E;};Echo.Broadcast.unsubscribe=function(C,D,B){B=Echo.Broadcast.initContext(C,B);if(C&&D){delete Echo.Vars.subscriptions[B][C][D];}else{if(C){delete Echo.Vars.subscriptions[B][C];}}};Echo.Broadcast.publish=function(C,D,B){B=Echo.Broadcast.initContext(C,B);if(B=="*"){A.each(Echo.Vars.subscriptions,function(E){A.each(Echo.Vars.subscriptions[E][C]||{},function(G,F){F.apply(this,[C,D]);});});}else{if(Echo.Vars.subscriptions[B][C]){A.each(Echo.Vars.subscriptions[B][C],function(F,E){E.apply(this,[C,D]);});}if(B!="empty"){Echo.Broadcast.publish(C,D,"empty");}}};if(!Echo.Object){Echo.Object=function(){};}Echo.Object.prototype.init=function(B){A.extend(this,B||{});};Echo.Object.prototype.template="";Echo.Object.prototype.namespace="";Echo.Object.prototype.cssPrefix="echo-";Echo.Object.prototype.substitute=function(C,D){var B=this;C=C.replace(Echo.Vars.regexps.matchSelf,function(F,E){return A.getNestedValue(E,B)||A.getNestedValue(E,B.data||{})||B.config.get(E,"");});C=C.replace(Echo.Vars.regexps.matchLabel,function(F,E){return B.label(E);});C=C.replace(Echo.Vars.regexps.matchData,function(F,E){return A.getNestedValue(E,D,"");});return C;};Echo.Object.prototype.renderers={};Echo.Object.prototype.label=function(C,D){var B=Echo.Localization.label(C,this.namespace,D);return B!=C?B:Echo.Localization.label(C,"",D);};Echo.Object.prototype.render=function(D,E,G,B){var C=this;if(D){if(A.isFunction(this.renderers[D])){return this.renderers[D].call(this,E,G,B);}}else{var F=A.isFunction(this.template)?this.template():this.template;this.dom=A.toDOM(this.substitute(F,this.data||{}),this.cssPrefix,function(){return C.render.apply(C,arguments);});return this.dom.content;}};Echo.Object.prototype.rerender=function(B,D){var J=this;if(!B){if(this.dom){this.dom.content.replaceWith(this.render());}return ;}if(!this.dom){return ;}if(typeof B!="string"){A.map(B,function(K){J.rerender(K,D);});return ;}else{if(!this.dom.get(B)){return ;}}if(D){var I=A.isFunction(this.template)?this.template():this.template;var G=this.substitute(I,this.data||{});var E=this.dom.get(B);var H=A("."+this.cssPrefix+B,A(G));H=A.toDOM(H,this.cssPrefix,function(K,L,M){J.dom.set(K,L);return J.render.apply(J,arguments);}).content;E.replaceWith(H);}else{var F=this.dom.get(B);var C=this.renderers[B].call(this,F,this.dom);if(typeof C!="undefined"){F.empty().append(C);}}};Echo.Object.prototype.hyperlink=function(E,D){D=D||{};if(D.openInNewWindow&&!E.target){E.target="_blank";}var C=E.caption||"";delete E.caption;if(!D.skipEscaping){E.href=A.htmlize(E.href);}E.href=E.href||"javascript:void(0)";var B=A.foldl([],E,function(H,G,F){G.push(F+'="'+H+'"');});return""+C+"";};Echo.Object.prototype.newContextId=function(){return(new Date()).valueOf()+Math.random();};Echo.Object.prototype.getContextId=function(){return this.config&&this.config.get("contextId");};Echo.Object.prototype.subscribe=function(B,C){return Echo.Broadcast.subscribe(B,C,this.getContextId());};Echo.Object.prototype.unsubscribe=function(B,C){Echo.Broadcast.unsubscribe(B,C,this.getContextId());};Echo.Object.prototype.publish=function(B,C){Echo.Broadcast.publish(B,C,this.getContextId()); };Echo.Object.prototype.clearCache=function(){if(this.vars&&this.vars.cache){this.vars.cache={};}};Echo.Application=function(){this.addCss();};Echo.Application.prototype=new Echo.Object();Echo.Application.prototype.localization={"loading":"Loading...","retrying":"Retrying...","error_busy":"Loading. Please wait...","error_timeout":"Loading. Please wait...","error_waiting":"Loading. Please wait...","error_view_limit":"View creation rate limit has been exceeded. Retrying in {seconds} seconds...","error_view_update_capacity_exceeded":"This stream is momentarily unavailable due to unusually high activity. Retrying in {seconds} seconds...","error_result_too_large":"(result_too_large) The search result is too large.","error_wrong_query":"(wrong_query) Incorrect or missing query parameter.","error_incorrect_appkey":"(incorrect_appkey) Incorrect or missing appkey.","error_internal_error":"(internal_error) Unknown server error.","error_quota_exceeded":"(quota_exceeded) Required more quota than is available.","error_incorrect_user_id":"(incorrect_user_id) Incorrect user specified in User ID predicate.","error_unknown":"(unknown) Unknown error."};Echo.Application.prototype.initApplication=function(D){var B=this;var C=this.config.get("appkey");if(!C){this.showMessage({"type":"error","message":"Incorrect or missing mandatory parameter appkey"});return ;}this.config.get("target").addClass("echo-ui");this.user=this.config.get("user")||new Echo.User({"appkey":C,"apiBaseURL":this.config.get("apiBaseURL"),"contextId":this.config.get("contextId")});this.user.init(function(){B.initPlugins(D);});Echo.Localization.extend(this.localization);};Echo.Application.prototype.messageTemplates={"compact":''+"","default":'
'+''+"{Data:message}"+""+"
"};Echo.Application.prototype.showMessage=function(C,D){if(!this.config.get("debug")&&C.type=="error"){return ;}var B=this.messageTemplates[C.layout||this.messageLayout||"default"];(D||this.config.get("target")).empty().append(this.substitute(B,C));};Echo.Application.prototype.isWaitingForData=function(B){return B&&A.inArray(B.errorCode,["waiting","timeout","busy","view_limit","view_update_capacity_exceeded"])>=0;};Echo.Application.prototype.isErrorWithTimer=function(B){return B&&A.inArray(B.errorCode,["view_limit","view_update_capacity_exceeded"])>=0;};Echo.Application.prototype.handleErrorResponse=function(H,E){var C=this;E=E||{};var I=this.config.get("target");var F=function(){if(C.waitingTimeoutStep>0){if(C.waitingTimeoutStep<4){C.waitingTimeoutStep++;}}else{C.waitingTimeoutStep=1;}return Math.round(Math.exp(C.waitingTimeoutStep))*1000;};var D=0;var G=0;var B=function(){var L={};if(C.isErrorWithTimer(H)){L={"seconds":(D-G)/1000};}var J=C.label("error_"+H.errorCode,L);var K=J=="error_"+H.errorCode?"("+H.errorCode+") "+(H.errorMessage||""):J;I.show();C.showMessage({"type":C.isWaitingForData(H)?"loading":"error","message":K},E.messageTarget);};if(this.isWaitingForData(H)){D=F();timeout=this.isErrorWithTimer(H)?1000:D;this.waitingTimer=setInterval(function(){G+=timeout;if(G==D){C.cleanupErrorHandlers();if(C.isErrorWithTimer(H)){C.showMessage({"type":"loading","message":C.label("retrying")},E.messageTarget);}if(E.waitingHandler){E.waitingHandler();}else{C.refresh();}}else{B();}},timeout);}else{this.waitingTimeoutStep=0;}if(this.error!=H||this.isErrorWithTimer(H)){if(!this.config.get("debug")){I.hide();}else{B();}}this.error=H;if(E.callback){E.callback(H);}};Echo.Application.prototype.cleanupErrorHandlers=function(B){if(B){this.waitingTimeoutStep=0;delete this.error;}if(this.waitingTimer){clearInterval(this.waitingTimer);}};Echo.Application.prototype.initPlugins=function(E){var D=this;var C=this.config.get("pluginsOrder");var B=A.foldl([],C,function(F,H){var G=Echo.Plugins[F];if(G&&G.dependencies&&G.dependencies.length){return H.concat(G.dependencies);}});Echo.include(B,function(){A.map(C,function(F){var G=Echo.Plugins[F];if(G&&G.init&&D.isPluginApplicable(G)){G.init(G,D);}});if(E){E();}});};Echo.Application.prototype.enablePlugin=function(B){this.config.set("plugins."+B+".enabled",true);};Echo.Application.prototype.disablePlugin=function(B){this.config.set("plugins."+B+".enabled",false);};Echo.Application.prototype.isPluginEnabled=function(B){return this.config.get("plugins."+B+".enabled",true);};Echo.Application.prototype.isPluginApplicable=function(D){var C=this,B=false;A.each(D.applications,function(F,E){if(Echo[E]&&C instanceof Echo[E]){B=true;return false;}});return B;};Echo.Application.prototype.initConfig=function(D,E,C){var B={};B.target=function(F){return A(F);};B.plugins=function(G){var F=A.foldl({"hash":{},"order":[]},G||[],function(H,I){var J=A.inArray(H.name,I.order);if(J>=0){I.order.splice(J,1);}I.order.push(H.name);I.hash[H.name]=H;});this.set("pluginsOrder",F.order);return F.hash;};D=A.extend({"plugins":[]},D||{});E=A.extend({"appkey":"","apiBaseURL":window.location.protocol+"//api.echoenabled.com","liveUpdates":true,"liveUpdatesTimeout":10,"liveUpdatesTimeoutMin":3,"debug":true,"contextId":this.newContextId()},E||{});this.config=new Echo.Config(D,E,function(F,H){var G=C&&C[F]||B&&B[F];return G?G.call(this,H):H;});};Echo.Application.prototype.sendAPIRequest=function(B,C){B.query.appkey=this.config.get("appkey");A.get(this.config.get("apiBaseURL")+"/v1/"+B.endpoint,B.query,C,"jsonp");};Echo.Application.prototype.initLiveUpdates=function(D,B){var C=this;this.liveUpdates={"originalTimeout":this.config.get("liveUpdatesTimeout"),"timers":{},"timeouts":[],"responseHandler":function(E){if(C.liveUpdates.timers.watchdog){clearTimeout(C.liveUpdates.timers.watchdog);}C.changeLiveUpdatesTimeout(E);B(E);},"requestParamsGetter":D};};Echo.Application.prototype.changeLiveUpdatesTimeout=function(H){var D=this;if(typeof H=="string"){H={"liveUpdatesTimeout":H};}H.liveUpdatesTimeout=parseInt(H.liveUpdatesTimeout);var C=function(J){if(!J&&D.liveUpdates.originalTimeout!=D.config.get("liveUpdatesTimeout")){D.config.set("liveUpdatesTimeout",D.liveUpdates.originalTimeout);}else{if(J&&J>D.config.get("liveUpdatesTimeout")){D.config.set("liveUpdatesTimeout",J);}}};var B=function(J){return !!(J.entries&&J.entries.length);};if(!this.nextSince){C(H.liveUpdatesTimeout);return ;}var F=this.config.get("liveUpdatesTimeout");var I=parseInt(this.nextSince);var E=Math.floor((new Date()).getTime()/1000);var G=B(H)?E-I>F?this.config.get("liveUpdatesTimeoutMin",3):F+1:F+2;if(G>this.liveUpdates.originalTimeout){G=this.liveUpdates.originalTimeout;}this.config.set("liveUpdatesTimeout",G);if(G==this.liveUpdates.originalTimeout){C(H.liveUpdatesTimeout);}};Echo.Application.prototype.stopLiveUpdates=function(){if(this.liveUpdates.timers.regular){clearTimeout(this.liveUpdates.timers.regular);}if(this.liveUpdates.timers.watchdog){clearTimeout(this.liveUpdates.timers.watchdog);}};Echo.Application.prototype.startLiveUpdates=function(D){var B=this;if(!this.liveUpdates||!D&&!this.config.get("liveUpdates")&&!this.liveUpdates.timeouts.length){return ;}this.stopLiveUpdates();if(D){this.liveUpdates.timeouts=[0,1,3];}var C=this.liveUpdates.timeouts.length?this.liveUpdates.timeouts.shift():this.config.get("liveUpdatesTimeout");this.liveUpdates.timers.regular=setTimeout(function(){B.liveUpdates.timers.watchdog=setTimeout(function(){B.startLiveUpdates();},5000);B.sendAPIRequest(B.liveUpdates.requestParamsGetter(),B.liveUpdates.responseHandler);},C*1000);};Echo.Application.prototype.addCss=function(){var C="echo-css-fancybox";if(A("#"+C).length){return ;}var B=document.getElementsByTagName("head")[0]||document.documentElement;B.insertBefore(A("",{"rel":"stylesheet","id":C,"type":"text/css","href":"//cdn.echoenabled.com/css/fancybox.css"}).get(0),A(B).children().get(0));A.addCss(".echo-application-message { padding: 15px 0px; text-align: center; -moz-border-radius: 0.5em; -webkit-border-radius: 0.5em; border: 1px solid #E4E4E4; }"+".echo-application-message-icon { display: inline-block; height: 16px; padding-left: 16px; background: no-repeat left center; }"+".echo-application-message .echo-application-message-icon { padding-left: 21px; height: auto; }"+".echo-application-message-empty { background-image: url(//cdn.echoenabled.com/images/information.png); }"+".echo-application-message-loading { background-image: url(//cdn.echoenabled.com/images/loading.gif); }"+".echo-application-message-error { background-image: url(//cdn.echoenabled.com/images/warning.gif); }","application"); };Echo.User=function(B){this.data={};this.config=new Echo.Config(B,{"appkey":"","apiBaseURL":window.location.protocol+"//api.echoenabled.com","contextId":undefined});};Echo.User.prototype.init=function(E){var B=this;this.callback=E||function(){};if(!this.config.get("appkey")||!window.Backplane||!Backplane.getChannelID()){this.set({});this.callback();return ;}this.listenEvents();var D=this._global("get","state");if(D=="ready"){this.set(A.extend({},this._global("get","data")));this.callback();}else{var C=Echo.Broadcast.subscribe("User.onInit",function(F,G){if(G.appkey!=B.config.get("appkey")){return ;}Echo.Broadcast.unsubscribe("User.onInit",C);B.set(A.extend({},B._global("get","data")));B.callback();});if(D=="init"){this.request();}}};Echo.User.prototype.listenEvents=function(){var B=this;if(this.backplaneSubscriptionID){return ;}var C=function(F){var E=(F?"":"internal.")+"User.onInvalidate";var G={"data":B.data,"appkey":B.config.get("appkey")};var D=F?undefined:B.config.get("contextId");Echo.Broadcast.publish(E,G,D);};this.backplaneSubscriptionID=Backplane.subscribe(function(E){if(E.type=="identity/ack"){var D=false;if(B._global("get","state")=="ready"){D=true;B._global("set","state","init");}B.init(function(){C();if(D){C(true);}});}});};Echo.User.prototype._global=function(E,C,D){var B=this.config.get("appkey");Echo.Vars.users=Echo.Vars.users||{};Echo.Vars.users[B]=Echo.Vars.users[B]||{"state":"init","data":{}};if(E=="get"){return Echo.Vars.users[B][C];}Echo.Vars.users[B][C]=D;};Echo.User.prototype.set=function(){if(!arguments.length){return ;}if(arguments.length==1&&typeof arguments[0]=="object"){this._global("set","data",arguments[0]);this.data=this.normalize(arguments[0]);this.account=this.assemble();}else{if(arguments.length==2&&typeof arguments[0]=="string"){this.account[arguments[0]]=arguments[1];}}};Echo.User.prototype.get=function(B,C){return(this.account.hasOwnProperty(B)&&typeof this.account[B]!="undefined")?this.account[B]:C;};Echo.User.prototype.logout=function(C){var B=this;A.get(window.location.protocol+"//apps.echoenabled.com/v2/logout",{"sessionID":Backplane.getChannelID()},function(D){Backplane.expectMessages("identity/ack");},"jsonp");};Echo.User.prototype.request=function(D){var B=this,C=this.config.get("appkey");this._global("set","state","waiting");A.get(this.config.get("apiBaseURL")+"/v1/users/whoami",{"appkey":C,"sessionID":Backplane.getChannelID()},function(E){if(E.result&&E.result=="session_not_found"){E={};}B._global("set","state","ready");B.set(A.extend({},E));Echo.Broadcast.publish("User.onInit",{"data":E,"appkey":C});if(D){D();}},"jsonp");};Echo.User.prototype.normalize=function(C){var B=function(D){return A.foldl({},D||[],function(E,F){F[E]=true;});};C=C||{};C.echo=C.echo||{};A.extend(C,C.echo);C.poco=C.poco||{"entry":{}};C.roles=B(C.echo.roles);C.markers=B(C.echo.markers);C.sessionID=window.Backplane&&Backplane.getChannelID()||undefined;C.accounts=C.poco.entry.accounts||[];return C;};Echo.User.prototype.getActiveAccounts=function(){return A.map(this.data.accounts,function(B){if(B.loggedIn=="true"){return B;}});};Echo.User.prototype.assemble=function(){var B=this.getActiveAccounts();var C=B[0]||{};return A.extend(this.data,{"id":C.identityUrl||this.data.poco.entry.id||C.userid,"name":C.displayName||C.username,"avatar":A.foldl(undefined,C.photos||[],function(D){if(D.type=="avatar"){return D.value;}}),"state":this.data.echo.state||"Untouched","domain":C.domain,"logged":!!B.length,"defaultAvatar":"//cdn.echoenabled.com/images/avatar-default.png","fakeIdentityURL":"http://js-kit.com/ECHO/user/fake_user"});};Echo.User.prototype.hasIdentity=function(C){var B=false;A.each(this.data.accounts,function(D,E){if(E.identityUrl&&E.identityUrl==C){B=true;return false;}});return B;};Echo.User.prototype.hasAny=function(E,C){if(!this.account){return false;}var B=this,D=false;A.each(C,function(F,H){var G=B.get(E,{});if((typeof G=="string"&&G==H)||G[H]){D=true;return false;}});return D;};Echo.User.prototype.hasAnyRole=function(B){return this.hasAny("roles",B);};Echo.User.prototype.isAdmin=function(){return this.hasAny("roles",["administrator","moderator"]);};Echo.User.prototype.logged=function(){return !!(this.account&&this.account.logged);};Echo.Config=function(E,C,D){var B=this;this.normalize=D||function(F,G){return G;};this.data={};this.cache={};if(!C&&!D){this.data=E;}else{A.each(this.combine(E,A.extend({},C)),function(F,G){B.set(F,G);});}};Echo.Config.prototype.get=function(C,D){var B=C;if(typeof B!="string"){B=B.join(".");}if(!this.cache.hasOwnProperty(B)){this.cache[B]=A.getNestedValue(C,this.data);}return typeof this.cache[B]=="undefined"?D:this.cache[B];};Echo.Config.prototype.set=function(B,D){var C=B.split(/\./);delete this.cache[B];if(typeof D=="object"){this.clearCacheByPrefix(B);}return A.setNestedValue(this.data,B,this.normalize(C.pop(),D));};Echo.Config.prototype.remove=function(B){var C=B.split(/\./);var E=C.pop();var D=A.getNestedValue(C,this.data);delete D[E];};Echo.Config.prototype.combine=function(D,C){var B=this;return A.foldl(C,D,function(G,F,E){F[E]=A.isPlainObject(G)&&C.hasOwnProperty(E)?B.combine(G,C[E]):G;});};Echo.Config.prototype.extend=function(B){var C=this;A.each(B,function(D,E){C.set(D,E);});};Echo.Config.prototype.getAsHash=function(){return this.data;};Echo.Config.prototype.clearCacheByPrefix=function(C){var B=this;C+=".";A.each(this.cache,function(D,E){if(!D.indexOf(C)){delete B.cache[D];}});};if(!Echo.Localization){Echo.Localization={labels:{}};}Echo.Localization.key=function(B,C){return(C?C+".":"")+B;};Echo.Localization.extend=function(C,B){A.each(C,function(D,E){Echo.Localization.labels[Echo.Localization.key(D,B)]=E;});};Echo.Localization.label=function(C,D,E){var B=Echo.Localization.labels[Echo.Localization.key(C,D)]||C;A.each(E||{},function(F,G){B=B.replace(new RegExp("{"+F+"}","g"),G);});return B;};if(!Echo.UI){Echo.UI={cornersCss:function(B,C){return("{scope}.ui-corner-tl { -moz-border-radius-topleft: {radius}; -webkit-border-top-left-radius: {radius}; border-top-left-radius: {radius}; }"+"{scope}.ui-corner-tr { -moz-border-radius-topright: {radius}; -webkit-border-top-right-radius: {radius}; border-top-right-radius: {radius}; }"+"{scope}.ui-corner-bl { -moz-border-radius-bottomleft: {radius}; -webkit-border-bottom-left-radius: {radius}; border-bottom-left-radius: {radius}; }"+"{scope}.ui-corner-br { -moz-border-radius-bottomright: {radius}; -webkit-border-bottom-right-radius: {radius}-bottom-right-radius: {radius}; }"+"{scope}.ui-corner-top { -moz-border-radius-topleft: {radius}; -webkit-border-top-left-radius: {radius}; border-top-left-radius: {radius}; -moz-border-radius-topright: {radius}; -webkit-border-top-right-radius: {radius}; border-top-right-radius: {radius}; }"+"{scope}.ui-corner-bottom { -moz-border-radius-bottomleft: {radius}; -webkit-border-bottom-left-radius: {radius}; border-bottom-left-radius: {radius}; -moz-border-radius-bottomright: {radius}; -webkit-border-bottom-right-radius: {radius}; border-bottom-right-radius: {radius}; }"+"{scope}.ui-corner-right { -moz-border-radius-topright: {radius}; -webkit-border-top-right-radius: {radius}; border-top-right-radius: {radius}; -moz-border-radius-bottomright: {radius}; -webkit-border-bottom-right-radius: {radius}; border-bottom-right-radius: {radius}; }"+"{scope}.ui-corner-left { -moz-border-radius-topleft: {radius}; -webkit-border-top-left-radius: {radius}; border-top-left-radius: {radius}; -moz-border-radius-bottomleft: {radius}; -webkit-border-bottom-left-radius: {radius}; border-bottom-left-radius: {radius}; }"+"{scope}.ui-corner-all { -moz-border-radius: {radius}; -webkit-border-radius: {radius}; border-radius: {radius}; }").replace(/{scope}/g,C||"").replace(/{radius}/g,B);}};}(function(){A.addCss(".echo-ui { text-align: left; }"+".echo-ui .ui-helper-hidden { display: none; }"+".echo-ui .ui-helper-hidden-accessible { position: absolute; left: -99999999px; }"+".echo-ui .ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; }"+'.echo-ui .ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; }'+".echo-ui .ui-helper-clearfix { display: inline-block; }"+"/* required comment for clearfix to work in Opera \\*/"+"* html .echo-ui .ui-helper-clearfix { height:1%; }"+".echo-ui .ui-helper-clearfix { display:block; }"+"/* end clearfix */"+".echo-ui .ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); }"+".echo-ui .ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block;}"+".echo-ui .ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; }"+".echo-ui .ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; }"+".echo-ui .ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; }"+".echo-ui .ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; }"+".echo-ui .ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; }"+".echo-ui .ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; }"+".echo-ui .ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; }"+".echo-ui .ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; }"+".echo-ui .ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}"+".echo-ui .ui-state-disabled { cursor: default !important; }"+".echo-ui .ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; width: 16px; height: 16px; }"+".echo-ui .ui-widget-header { font-weight: bold; border: 0px; }"+".echo-ui, .echo-ui .ui-widget :active { outline: none; }"+".echo-ui .ui-state-default { border: 1px solid #d3d3d3; background: #e6e6e6; color: #555555; }"+".echo-ui .ui-state-default a, .echo-ui .ui-state-default a:link, .echo-ui .ui-state-default a:visited { color: #555555; text-decoration: none; }"+".echo-ui .ui-state-hover, .echo-ui .ui-state-focus { border: 1px solid #999999; background: #dfebf2; color: #212121; }"+".echo-ui .ui-state-hover a, .echo-ui .ui-state-hover a:hover { color: #212121; text-decoration: none; }"+".echo-ui .ui-state-active { border: 1px solid #aaaaaa; background: #dfebf2; color: #212121; }"+".echo-ui .ui-state-active a, .echo-ui .ui-state-active a:link, .echo-ui .ui-state-active a:visited { color: #212121; text-decoration: none; }"+".echo-primaryBackgroundColor { }"+".echo-secondaryBackgroundColor { background-color: #F4F4F4; }"+".echo-trinaryBackgroundColor { background-color: #ECEFF5; }"+".echo-primaryColor { color: #3A3A3A; }"+".echo-secondaryColor { color: #C6C6C6; }"+".echo-primaryFont { font-family: Arial, sans-serif; font-size: 12px; font-weight: normal; line-height: 16px; }"+".echo-secondaryFont { font-family: Arial, sans-serif; font-size: 11px; }"+".echo-linkColor, .echo-linkColor a { color: #476CB8; }"+".echo-clickable { cursor: pointer; }"+".echo-relative { position: relative; }"+".echo-clear { clear: both; }","ui-general"); })(jQuery);(function(B){if(B.fn.jquery&&B.fn.jquery<"1.6.4"){return ;}Echo.UI.MobileButton=function(D,C){this.states=C||{};this.element=B(D);this.addCss();var E=this.prepareData(this.states.normal||{});if(E.label){this.setLabel(E.label);}else{this.states.normal=B.extend(this.states.normal||{},{"label":this.element.html()});}this.element.button();this.wrapper=this.element.parent();this.wrapper.addClass("echo-mobilebutton");this.setIcon(E.icon);};Echo.UI.MobileButton.prototype=new Echo.Object();Echo.UI.MobileButton.prototype.setState=function(C){var D=this.prepareData(this.states[C]);this.setLabel(D.label);this.setIcon(D.icon);this.element.is(":visible")&&this.element.button("refresh");};Echo.UI.MobileButton.prototype.setIcon=function(C){if(B(".ui-icon",this.wrapper).length){B(".ui-icon",this.wrapper).removeClass().addClass(C+" ui-icon");}else{B("
").addClass(C+" ui-icon").prependTo(this.wrapper);}};Echo.UI.MobileButton.prototype.setLabel=function(C){this.element.html(C);};Echo.UI.MobileButton.prototype.prepareData=function(C){return{"label":C.label||"","icon":(C.icons&&C.icons.primary)?C.icons.primary:""};};Echo.UI.MobileButton.prototype.addCss=function(){B.addCss(".echo-mobilebutton .ui-icon { position: absolute; top: 50%; background: none; margin: -7px 0px 0px 5px; float: left; }"+".echo-mobilebutton .ui-icon-arrow-right { background: no-repeat center url(//cdn.echoenabled.com/images/curation/button/apply_normal.png); float: left; }"+".echo-mobilebutton .ui-icon-save { background: no-repeat center url(//cdn.echoenabled.com/images/curation/button/save_normal.png); float: left; margin-right: 5px; }"+".echo-mobilebutton .ui-icon-waiting { background: no-repeat center url(//cdn.echoenabled.com/images/loading.gif); float: left; margin-right: 5px;}"+".echo-mobilebutton .ui-btn-inner { padding: 0.6em 25px; }"+".ui-page .ui-content { overflow-y: hidden}","ui-buttons-icons");};})(jQuery);Echo.UI.Button=function(C,B){if(A.mobile){return new Echo.UI.MobileButton(C,B);}this.states=B||{};this.element=A(C);this.addCss();if(this.states.normal&&!this.states.normal.label){this.states.normal.label=A(C).html();}A(C).button(this.states.normal).wrap('');this.wrapper=A(C).parent();};Echo.UI.Button.prototype=new Echo.Object();Echo.UI.Button.prototype.setState=function(B){this.element.removeClass("ui-button-text-only ui-button-text-icons ui-button-text-icon");this.element.button("option",this.states[B]);};Echo.UI.Button.prototype.addCss=function(){A.addCss(".echo-button .ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; text-decoration: none !important; cursor: pointer; text-align: center; overflow: visible; }"+".echo-button .ui-button-icon-only { width: 1.8em; }"+".echo-button button.ui-button-icon-only { width: 2em; }"+".echo-button .ui-button-icons-only { width: 3em; }"+".echo-button button.ui-button-icons-only { width: 3.3em; }"+".echo-button .ui-button .ui-button-text { display: block; }"+".echo-button .ui-button-text-only .ui-button-text { padding: .4em .8em; }"+".echo-button .ui-button-icon-only .ui-button-text, .echo-button .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; }"+".echo-button .ui-button-text-icon .ui-button-text, .echo-button .ui-button-text-icons .ui-button-text { padding: .4em .8em .4em 2.1em; }"+".echo-button .ui-button-text-icons .ui-button-text { padding-left: 1.9em; padding-right: 1.9em; }"+".echo-button input.ui-button { padding: .4em .8em; }"+".echo-button .ui-button-icon-only .ui-icon, .echo-button .ui-button-text-icon .ui-icon, .echo-button .ui-button-text-icons .ui-icon, .echo-button .ui-button-icons-only .ui-icon { position: absolute; top: 50%; margin-top: -8px; }"+".echo-button .ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; }"+".echo-button .ui-button-text-icon .ui-button-icon-primary, .echo-button .ui-button-text-icons .ui-button-icon-primary, .echo-button .ui-button-icons-only .ui-button-icon-primary { left: .3em; }"+".echo-button .ui-button-text-icons .ui-button-icon-secondary, .echo-button .ui-button-icons-only .ui-button-icon-secondary { right: .3em; }"+".echo-button button.ui-button::-moz-focus-inner { border: 0; padding: 0; }"+".echo-button .ui-state-default { border: 1px solid #d3d3d3; background: #e6e6e6; color: #555555; }"+".echo-button .ui-state-default a, .echo-ui .ui-state-default a:link, .echo-button .ui-state-default a:visited { color: #555555; text-decoration: none; }"+".echo-button .ui-state-hover, .echo-button .ui-state-focus { border: 1px solid #999999; background: #dfebf2; color: #212121; }"+".echo-button .ui-state-active { border: 1px solid #aaaaaa; background: #dfebf2; color: #212121; }"+Echo.UI.cornersCss("4px",".echo-button button"),"ui-buttons");if(A.browser.msie){A.addCss(".echo-button .ui-button { zoom: 1; }","ui-buttons-ie");}A.addCss(".echo-button .ui-icon-arrow-right { background: no-repeat center url(//cdn.echoenabled.com/images/curation/button/apply_normal.png); }"+".echo-button .ui-icon-save { margin-right: 5px; background: no-repeat center url(//cdn.echoenabled.com/images/curation/button/save_normal.png); }"+".echo-button .ui-icon-waiting { margin-right: 5px; background: no-repeat center url(//cdn.echoenabled.com/images/loading.gif); }","ui-buttons-icons");};})(jQuery);(function(A){Echo.Localization.extend({"edit":"Edit","login":"Login","logout":"Logout","loggingOut":"Logging out...","or":"or","signup":"signup"},"Auth");Echo.Auth=function(C){if(!C||!C.target){return ;}var B=this;this.vars={};this.initConfig(C);this.initApplication(function(){B.addCss();B.listenEvents();B.config.get("target").empty().append(B.render());});};Echo.Auth.prototype=new Echo.Application();Echo.Auth.prototype.namespace="Auth";Echo.Auth.prototype.cssPrefix="echo-auth-";Echo.Auth.prototype.renderers={};Echo.Auth.prototype.template=function(){return this.templates[this.user.logged()?"logged":"anonymous"];};Echo.Auth.prototype.templates={};Echo.Auth.prototype.templates.anonymous='
'+'"+' {Label:or} '+'"+"
";Echo.Auth.prototype.templates.logged='
'+'
'+'
'+'
'+"{Label:edit}"+"
"+'
'+"{Label:logout}"+"
"+'
'+"
";Echo.Auth.prototype.renderers.logout=function(C){var B=this;C.click(function(){C.empty().append(B.label("loggingOut"));B.user.logout();});};Echo.Auth.prototype.renderers.login=function(B){this.assembleIdentityControl("login",B);};Echo.Auth.prototype.renderers.edit=function(B){this.assembleIdentityControl("edit",B);};Echo.Auth.prototype.renderers.signup=function(B){this.assembleIdentityControl("signup",B);};Echo.Auth.prototype.renderers.or=function(B){if(!this.config.get("identityManager.login")||!this.config.get("identityManager.signup")||!this.user.get("sessionID")){B.hide();}};Echo.Auth.prototype.renderers.avatar=function(E){var C=this;var D=this.user.get("avatar",this.user.get("defaultAvatar"));var B=A("",{"src":D});if(D!=this.user.get("defaultAvatar")){B.one({"error":function(){A(this).attr("src",C.user.get("defaultAvatar"));}});}E.append(B);};Echo.Auth.prototype.renderers.name=function(B){B.append(this.user.get("name",""));};Echo.Auth.prototype.assembleIdentityControl=function(E,D){var C=this;var F=this.config.get("identityManager."+E);if(!F||!this.user.get("sessionID")){return D.hide();}var B=function(G){var J=encodeURIComponent(C.user.get("sessionID",""));var I=A.parseUrl(G);var H=I["query"]?I["query"].match(/=$/)?J:"&sessionID="+J:"sessionID="+J; return C.substitute("{Data:scheme}://{Data:domain}{Data:path}?{Data:query}{Data:fragment}",{"scheme":I["scheme"]||"http","domain":I["domain"],"path":I["path"],"query":(I["query"]||"")+H,"fragment":I["fragment"]?("#"+I["fragment"]):""});};if(F.type=="script"){D.click(function(){A.getScript(B(F.url));});}else{D.fancybox({"autoScale":false,"height":F.height,"href":B(F.url),"onClosed":function(){if(A.browser.msie&&document.compatMode!="CSS1Compat"){var G=A("#fancybox-overlay").get(0).style;G.removeExpression("height");G.removeExpression("width");}},"onComplete":function(){var G=(A.browser.msie&&document.compatMode!="CSS1Compat"?40:0);A("#fancybox-frame").css({"width":F.width-G,"height":F.height-G});},"onStart":function(){Backplane.expectMessages("identity/ack");if(A.browser.msie&&document.compatMode!="CSS1Compat"){var G=A("#fancybox-overlay").get(0).style;G.setExpression("height","Math.max(document.body.clientHeight, document.body.scrollHeight)");G.setExpression("width","Math.max(document.body.clientWidth, document.body.scrollWidth)");}},"padding":0,"scrolling":"no","transitionIn":"elastic","transitionOut":"elastic","type":"iframe","width":F.width});}};Echo.Auth.prototype.listenEvents=function(){var B=this;this.subscribe("internal.User.onInvalidate",function(){A.fancybox.close();B.rerender();});};Echo.Auth.prototype.addCss=function(){A.addCss(".echo-auth-logout { float: right; }"+".echo-auth-anonymous { text-align: right; }"+".echo-auth-avatar { float: left; }"+".echo-auth-avatar img { width: 24px; height: 24px; }"+".echo-auth-name { float: left; font-size: 18px; line-height: 24px; margin-left: 5px; font-weight: bold; }"+".echo-auth-edit { float: left; margin: 6px 0px 0px 12px; }","auth");};})(jQuery);(function(A){if(A.fn.jquery&&A.fn.jquery<"1.6.4"){return ;}Echo.UI.MobileDialog=function(B){B.config=B.config||{};this.init(B);this.addCss();this.contentElement=this.render().addClass("echo-ui");this.contentElement.appendTo(document.body);if(this.content){if(A.isFunction(this.content)){this.content(A(".echo-mobiledialog-content",this.contentElement));}else{A(".echo-mobiledialog-content",this.contentElement).append(this.content);}}if(this.hasTabs){A(".echo-mobiledialog-header",this.contentElement).after(A(".echo-tabs-header",this.contentElement));}A(":checkbox",this.contentElement).bind("change",function(C){A(this).attr("checked",A(this).prop("checked"));});if(this.config.autoOpen){this.open();}};Echo.UI.MobileDialog.prototype=new Echo.Object();Echo.UI.MobileDialog.prototype.cssPrefix="echo-mobiledialog-";Echo.UI.MobileDialog.prototype.template=function(){return'
'+'

'+this.config.title+"

"+'
'+'
'+'
'+"
"+"
";};Echo.UI.MobileDialog.prototype.open=function(){A.mobile.changePage(this.contentElement,"pop",false,true);};Echo.UI.MobileDialog.prototype.close=function(){this.contentElement.is(":visible")&&this.contentElement.dialog("close");};Echo.UI.MobileDialog.prototype.addCss=function(){A.addCss(".echo-mobiledialog .ui-icon-delete { background: url(//cdn.echoenabled.com/images/container/closeWindow.png) no-repeat 4px 5px; border-radius: 0px; }"+".echo-mobiledialog .ui-select .ui-icon { height: 18px; width: 18px; }"+".echo-mobiledialog .ui-checkbox { position: static; margin: 0px; float: left; height: 18px; padding-top: 2px; }"+".echo-mobiledialog .ui-checkbox input { position: static; margin: 0px; margin-left: 5px; } "+".echo-mobiledialog .ui-checkbox .ui-btn { margin: -25px 0px 0px 0px; }"+".echo-mobiledialog .ui-checkbox .ui-btn .ui-btn-inner { padding-left: 25px; padding-right: 10px; }"+".echo-mobiledialog .ui-checkbox .ui-btn-icon-left .ui-icon { left: 5px; }"+".echo-mobiledialog .echo-curation-queries-state .ui-checkbox span { margin: 0px; padding-left: 0px; padding-right: 0px;}"+".echo-mobiledialog .echo-curation-queries-state .ui-checkbox .ui-icon { margin-top: -9px;}"+".echo-mobiledialog .echo-curation-queries-state .ui-checkbox .ui-btn-text { margin: 0px; padding-left: 0px; padding-right: 0px; }"+".echo-mobiledialog .echo-curation-queries-state .ui-checkbox .ui-btn-text span { margin: 0px; padding-left: 18px }"+".echo-mobiledialog .ui-btn-icon-notext .ui-btn-inner { padding: 2px 1px 0px 3px; height: 16px; } "+".echo-mobiledialog .ui-btn-icon-notext .ui-btn-inner .ui-icon { margin: 0px; float: left; } "+".echo-mobiledialog .ui-btn .ui-icon { float: left }"+".echo-mobiledialog .ui-btn-hidden { line-height: normal; }"+".echo-mobiledialog .ui-btn-inner { border-top: none; }"+".echo-mobiledialog .echo-submit-content { border: none; background: none; } "+".echo-mobiledialog .echo-submit-border { border: none; background: none; } "+".echo-mobiledialog .echo-curation-queries-content { margin: 18px 0px; } "+".echo-mobiledialog .echo-submit-metadata-wrapper { border: none; background: none; } "+".echo-mobiledialog .echo-curation-queries-itemsPerPage { height: 22px; width: 48px; font-size: 12px; display: inline; } "+".echo-mobiledialog .echo-curation-input { width: 100%; font-size: 12px; }"+".echo-mobiledialog .echo-curation-queries-query { height: 200px; }"+".echo-mobiledialog .echo-submit-metadata-label { margin-top: 8px; }"+".echo-mobiledialog .echo-submit-cancelButton { margin: 19px 15px 0px 0px; }"+".echo-mobiledialog .echo-submit-metadata-subwrapper input { width: 100%; }"+".echo-mobiledialog .echo-submit-text-area { width: 100%; height: 102px; }"+".echo-mobiledialog .echo-curation-queries-state { height: 38px; }"+".echo-mobiledialog .echo-curation-queries-left { margin-right: 10px; }"+Echo.UI.cornersCss("7px",".echo-mobiledialog "),"ui-dialog");};Echo.UI.Dialog=function(B){if(A.mobile){return new Echo.UI.MobileDialog(B);}B.config=B.config||{};this.init(B);this.config.dialogClass="echo-ui echo-dialog "+(this.config.dialogClass||"");this.addCss();this.contentElement=this.render().dialog(this.config).addClass("ui-corner-all");if(this.content){if(A.isFunction(this.content)){this.content(this.contentElement);}else{this.contentElement.append(this.content);}}this.widget=this.contentElement.dialog("widget");if(this.hasTabs){A(".ui-dialog-titlebar",this.widget).after(A(".echo-tabs-header",this.widget));}};Echo.UI.Dialog.prototype=new Echo.Object();Echo.UI.Dialog.prototype.cssPrefix="echo-dialog-";Echo.UI.Dialog.prototype.template="
";Echo.UI.Dialog.prototype.open=function(){this.contentElement.hide();this.contentElement.dialog("open");this.contentElement.show();};Echo.UI.Dialog.prototype.close=function(){this.contentElement.dialog("close");};Echo.UI.Dialog.prototype.addCss=function(){A.addCss(".echo-dialog { position: absolute; padding: 0px 7px 20px 7px; width: 300px; border: 1px solid #aaaaaa; background: #dfebf2; -moz-border-radius: 7px; -webkit-border-radius: 7px; border-radius: 7px;"+(!A.browser.msie?" overflow: hidden;":"")+" }"+".echo-dialog .ui-dialog-titlebar { background: #dfebf2; cursor: move; padding: 7px 0px 10px 5px; position: relative; color: #4a4a4a; font: 18px Helvetica,sans-serif; }"+".echo-dialog .ui-dialog-titlebar .ui-state-default, .echo-dialog .ui-dialog-titlebar .ui-state-active, .echo-dialog .ui-dialog-titlebar .ui-state-hover, .echo-dialog .ui-dialog-titlebar .ui-state-focus { border: 0px; background: none; }"+".echo-dialog .ui-dialog-title { float: left; margin: .1em 16px .2em 0; } "+".echo-dialog .ui-dialog-titlebar-close { position: absolute; right: 0px; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 0px; height: 18px; }"+".echo-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; }"+".echo-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0px; }"+".echo-dialog .ui-dialog-content { border: 0; padding: 0px; margin: 0px; background: #ffffff; overflow: auto; }"+".echo-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; }"+".echo-dialog .ui-icon-closethick { background: no-repeat top right url(//cdn.echoenabled.com/images/container/closeWindow.png); }"+".echo-dialog .ui-icon-grip-diagonal-se { background: no-repeat bottom right url(//cdn.echoenabled.com/images/container/resizeHandle.png); }"+Echo.UI.cornersCss("7px",".echo-dialog "),"ui-dialog"); if(A.browser.msie){A.addCss(".echo-dialog .ui-dialog-content { zoom: 1; position: relative; }","ui-dialog-ie");}};Echo.UI.Tabs=function(D){var C=this;D.config=D.config||{};this.init(D);if(!this.tabs){return ;}var B=this.idPrefix;this.idPrefix=this.idPrefix+Math.ceil(Math.random()*999999999)+"-";this.addCss();var E=A.foldl([],this.tabs,function(G,H,F){G.classPrefix=B;G.idPrefix=C.idPrefix;if(G.icon){G.label=""+G.label+"";}if(G.disabled){H.push(F);}});this.target.append(this.render());this.tabIndexById={};A.each(this.tabs,function(F,G){C.tabIndexById[G.id]=F;if(G.content){var H=A("#"+G.idPrefix+G.id);if(A.isFunction(G.content)){G.content(H);}else{H.append(G.content);}}});if(this.addUIClass!==false){this.target.addClass("echo-ui");}A.extend(this.config,{"disabled":E.concat(C.config.disabled||[]),"select":function(F,G){C.content[G.index?"addClass":"removeClass"]("ui-corner-tl");}});this.headerElement=A(".echo-tabs-header",this.target).tabs(this.config);this.panelsElement=A(".echo-tabs-panels",this.target).tabs(this.config);A(".echo-tabs-header, .echo-tabs-header .ui-tabs-nav",this.target).removeClass("ui-corner-all");this.content=A(this.content||".echo-tabs-panels",this.target);this.content.removeClass("ui-corner-all").addClass("ui-corner-tr ui-corner-bottom");};Echo.UI.Tabs.prototype=new Echo.Object();Echo.UI.Tabs.prototype.cssPrefix="echo-tabs-";Echo.UI.Tabs.prototype.template=function(){var B=this;return'
'+'
'+"
    "+A.map(this.tabs,function(C){return B.substitute('
  • {Data:label}
  • ',C);}).join("\n")+"
"+"
"+'
'+"
";};Echo.UI.Tabs.prototype.renderers={};Echo.UI.Tabs.prototype.renderers.panels=function(C){var B=this;A.each(this.tabs,function(D,E){var F=A.toDOM(B.substitute('
',E));C.append(F.content);});};Echo.UI.Tabs.prototype.select=function(B){this.headerElement.tabs("select",this.tabIndexById[B]);};Echo.UI.Tabs.prototype.add=function(D,C){C?this.tabs.splice(C,0,D):(C=this.tabs.push(D)-1);D=A.extend(D,{"classPrefix":this.classPrefix,"idPrefix":this.idPrefix});var E=this.substitute("
  • "+''+"{Data:label}"+""+"
  • ",D);var B=this.panelsElement.data("tabs").panels;this.tabIndexById[D.id]=C;this.headerElement.tabs("option","tabTemplate",E);this.headerElement.tabs("add","#"+this.idPrefix+D.id,D.label,C);if(C>=B.length){A("#"+this.idPrefix+D.id,this.headerElement).remove().appendTo(this.panelsElement);}else{A("#"+this.idPrefix+D.id,this.headerElement).remove().insertBefore(B[C]);}this.headerElement.tabs(A.extend(this.config,{"tabs":this.tabs}));return C;};Echo.UI.Tabs.prototype.updateTabIndexById=function(){var B=this;A.each(this.tabs,function(C,D){B.tabIndexById[D.id]=C;});};Echo.UI.Tabs.prototype.remove=function(B){if(typeof this.tabIndexById[B]=="undefined"){return ;}this.headerElement.tabs("remove",this.tabIndexById[B]);this.tabs.splice(this.tabIndexById[B],1);this.updateTabIndexById();A("#"+this.idPrefix+B,this.panelsElement).remove();delete this.tabIndexById[B];};Echo.UI.Tabs.prototype.addCss=function(){A.addCss(".echo-ui .ui-tabs { position: relative; padding: 0px; border: 0px; }"+".echo-tabs .echo-tabs-panels { background: #ffffff; }"+".echo-ui .ui-tabs .ui-tabs-nav { margin: 0; padding: 0px; }"+".echo-ui .ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 1px; margin: 0 .2em 1px 0; border-bottom: 0 !important; padding: 0; white-space: nowrap; }"+".echo-ui .ui-tabs .ui-tabs-nav li a { float: left; padding: .3em .7em; text-decoration: none; font-size: 12px; font-family: Helvetica,sans-serif; outline: none; }"+".echo-ui .ui-tabs .ui-tabs-nav li.ui-tabs-selected { margin-bottom: 0; padding-bottom: 1px; }"+".echo-ui .ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .echo-ui .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .echo-ui .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; color: #4a4a4a; }"+".echo-ui .ui-tabs .ui-tabs-nav li a, .echo-ui .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; color: #393939; }"+".echo-ui .ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 1.4em; background: none; }"+".echo-ui .ui-tabs .ui-tabs-hide { display: none !important; }"+".echo-ui .echo-tabs-header .ui-state-hover, .echo-ui .echo-tabs-header .ui-state-focus { border: 0px; background: none; color: #212121; }"+".echo-ui .echo-tabs-header .ui-state-default { border: 0px; background: none; font-weight: normal; }"+".echo-ui .echo-tabs-header .ui-state-active { border: 0px; background: #ffffff; font-weight: bold; }"+".echo-ui .ui-tabs .ui-tabs-nav li a span { display: inline-block; padding-left: 22px; }"+(A.browser.opera?".echo-ui .ui-tabs-nav { height: 25px; overflow: hidden; }":"")+Echo.UI.cornersCss("7px",".echo-tabs "),"ui-tabs");if(A.browser.msie){A.addCss(".echo-ui .ui-tabs { zoom: 1; position: static; }","ui-tabs-ie");}};if(!Echo.Localization){Echo.Localization={labels:{}};}Echo.Localization.key=function(B,C){return(C?C+".":"")+B;};Echo.Localization.extend=function(C,B){A.each(C,function(D,E){Echo.Localization.labels[Echo.Localization.key(D,B)]=E;});};Echo.Localization.label=function(C,D,E){var B=Echo.Localization.labels[Echo.Localization.key(C,D)]||C;A.each(E||{},function(F,G){B=B.replace(new RegExp("{"+F+"}","g"),G);});return B;};})(jQuery);(function(A){Echo.Localization.extend({"defaultModeSwitchTitle":"Switch to metadata view","guest":"Guest","today":"Today","yesterday":"Yesterday","lastWeek":"Last Week","lastMonth":"Last Month","secondAgo":"Second Ago","secondsAgo":"Seconds Ago","minuteAgo":"Minute Ago","minutesAgo":"Minutes Ago","hourAgo":"Hour Ago","hoursAgo":"Hours Ago","dayAgo":"Day Ago","daysAgo":"Days Ago","weekAgo":"Week Ago","weeksAgo":"Weeks Ago","metadataModeSwitchTitle":"Return to default view","monthAgo":"Month Ago","monthsAgo":"Months Ago","sharedThisOn":"I shared this on {service}...","userID":"User ID:","userIP":"User IP:","textToggleTruncatedMore":"more","textToggleTruncatedLess":"less","fromLabel":"from","viaLabel":"via","childrenMoreItems":"View more items"},"Item");Echo.Item=function(B){this.vars={};this.textExpanded=false;this.blocked=false;this.controlsOrder=[];this.controls={};this.init(B);};Echo.Item.prototype=new Echo.Object();Echo.Item.prototype.cssPrefix="echo-item-";Echo.Item.prototype.namespace="Item";Echo.Item.prototype.template=function(){var B=this.isChildrenPaginationEnabled()?this.config.get("children.sortOrder")=="chronological"?'
    '+'
    '+''+"
    "+'
    ':'
    '+''+"
    "+'
    '+'
    ':'
    ';return'
    '+'
    '+'
    '+'
    '+"
    "+'
    '+'
    '+'
    '+'
    '+'
    '+'
    '+'
    '+'
    '+'
    '+'
    '+''+'...'+''+"
    "+'
    '+'
    '+"
    "+'"+'"+"
    "+"
    "+'
    '+"
    "+"
    "+'
    '+'
    '+"
    "+B+"
    "; };Echo.Item.prototype.renderers={};Echo.Item.prototype.renderers.authorName=function(B){return this.data.actor.title||this.label("guest");};Echo.Item.prototype.renderers.markers=function(B,C){this.render("extraField",B,C,{"type":"markers"});};Echo.Item.prototype.renderers.tags=function(B,C){this.render("extraField",B,C,{"type":"tags"});};Echo.Item.prototype.renderers.extraField=function(F,H,B){var E=this;var G=(B||{}).type;if(!this.data.object[G]||!this.user.isAdmin()){H.remove(F);return ;}var C=this.config.get("limits."+G);var D=A.foldl([],this.data.object[G],function(K,L){var J=(K.length>C)?'{Data:truncatedItem}':"{Data:item}";var I=A.htmlTextTruncate(K,C,"...");L.push(E.substitute(J,{"item":K,"truncatedItem":I}));});F.prepend(D.sort().join(", "));};Echo.Item.prototype.renderers.container=function(D,F){var C=this;D.removeClass(A.map(["child","root","child-thread","root-thread"],function(G){return"echo-item-container-"+G;}).join(" "));var B=this.threading?"-thread":"";if(this.depth){D.addClass("echo-item-container-child"+B);D.addClass("echo-trinaryBackgroundColor");}else{D.addClass("echo-item-container-root"+B);}D.addClass("echo-item-depth-"+this.depth);var E=function(G){A.map(C.controlsOrder,function(H){if(!C.controls[H].element){return ;}C.controls[H].clickableElements[G+"Class"]("echo-linkColor");});};if(!A.isMobileDevice()){D.unbind(["mouseleave","mouseenter"]).hover(function(){if(C.user.isAdmin()){F.get("modeSwitch").show();}E("add");},function(){if(C.user.isAdmin()){F.get("modeSwitch").hide();}E("remove");});}};Echo.Item.prototype.renderers.metadataUserIP=function(B){if(!this.data.ip){B.hide();}};Echo.Item.prototype.renderers.modeSwitch=function(D){var C=this;D.hide();if(!this.user.isAdmin()){return ;}var E="default";var B=function(F){F.attr("title",C.label(E+"ModeSwitchTitle"));};B(D);D.click(function(){E=(E=="default"?"metadata":"default");B(D);C.dom.get("data").toggle();C.dom.get("metadata").toggle();});if(A.isMobileDevice()){D.show();}};Echo.Item.prototype.renderers.wrapper=function(B){B.addClass("echo-item-wrapper"+(this.depth?"-child":"-root"));};Echo.Item.prototype.renderers.avatar=function(){var C=this;var E=(!this.depth?48:24);var D=this.data.actor.avatar||this.user.get("defaultAvatar");var B=A("",{"src":D}).css({"width":E,"height":E});if(D!=this.user.get("defaultAvatar")){B.one({"error":function(){A(this).attr("src",C.user.get("defaultAvatar"));}});}return B;};Echo.Item.prototype.renderers.childrenContainer=function(D,E,C){var B=this;A.each(D.children(),function(F,G){A(G).detach();});A.map(this.children,function(G){if(C&&C.filter&&!C.filter(G)){return ;}var F=!G.dom;D.append(F?G.render():G.dom.content);if(G.deleted){B.publish("internal.Item.onDelete",{"item":G,"config":C});}else{if(G.added){B.publish("internal.Item.onAdd",{"item":G});}else{if(F&&G instanceof Echo.Item){B.publish("internal.Item.onRender",{"item":G});}}}});};Echo.Item.prototype.renderers.children=function(C,D,B){this.render("childrenContainer",C,D,{"filter":function(E){return !E.byCurrentUser;},"keepChildren":B&&B.keepChildren});};Echo.Item.prototype.renderers.childrenByCurrentActorLive=function(C,D,B){this.render("childrenContainer",C,D,{"filter":function(E){return E.byCurrentUser;},"keepChildren":B&&B.keepChildren});};Echo.Item.prototype.renderers.control=function(C,H,B){if(!B||!B.name){return ;}var D=B.template||'{Data:label}';var F={"label":B.label||"","name":B.name};var G=A(this.substitute(D,F));var E=A(".echo-clickable",G);if(!E.length){E=G;G.addClass("echo-clickable");}E[B.onetime?"one":"bind"]({"click":function(I){I.stopPropagation();if(B.callback){B.callback();}}});if(A.isMobileDevice()){E.addClass("echo-linkColor");}return G;};Echo.Item.prototype.renderers.controlsDelimiter=function(){return A(' \u00b7 ');};Echo.Item.prototype.renderers.controls=function(E){var D=this;this.assembleControls();this.sortControls();var B=E.empty();var C=this.render("controlsDelimiter");A.map(this.controlsOrder,function(F){var G=D.controls[F];if(!G||!G.visible()){return ;}var H=G.dom||D.render("control",undefined,undefined,G);if(H){D.controls[F].element=H;D.controls[F].clickableElements=A(".echo-clickable",H);if(!D.controls[F].clickableElements.length){D.controls[F].clickableElements=H;}B.append(C.clone(true)).append(H);}});};Echo.Item.prototype.renderers.re=function(){if(!this.config.get("reTag")){return ;}var M=this;var D=this.data.object.context;var K="";var J=this.data.object.permalink;var B=this.config.get("limits");var I=this.config.get("openLinksInNewWindow");var L=function(N){var O=A.parseUrl(N);return(O&&O.domain)?O.domain:N;};var E=function(O){var N=B.reTitle;if(!O.title){N=B.reLink;O.title=O.uri.replace(/^https?:\/\/(.*)/ig,"$1");}if(O.title.length>N){O.title=O.title.substring(0,N)+"...";}return"
    "+M.hyperlink({"class":"echo-primaryColor","href":O.uri,"caption":"Re: "+A.stripTags(O.title)},{"openInNewWindow":I})+"
    ";};var G=document.location.href;var H=L(G);if(J==G||this.depth||!D||!D.length){return ;}var C=false;A.each(D,function(N,O){if(O.uri==G){C=true;return false;}});if(C){return ;}if(this.config.get("optimizedContext")){var F=D[0];A.each(D,function(N,O){if(L(O.uri)==H){F=O;return false;}});if(F){K=E(F);}}else{A.each(D,function(N,O){K+=E(O);});}return A(K);};Echo.Item.prototype.renderers.sourceIcon=function(B,C){if(!this.config.get("viaLabel.icon")||this.data.source.name=="jskit"||this.data.source.name=="echo"){C.remove(B);}B.hide().attr("src",A.htmlize(this.data.source.icon||this.config.get("providerIcon"))).show().one("error",function(){C.remove(B);}).wrap(this.hyperlink({"href":this.data.source.uri||this.data.object.permalink},{"openInNewWindow":this.config.get("openLinksInNewWindow")}));};Echo.Item.prototype.renderers.via=function(D,E){var B=this;var C=function(F){return(B.data[F].name||"").toLowerCase();};if(C("source")==C("provider")){return ;}this.render("viaText",D,E,{"label":"via","field":"provider"});};Echo.Item.prototype.renderers.from=function(B,C){this.render("viaText",B,C,{"label":"from","field":"source"});};Echo.Item.prototype.renderers.viaText=function(D,F,B){B=B||{};var E=this.data[B.field];if(!this.config.get("viaLabel.text")||!E.name||E.name=="jskit"||E.name=="echo"){return ;}var C=this.hyperlink({"class":"echo-secondaryColor","href":E.uri||this.data.object.permalink,"caption":E.name},{"openInNewWindow":this.config.get("openLinksInNewWindow")});D.html(" "+this.label(B.label+"Label")+" ").append(C);};Echo.Item.prototype.renderers.textToggleTruncated=function(C){var B=this;C.unbind("click").click(function(){B.textExpanded=!B.textExpanded;B.rerender(["body","textToggleTruncated"]);});return this.label("textToggleTruncated"+(this.textExpanded?"Less":"More"));};Echo.Item.prototype.renderers.body=function(D,V){var Q=this;var J=function(b,a){V.get("text").empty().append(b);V.get("textEllipses")[!a||Q.textExpanded?"hide":"show"]();V.get("textToggleTruncated")[a||Q.textExpanded?"show":"hide"]();};var O=this.data.object.content.replace(//g,"$1");var S=this.data.source.name;var T=this.config.get("openLinksInNewWindow");var M=this.config.get("contentTransformations."+this.data.object.content_type,{});if(S&&S=="Twitter"&&this.config.get("aggressiveSanitization")){J(this.label("sharedThisOn",{"service":S}));return ;}var H=this.config.get("limits");var K=function(a){var c=(a.length>H.tags)?'{Data:truncatedTag}':'{Data:tag}';var b=a.substring(0,H.tags)+"...";return(Q.substitute(c,{"tag":a,"truncatedTag":b}));};if(M.hashtags){O=O.replace(/(#|\uff03)(]*>[^<]*<\/a>)/ig,function(b,a,c){return K(c);});}var E=function(a){if(!M.hashtags){return a;}return a.replace(/(^|[^\w&\/])(?:#|\uff03)([^\s\.,;:'"#@\$%<>!\?\(\)\[\]]+)/ig,function(c,b,d){return b+K(d);});};var P=function(b){var a=[]; b=b.replace(/((]*>)(.*?)(<\/a>))|<.*?>/ig,function(d,c,h,g,f){if(c){var e=P(g);e.text=E(e.text);d=h+R(e)+f;}a.push(d);return" %%HTML_TAG%% ";});return{"text":b,"tags":a};};var R=function(a){A.each(a.tags,function(c,b){a.text=a.text.replace(" %%HTML_TAG%% ",b);});return a.text;};var X="((?:http|ftp|https):\\/\\/(?:[a-z0-9#:\\/\\;\\?\\-\\.\\+,@&=%!\\*\\'(){}\\[\\]$_|^~`](?!gt;|lt;))+)";var W=function(a){return a.replace(/(]*>)(.*?)(<\/a>)/ig,function(c,b,e,d){if(new RegExp("^"+X+"$").test(e)){e=e.length>H.bodyLink?e.substring(0,H.bodyLink)+"...":e;}if(T&&!/\s+target=("[^<>"]*"|'[^<>']*'|\w+)/.test(b)){b=b.replace(/(^]*)(>$)/,'$1 target="_blank"$2');}return b+e+d;});};var U=P(O);if(S&&S!="jskit"&&S!="echo"){var G=this.depth?this.data.target.id:this.config.get("reTag")?this.data.object.permalink||this.data.target.id:undefined;if(G){U.text=U.text.replace(new RegExp(G,"g"),"");if(!/\S/.test(U.text)){J(this.label("sharedThisOn",{"service":S}));return ;}}}var B=U.text=E(U.text);if(M.urls){U.text=U.text.replace(new RegExp(X,"ig"),function(b,a){return Q.hyperlink({"href":a,"caption":a},{"skipEscaping":true,"openInNewWindow":T});});}if(M.smileys){if(U.text!=B){U=P(R(U));}var I=this.initSmileysConfig();if(U.text.match(I.regexps.test)){A.each(I.codes,function(a,b){U.text=U.text.replace(I.regexps[b],I.tag(I.hash[b]));});}}if(M.newlines){U.text=U.text.replace(/\n\n+/g,"\n\n");U.text=U.text.replace(/\n/g," 
    ");}var L=W(R(U));var F=false;if((H.body||H.lines)&&!Q.textExpanded){if(H.lines){var C=M.newlines?"
    ":"\n";var N=L.split(C);if(N.length>H.lines){L=N.splice(0,H.lines).join(C);F=true;}}var Y=H.body&&L.length>H.body?H.body:F?L.length:undefined;var Z=A.htmlTextTruncate(L,Y,"",true);if(Z.length!=L.length){F=true;}L=Z;}J(L,F);};Echo.Item.prototype.renderers.date=function(C){var B=C||this.dom&&this.dom.get("date");this.calcAge();if(B){B.html(this.age);}};Echo.Item.prototype.renderers.expandChildrenLabel=function(D,E,B){if(!this.children.length||!this.hasMoreChildren()){return ;}B=B||{};B.state=B.state||"regular";var C={"loading":{"css":"echo-item-message-loading","label":"loading"},"regular":{"css":"echo-linkColor echo-message-icon","label":"childrenMoreItems"}};D.removeClass(C[B.state=="loading"?"regular":"loading"].css).addClass(C[B.state].css).html(this.label(C[B.state].label));};Echo.Item.prototype.renderers.expandChildren=function(D,E,B){if(!this.children.length){return ;}if(!this.hasMoreChildren()){if(A.browser.msie&&document.compatMode!="CSS1Compat"){D.animate({"height":"1px","marginTop":"hide","marginBottom":"hide","paddingTop":"hide","paddingBottom":"hide"},{"duration":this.config.get("children.moreButtonSlideTimeout"),"complete":function(){D.hide();}});}else{D.slideUp(this.config.get("children.moreButtonSlideTimeout"));}return ;}var C=this;B=B||{};D.css("display","block");D.addClass("echo-item-depth-"+(this.depth+1));D.unbind("click").one("click",function(){C.render("expandChildrenLabel",E.get("expandChildrenLabel"),E,{"state":"loading"});C.publish("internal.Item.onChildrenExpand",{"data":C.data});});};Echo.Item.prototype.isChildrenPaginationEnabled=function(){return !!this.config.get("children.itemsPerPage");};Echo.Item.prototype.hasMoreChildren=function(){return this.data.hasMoreChildren=="true";};Echo.Item.prototype.getNextPageAfter=function(){var C=A.grep(this.children,function(D){return !D.live;});var B=this.config.get("children.sortOrder")=="chronological"?C.length-1:0;return C.length?C[B].data.pageAfter:undefined;};Echo.Item.prototype.initSmileysConfig=function(){if(Echo.Vars.smileys){return Echo.Vars.smileys;}var B=function(E){return E.replace(/([\W])/g,"\\$1");};var C=Echo.Vars.smileys={"codes":[],"regexps":[]};C.hash={":)":{file:"smile.png",title:"Smile"},":-)":{file:"smile.png",title:"Smile"},";)":{file:"wink.png",title:"Wink"},";-)":{file:"wink.png",title:"Wink"},":(":{file:"unhappy.png",title:"Frown"},":-(":{file:"unhappy.png",title:"Frown"},"=-O":{file:"surprised.png",title:"Surprised"},":-D":{file:"grin.png",title:"Laughing"},":-P":{file:"tongue.png",title:"Tongue out"},"=)":{file:"happy.png",title:"Happy"},"B-)":{file:"evilgrin.png",title:"Evil grin"}};var D=[];A.each(C.hash,function(E){var F=B(E);D.push(F);C.codes.push(E);C.regexps[E]=new RegExp(F,"g");});C.regexps.test=new RegExp(D.join("|"));C.tag=function(E){return''+E.title+'';};return C;};Echo.Item.prototype.assembleControls=function(){var C=this;var B=[];A.each(this.config.get("itemControls",{}),function(E,D){A.map(D,function(H){var G=A.isFunction(H)?H.call(C):A.extend({},H);if(!G.name){return ;}var J=G.callback||function(){};G.callback=function(){J.call(C);C.publish("internal.Item.onControlClick",{"name":G.name,"plugin":E,"item":{"data":C.data,"target":C.dom.content}});};G.label=G.label||G.name;G.plugin=E;if(typeof G.visible=="undefined"){G.visible=true;}var I=G.visible;G.visible=function(){return I&&C.config.get("plugins."+E+".enabled");};var F=E+"."+G.name;C.controls[F]=G;if(A.inArray(F,C.controlsOrder)<0){B.push(F);}});});C.controlsOrder=B.concat(C.controlsOrder);};Echo.Item.prototype.sortControls=function(){var C=this;var E=this.controlsOrder;var F=this.config.get("itemControlsOrder");if(!F){this.config.set("itemControlsOrder",E);}else{if(F!=E){var D=function(G,H,I){if(!C.controls[G]){return ;}H.push(G);I=I||A.inArray(G,E);if(I>=0){delete E[I];}};var B=A.foldl([],F,function(G,I){if(/^(.*)\./.test(G)){D(G,I);}else{var H=new RegExp("^"+G+".");A.map(E,function(K,J){if(K&&K.match(H)){D(K,I,J);}});}});this.controlsOrder=B;this.config.set("itemControlsOrder",B);}else{if(!F.length){this.controlsOrder=[];}}}};Echo.Item.prototype.traverse=function(B,E,D){var C=this;A.each(B||[],function(F,G){D=C.traverse(G.children,E,E(G,D));});return D;};Echo.Item.prototype.refreshDate=function(){this.rerender("date");A.map(this.children||[],function(B){B.refreshDate();});};Echo.Item.prototype.calcAge=function(){if(!this.timestamp){return ;}var D=this;var H=new Date(this.timestamp*1000);var E=(new Date()).getTime();var B;var G=Math.floor((E-H.getTime())/1000);var F=Math.floor(G/86400);var C=function(I,J){return I+" "+D.label(J+(I==1?"":"s")+"Ago");};if(isNaN(F)||F<0||F>=365){B=H.toLocaleDateString()+", "+H.toLocaleTimeString();}else{if(G<60){B=C(G,"second");}else{if(G<60*60){G=Math.floor(G/60);B=C(G,"minute");}else{if(G<60*60*24){G=Math.floor(G/(60*60));B=C(G,"hour");}else{if(G<60*60*48){B=this.label("yesterday");}else{if(F<7){B=C(F,"day");}else{if(F<14){B=this.label("lastWeek");}else{if(F<30){G=Math.floor(F/7);B=C(G,"week");}else{if(F<60){B=this.label("lastMonth");}else{if(F<365){G=Math.floor(F/31);B=C(G,"month");}}}}}}}}}}if(this.age!=B){this.age=B;}};Echo.Item.prototype.block=function(C){if(this.blocked){return ;}this.blocked=true;var E=this.dom.get("container");var D=E.width();var B=E.outerHeight();this.blockers={"backdrop":A('
    ').css({"width":D,"height":B}),"message":A(this.substitute('
    {Data:label}
    ',{"label":C})).css({"left":((parseInt(D)-200)/2)+"px","top":((parseInt(B)-20)/2)+"px"})};E.addClass("echo-relative").prepend(this.blockers.backdrop).prepend(this.blockers.message);};Echo.Item.prototype.unblock=function(){if(!this.blocked){return ;}this.blocked=false;this.blockers.backdrop.remove();this.blockers.message.remove();this.dom.get("container").removeClass("echo-relative");};Echo.Item.prototype.getAccumulator=function(B){return this.data.object.accumulators[B];};Echo.Localization.extend({"guest":"Guest","live":"Live","paused":"Paused","more":"More","emptyStream":"No items at this time...","new":"new"},"Stream");Echo.Stream=function(C){if(!C||!C.target){return ;}var B=this;this.vars={"cache":{}};this.initConfig(C,{"aggressiveSanitization":false,"contentTransformations":{"text":["smileys","hashtags","urls","newlines"],"html":["smileys","hashtags","urls","newlines"],"xhtml":["smileys","hashtags","urls"]},"children":{"additionalItemsPerPage":5,"displaySortOrder":"chronological","sortOrder":"reverseChronological","moreButtonSlideTimeout":600,"itemsSlideTimeout":600,"maxDepth":1},"fadeTimeout":2800,"flashColor":"#ffff99","itemControlsOrder":undefined,"itemsPerPage":15,"maxBodyLinkLength":50,"maxBodyCharacters":undefined,"maxBodyLines":undefined,"maxReLinkLength":30,"maxReTitleLength":143,"maxTagLength":16,"maxMarkerLength":16,"openLinksInNewWindow":false,"optimizedContext":true,"providerIcon":"//cdn.echoenabled.com/images/favicons/comments.png","reTag":true,"slideTimeout":700,"sortOrder":"reverseChronological","streamStateLabel":{"icon":true,"text":true},"submissionProxyURL":window.location.protocol+"//apps.echoenabled.com/v2/esp/activity","streamStateToggleBy":"mouseover","viaLabel":{"icon":false,"text":false}},this.assembleConfigNormalizer()); this.initVars();this.initApplication(function(){B.addCss();B.config.get("target").empty().append(B.render());B.recalcEffectsTimeouts();B.initLiveUpdates(function(){return{"endpoint":"search","query":{"q":B.constructSearchQuery(),"since":B.nextSince||0}};},function(D){B.handleLiveUpdatesResponse(D);});if(B.config.get("data")){B.handleInitialResponse(B.config.get("data"),function(D){B.lastRequest={"initial":true,"data":D};B.render("body");});}else{B.initialItemsRequest();}B.listenEvents();B.publish("Stream.onRender",B.prepareBroadcastParams());});};Echo.Stream.prototype=new Echo.Application();Echo.Stream.prototype.namespace="Stream";Echo.Stream.prototype.cssPrefix="echo-stream-";Echo.Stream.prototype.template='
    '+'
    '+'
    '+'
    '+"
    "+'
    '+'
    '+'"+"
    ";Echo.Stream.prototype.renderers={};Echo.Stream.prototype.renderers.body=function(C){var B=this;C=C||this.dom.get("body");if(!this.lastRequest){this.showMessage({"type":"loading","message":this.label(this.isErrorWithTimer(this.error)?"retrying":this.isWaitingForData(this.error)?"error_"+this.error.errorCode:"loading")},C);return ;}if(this.lastRequest.data.length){if(this.lastRequest.initial){C.empty();}this.appendRootItems(this.lastRequest.data,C);}else{this.showMessage({"type":"empty","message":this.label("emptyStream")},C);}if(this.lastRequest.initial&&this.config.get("streamStateToggleBy")=="mouseover"&&this.config.get("liveUpdates")){C.bind({"mouseleave":function(){B.setStreamState("live");},"mouseenter":function(){B.setStreamState("paused");}});}this.publish("Stream.onReady",this.prepareBroadcastParams({"initial":this.lastRequest.initial}));};Echo.Stream.prototype.renderers.state=function(E){var B=this;var C=this.config.get("streamStateLabel");if((!C.icon&&!C.text)||!this.config.get("liveUpdates")){return ;}var G=0;if(this.activities.state=="paused"){G=A.foldl(0,B.activities.queue,function(H,I){if(H.affectCounter){return ++I;}});}var F=this.activities.state+G;if(F==this.activities.lastState){return ;}E=(E||this.dom.get("state")).empty();if(!this.activities.lastState&&this.config.get("streamStateToggleBy")=="button"){E.addClass("echo-linkColor echo-clickable").click(function(H){B.setStreamState(B.activities.state=="paused"?"live":"paused");});}var D={"picture":'',"message":this.config.get("streamStateToggleBy")=="button"?'{Label:'+this.activities.state+"}":'{Label:'+this.activities.state+"}","count":' ({Data:count} {Label:new})'};if(C.icon){E.append(D.picture);}if(C.text){E.append(this.substitute(D.message));if(G&&this.activities.state=="paused"){E.append(this.substitute(D.count,{"count":G}));}}this.activities.lastState=F;};Echo.Stream.prototype.renderers.more=function(C,D){var B=this;if(this.isViewComplete||!this.threads.length){C.empty().hide();return ;}C.empty().append(this.label("more")).bind({"mouseenter":function(){C.addClass("echo-stream-more-hover");},"mouseleave":function(){C.removeClass("echo-stream-more-hover");}}).show().unbind("click").one("click",function(){B.publish("Stream.onMoreButtonPress",B.prepareBroadcastParams());C.html(B.label("loading"));B.moreRequestItems(C);});};Echo.Stream.prototype.initVars=function(){this.activities={"queue":[],"state":this.config.get("liveUpdates")?"live":"paused","lastState":"","animations":0};this.hasInitialData=false;this.items={};this.threads=[];this.cleanupErrorHandlers();};Echo.Stream.prototype.actualizeChildrenList=function(D,B){var C=this;return A.map(B,function(F){F.targets=A.map(F.targets,function(G){G.conversationID=D.conversation;return G;});F=C.normalizeEntry(F);var E=C.items[F.unique];if(E&&E.byCurrentUser){C.applyStructureUpdates("delete",E);}return F;});};Echo.Stream.prototype.createChildrenItemsDomWrapper=function(C,D){var B=this;var F=A("
    ");var E=function(G){return B.getItemListIndex(G,D.children);};A.each(C,function(G,H){H.render();var I=G>0&&E(C[G-1]))(.*)$/);var J=E[1];var G=E[2].match(/^'([0-9]+) seconds ago'$/); var F=G?function(){return Math.floor((new Date()).getTime()/1000)-G[1];}:function(){return E[2];};var H;if(J=="<"){H=function(K){return K"){H=function(K){return K>F();};}}return H;};var B=A.foldl([],["before","after"],function(E,G){if(!D[E]){return ;}var F=C(D[E]);if(F){G.push(F);}});return{"timeframe":B};};Echo.Stream.prototype.assembleConfigNormalizer=function(){var B=this;var E=function(F){return F<0?0:F;};var D={"contentTransformations":function(F){A.each(F,function(H,G){F[H]=A.foldl({},G||[],function(I,J){J[I]=true;});});return F;},"safeHTML":function(F){return"off"!=F;},"streamStateToggleBy":function(F){if(F=="mouseover"&&A.isMobileDevice()){return"button";}return F;},"fadeTimeout":E,"slideTimeout":E};var C={"body":"maxBodyCharacters","lines":"maxBodyLines","reLink":"maxReLinkLength","reTitle":"maxReTitleLength","bodyLink":"maxBodyLinkLength","tags":"maxTagLength","markers":"maxMarkerLength"};A.each(C,function(G,F){D[F]=function(H){this.set("limits."+G,H);return H;};});return D;};Echo.Stream.prototype.getRespectiveAccumulator=function(D,C){var B={"likesDescending":"likesCount","flagsDescending":"flagsCount","repliesDescending":"repliesCount"};return D.getAccumulator(B[C]);};Echo.Stream.prototype.appendRootItems=function(D,B){var C=this;var E=document.createDocumentFragment();A.each(D||[],function(F,G){E.appendChild(G.render().get(0));C.publish("Stream.Item.onRender",C.prepareBroadcastParams({"item":{"data":G.data,"target":G.dom.content}}));});B.append(E);this.rerender("more");};Echo.Stream.prototype.prepareBroadcastParams=function(B){B=B||{};B.target=this.config.get("target").get(0);B.query=this.config.get("query");if(B.item&&B.item.target){B.item.target=B.item.target.get(0);}return B;};Echo.Stream.prototype.constructSearchQuery=function(B){var C=B&&B["pageAfter"]&&"pageAfter:"+B["pageAfter"]||"";return[this.config.get("query",""),C].join(" ");};Echo.Stream.prototype.constructChildrenSearchQuery=function(D){var F=this.config.get("children.maxDepth")-D.depth-1;F=(F<0)?1:F;var E=parseInt(this.config.get("children.additionalItemsPerPage"));var C=D.getNextPageAfter();var B=this.config.get("children.filter");var G=!B||B=="()"?"":B+" ";return G+A.foldl("",{"childrenof":D.data.object.id,"children":F,"childrenItemsPerPage":F?parseInt(this.config.get("children.itemsPerPage")):0,"itemsPerPage":E,"sortOrder":this.config.get("children.sortOrder"),"childrenSortOrder":this.config.get("children.sortOrder"),"pageAfter":C?'"'+(C||0)+'"':undefined},function(J,I,H){return I+=(typeof J!="undefined"?H+":"+J+" ":"");})+G;};Echo.Stream.prototype.requestItems=function(B,D){var C=this;this.sendAPIRequest({"endpoint":"search","query":{"q":this.constructSearchQuery(B)}},function(E){C.handleInitialResponse(E,D);});};Echo.Stream.prototype.handleInitialResponse=function(H,F){var D=this,C=[],B=[];var G=this.lastRequest&&!this.lastRequest.initial;H=H||{};if(H.result=="error"){this.handleErrorResponse(H,{"messageTarget":G?D.dom.get("more"):D.dom.get("body"),"waitingHandler":function(){if(G){D.moreRequestItems();}else{D.refresh();}}});return ;}this.cleanupErrorHandlers(true);this.config.get("target").show();this.changeLiveUpdatesTimeout(H);this.nextSince=H.nextSince||0;this.nextPageAfter=H.nextPageAfter;this.config.extend(this.extractPresentationConfig(H));H.children.itemsPerPage=+H.children.itemsPerPage;this.config.set("children",this.config.combine(H.children,this.config.get("children")));this.config.extend(this.extractTimeframeConfig(H));var E=this.config.get("sortOrder");H.entries=H.entries||[];this.publish("Stream.onDataReceive",D.prepareBroadcastParams({"entries":H.entries,"initial":!this.hasInitialData}));A.each(H.entries,function(I,K){K=D.normalizeEntry(K);var J=D.initItem(K);D.applyStructureUpdates("add",J);if(D.isRootItem(J)){D.addItemToList(B,J,E);}});this.hasInitialData=true;this.isViewComplete=B.length!=this.config.get("itemsPerPage");F(B);this.startLiveUpdates();};Echo.Stream.prototype.checkTimeframeSatisfy=function(){var C=this;var B=this.config.get("timeframe");var D=A.foldl([],this.threads,function(E,G){var F=A.foldl(true,B,function(I,H){return H?I(E.timestamp):false;});if(!F){G.push(E);}});A.map(D,function(E){C.applySpotUpdates("delete",E);});};Echo.Stream.prototype.handleLiveUpdatesResponse=function(C){var B=this;C=C||{};if(C.result=="error"){this.startLiveUpdates();return ;}this.nextSince=C.nextSince||0;this.refreshItemsDate();this.checkTimeframeSatisfy();this.applyLiveUpdates(C.entries);this.render("state");this.executeNextActivity();this.startLiveUpdates();};Echo.Stream.prototype.applyLiveUpdates=function(B){var C=this;A.each(B||[],function(D,G){G=C.normalizeEntry(G);var F=C.items[G.unique];var H=C.classifyAction(G);if(!F&&H!="post"){return ;}switch(H){case"post":if(F){C.applySpotUpdates("replace",C.updateItem(G));}else{F=C.initItem(G,true);var E=C.isRootItem(F)?C.withinVisibleFrame(F):C.withinVisibleChildrenFrame(F);if(!E&&!C.isRootItem(F)&&C.user.hasIdentity(F.data.actor.id)){F.byCurrentUser=true;}if(E||F.byCurrentUser){C.publish("Stream.Item.onReceive",C.prepareBroadcastParams({"item":{"data":F.data}}));C.applySpotUpdates("add",F);}else{delete C.items[G.unique];}}break;case"delete":C.applySpotUpdates("delete",F);break;}});this.recalcEffectsTimeouts();};Echo.Stream.prototype.recalcEffectsTimeouts=function(){var D=this;var F={"fade":D.config.get("fadeTimeout"),"slide":D.config.get("slideTimeout")};D.timeouts=D.timeouts||{"fade":F.fade,"slide":F.slide};if(F.fade==0&&F.slide==0){return ;}D.timeouts.coeff=D.timeouts.coeff||{"fade":D.timeouts.fade/(F.fade+F.slide),"slide":D.timeouts.slide/(F.fade+F.slide)};var B=function(H,G){G=Math.round(G*D.timeouts.coeff[H]);if(G<100){return 0;}if(G>F[H]){return F[H];}return G;};var E=D.config.get("liveUpdatesTimeout")*1000*0.8;var C=D.activities.queue.length?E/D.activities.queue.length:E;D.timeouts.fade=B("fade",C);D.timeouts.slide=B("slide",C);};Echo.Stream.prototype.refreshItemsDate=function(){A.map(this.threads,function(B){B.refreshDate();});};Echo.Stream.prototype.executeNextActivity=function(){var B=this.activities;if(B.animations>0||!B.queue.length||this.config.get("liveUpdates")&&B.state=="paused"&&B.queue[0].action!="replace"&&!B.queue[0].byCurrentUser){return ;}B.queue.shift().handler();};Echo.Stream.prototype.applySpotUpdates=function(F,E,C){var B=this;C=C||{};var D=function(I){switch(I){case"add":var L=B.items[E.data.unique];if(L&&L.dom&&C.priority!="high"){B.applySpotUpdates("replace",E,{"priority":"highest"});return ;}B.applyStructureUpdates(I,E);E.added=true;if(B.isRootItem(E)){B.placeRootItem(E);}else{var N=B.getParentItem(E);if(N&&N.dom){N.rerender(["container","children","childrenByCurrentActorLive"]);}}B.executeNextActivity();break;case"replace":E.unblock();if(B.maybeMoveItem(E)){var N=B.getParentItem(E);var K=B.config.get(N?"children.sortOrder":"sortOrder");var H=N?N.children:B.threads;var J=B.getItemListIndex(E,H);var G=A.extend([],H);G.splice(J,1);var M=B.getItemProjectedIndex(E,G,K);if(J!=M){B.applySpotUpdates("delete",E,{"keepChildren":true,"priority":"high"});B.applySpotUpdates("add",E,{"priority":"high"});}}if(E&&E.dom){E.rerender("container",true);}B.executeNextActivity();break;case"delete":E.deleted=true;if(B.isRootItem(E)){B.publish("internal.Item.onDelete",{"item":E,"config":C});B.applyStructureUpdates(I,E,C);}else{var N=B.getParentItem(E);if(N){N.render("children",N.dom.get("children"),N.dom,C);if(B.isChildrenPaginationEnabled()){N.render("childrenByCurrentActorLive",N.dom.get("childrenByCurrentActorLive"),N.dom,C);}B.applyStructureUpdates(I,E,C);N.rerender("container");}}B.executeNextActivity();break;}};this.queueActivity({"action":F,"itemUnique":E.data.unique,"actorID":E.data.actor.id,"priority":C.priority,"handler":function(){D(F);}});};Echo.Stream.prototype.queueActivity=function(F){var D=this.items[F.itemUnique];if(!D){return ;}var C=D.blocked||F.actorID&&this.user.hasIdentity(F.actorID);var B=this.getActivityProjectedIndex(C,F);var E={"action":F.action,"type":F.type||"","affectCounter":F.action=="add","itemUnique":F.itemUnique,"priority":F.priority,"byCurrentUser":C,"handler":function(){F.handler(); }};if(typeof B!="undefined"){this.activities.queue.splice(B,0,E);}else{this.activities.queue.push(E);}};Echo.Stream.prototype.getActivityProjectedIndex=function(C,E){var D={"highest":0,"high":10,"medium":20,"low":30,"lowest":40};E.priority=E.priority=="highest"&&"highest"||C&&"high"||E.action=="replace"&&"medium"||E.priority||"lowest";var B;if(E.action=="replace"){A.each(this.activities.queue,function(F,G){if(G.action=="add"&&G.itemUnique==E.itemUnique){E.priority=G.priority;return false;}});}A.each(this.activities.queue,function(F,G){if(D[E.priority]B.timestamp;case"reverseChronological":return D.timestamp<=B.timestamp;case"likesDescending":case"repliesDescending":case"flagsDescending":var C=function(G){return E.getRespectiveAccumulator(G,F);};return(C(D)1){var F=this.getItemListIndex(E,this.threads);var B=this.threads[F+1],C=this.threads[F-1];if(B){B.dom.content.before(D);}else{C.dom.content.after(D);}}else{this.dom.get("body").empty().append(D);}this.publish("internal.Item.onAdd",{"item":E});};Echo.Stream.prototype.placeChildrenItems=function(G,E,C){var D=this;var B=this.createChildrenItemsDomWrapper(E,G);var I=-1;A.each(G.children,function(K,J){if(D.isItemInList(J.data,C)){I=K-1;return false;}});var F=I>=0?G.children[I].dom.content:G.dom.get("children");var H=I>=0?"insertAfter":this.config.get("children.sortOrder")!="chronological"?"prependTo":"appendTo";B[H](A(F));G.rerender("childrenByCurrentActorLive");B.css("height",B.show().css("height")).hide().animate({"height":"show","marginTop":"show","marginBottom":"show","paddingTop":"show","paddingBottom":"show"},{"duration":this.config.get("children.itemsSlideTimeout"),"complete":function(){B.css("height","");G.rerender(["expandChildren","expandChildrenLabel"]);B.children().unwrap();}});};Echo.Stream.prototype.getItemListIndex=function(D,C){var B=-1;A.each(C||[],function(E,F){if(F==D||(F.unique&&D.unique&&F.unique==D.unique)){B=E;return false;}});return B;};Echo.Stream.prototype.isItemInList=function(C,B){return this.getItemListIndex(C,B)>=0;};Echo.Stream.prototype.isChildrenPaginationEnabled=function(){return !!this.config.get("children.itemsPerPage");};Echo.Stream.prototype.initItem=function(E,F){var B=this;var D=new Echo.Item({"children":[],"config":new Echo.Config(this.config.getAsHash()),"conversation":E.target.conversationID,"data":E,"depth":0,"id":E.object.id,"live":F,"threading":false,"timestamp":A.timestampFromW3CDTF(E.object.published),"user":this.user});var C=D.template;D.template=function(){if(!B.vars.cache.itemTemplate){B.vars.cache.itemTemplate=A.isFunction(C)?C.apply(this,arguments):C;}return B.vars.cache.itemTemplate;};this.items[D.data.unique]=D;return D;};Echo.Stream.prototype.updateItem=function(E){var D=this.items[E.unique];var B=this.config.get(this.isRootItem(D)?"sortOrder":"children.sortOrder");var C=B.match(/replies|likes|flags/);var F=C&&this.getRespectiveAccumulator(D,B);if(D.data.object.published!=E.object.published){D.timestamp=A.timestampFromW3CDTF(E.object.published);D.forceInject=true;}A.extend(D.data,E);if(C){if(this.getRespectiveAccumulator(D,B)!=F){D.forceInject=true;}}return D;};Echo.Stream.prototype.getItemProjectedIndex=function(F,C,E){var B=this;var D;if(F.live||F.forceInject){A.each(C||[],function(G,H){if(B.compareItems(H,F,E)){D=G;return false;}});}return typeof D!="undefined"?D:C.length;};Echo.Stream.prototype.addItemToList=function(B,D,C){B.splice(this.getItemProjectedIndex(D,B,C),0,D);delete D.forceInject;this.items[D.data.unique]=D;};Echo.Stream.prototype.applyStructureUpdates=function(G,F,D){var C=this;D=D||{};switch(G){case"add":if(!this.isRootItem(F)){var E=this.getParentItem(F);if(!E){delete this.items[F.data.unique];return ;}F.depth=E.depth+1;if(!this.isChildrenPaginationEnabled()&&F.depth>1){F.depth=1;F.data.parentUnique=E.data.parentUnique;F.data.target.id=E.data.target.id;F.forceInject=true;this.applyStructureUpdates("add",F);return ;}E.threading=true;F.forceInject=true;this.addItemToList(E.children,F,this.isChildrenPaginationEnabled()?this.config.get("children.displaySortOrder"):this.config.get("children.sortOrder"));}else{this.addItemToList(this.threads,F,this.config.get("sortOrder"));}break;case"delete":var B=null;if(this.isRootItem(F)){B=this.threads;}else{B=this.items[F.data.parentUnique].children;if(B.length==1){var E=this.getParentItem(F);if(E){E.threading=false;}}}B.splice(this.getItemListIndex(F,B),1);if(!D.keepChildren){F.traverse(F.children,function(H){delete C.items[H.data.unique];});delete F.children;}delete this.items[F.data.unique];break;}};Echo.Stream.prototype.normalizeEntry=function(C){if(C.normalized){return C;}var B=this;C.normalized=true;A.each(C.targets||[],function(D,E){if((E.id==E.conversationID)||(E.id==C.object.id)||(B.items[E.id+E.conversationID])){C.target=E;}});C.object.content_type=C.object.content_type||"text";C.object.accumulators=C.object.accumulators||{};C.object.accumulators.repliesCount=parseInt(C.object.accumulators.repliesCount||"0");C.object.accumulators.flagsCount=parseInt(C.object.accumulators.flagsCount||"0");C.object.accumulators.likesCount=parseInt(C.object.accumulators.likesCount||"0"); C.object.context=C.object.context||[];C.object.flags=C.object.flags||[];C.object.likes=C.object.likes||[];C.target=C.target||C.targets[0]||{};C.target.conversationID=C.target.conversationID||C.object.id;C.source=C.source||{};C.provider=C.provider||{};C.unique=C.object.id+C.target.conversationID;C.parentUnique=C.target.id+C.target.conversationID;return C;};Echo.Stream.prototype.addCss=function(){var C=this;A.addCss(".echo-stream-message-wrapper { padding: 15px 0px; text-align: center; -moz-border-radius: 0.5em; -webkit-border-radius: 0.5em; border: 1px solid #E4E4E4; }"+".echo-stream-message-empty, .echo-stream-message-loading, .echo-stream-message-error { display: inline-block; height: 16px; padding-left: 21px; background: no-repeat left center; }"+".echo-stream-message-empty { background-image: url(//cdn.echoenabled.com/images/information.png); }"+".echo-stream-message-loading { background-image: url(//cdn.echoenabled.com/images/loading.gif); }"+".echo-stream-message-error { background-image: url(//cdn.echoenabled.com/images/warning.gif); }"+".echo-stream-header { margin: 10px 0px 10px 20px; }"+".echo-stream-state { float: right; }"+".echo-stream-state-picture { display: inline-block; height: 9px; width: 8px; }"+'.echo-stream-state-picture-paused { background: url("//cdn.echoenabled.com/images/control_pause.png") no-repeat center center; }'+'.echo-stream-state-picture-live { background: url("//cdn.echoenabled.com/images/control_play.png") no-repeat center center; }'+".echo-stream-state-message { margin-left: 5px; text-decoration: none; }"+".echo-clickable a.echo-stream-state-message:hover { text-decoration: underline; }"+".echo-stream-brand { text-align: right; display: none; }"+".echo-stream-brand-message { display: inline-block; height: 17px; line-height: 17px; border: none; padding-right: 48px; background: url(//cdn.echoenabled.com/images/echo-brand.png) no-repeat right; font-size: 10px; font-family: Arial; }"+".echo-stream-container a.echo-stream-brand-link { text-decoration: none; color: #666666; } "+".echo-stream-more-hover { background-color: #E4E4E4; }"+".echo-stream-more { text-align: center; border: solid 1px #E4E4E4; margin-top: 10px; padding: 10px; -moz-border-radius: 0.5em; -webkit-border-radius: 0.5em; cursor: pointer; font-weight: bold; }"+".echo-stream-more .echo-application-message { padding: 0; border: none; border-radius: 0; }","stream");A.addCss(".echo-item-content { word-wrap: break-word; }"+".echo-item-container-root { padding: 10px 0px; }"+".echo-item-container-root-thread { padding: 10px 0px 0px 0px; }"+".echo-item-container-child { padding: 10px; margin: 0px 20px 2px 0px; }"+".echo-item-container-child-thread { padding: 10px; margin: 0px 20px 2px 0px; }"+".echo-item-avatar-wrapper { margin-right: -58px; float: left; position: relative; }"+".echo-item-children .echo-item-avatar-wrapper, .echo-item-childrenByCurrentActorLive .echo-item-avatar-wrapper { margin-right: -34px; }"+".echo-item-children .echo-item-subwrapper, .echo-item-childrenByCurrentActorLive .echo-item-subwrapper { margin-left: 34px; }"+".echo-item-wrapper { float: left; width: 100%; }"+".echo-item-subwrapper { margin-left: 58px; }"+".echo-item-subcontainer { float: left; width: 100%; }"+".echo-item-markers { line-height: 16px; background: url(//cdn.echoenabled.com/images/curation/metadata/marker.png) no-repeat; padding: 0px 0px 4px 21px; margin-top: 7px; }"+".echo-item-tags { line-height: 16px; background: url(//cdn.echoenabled.com/images/tag_blue.png) no-repeat; padding: 0px 0px 4px 21px; }"+".echo-item-metadata { display: none; }"+".echo-item-metadata-title { font-weight: bold; line-height: 25px; height: 25px; margin-right: 5px; }"+".echo-item-metadata-icon { display: inline-block; padding-left: 26px; }"+"div.echo-item-metadata-userID { border-bottom: 1px solid #e1e1e1; border-top: 1px solid #e1e1e1;}"+'span.echo-item-metadata-userID { background: url("//cdn.echoenabled.com/images/curation/metadata/user.png") no-repeat left center; }'+".echo-item-metadata-userIP { border-bottom: 1px solid #e1e1e1; }"+'.echo-item-metadata-userIP .echo-item-metadata-icon { background: url("//cdn.echoenabled.com/images/curation/metadata/computer.png") no-repeat left center; }'+'.echo-item-modeSwitch { float: right; width: 16px; height: 16px; background:url("//cdn.echoenabled.com/images/curation/metadata/flip.png") no-repeat 0px 3px; }'+".echo-item-childrenMarker { border-color: transparent transparent #ECEFF5; border-width: 0px 11px 11px; border-style: solid; margin: 3px 0px 0px 77px; height: 1px; width: 0px; display: none; }"+".echo-item-container-root-thread .echo-item-childrenMarker { display: block; }"+".echo-item-avatar { width: 48px; height: 48px; }"+".echo-item-children .echo-item-avatar, .echo-item-childrenByCurrentActorLive .echo-item-avatar { width: 24px; height: 24px; }"+".echo-item-authorName { float: left; font-size: 15px; font-family: Arial, sans-serif; font-weight: bold; }"+".echo-item-re { font-weight: bold; }"+".echo-item-re a:link, .echo-item-re a:visited, .echo-item-re a:active { text-decoration: none; }"+".echo-item-re a:hover { text-decoration: underline; }"+".echo-item-body { padding-top: 4px; }"+".echo-item-controls { float: left; margin-left: 3px; }"+".echo-item-sourceIcon { float: left; height: 16px; width: 16px; margin-right: 5px; border: 0px; }"+".echo-item-date, .echo-item-from, .echo-item-via { float: left; }"+".echo-item-from a, .echo-item-via a { text-decoration: none; color: #C6C6C6; }"+".echo-item-from a:hover, .echo-item-via a:hover { color: #476CB8; }"+'.echo-item-tag { display: inline-block; height: 16px; background: url("//cdn.echoenabled.com/images/tag_blue.png") no-repeat; padding-left: 18px; }'+".echo-item-smiley-icon { border: 0px; }"+".echo-item-textToggleTruncated { margin-left: 5px; }"+".echo-item-blocker-backdrop { position: absolute; left: 0px; top: 0px; background: #FFFFFF; opacity: 0.7; z-index: 100; }"+".echo-item-blocker-message { position: absolute; z-index: 200; width: 200px; height: 20px; line-height: 20px; text-align: center; background-color: #FFFF99; border: 1px solid #C6C677; opacity: 0.7; -moz-border-radius: 0.5em 0.5em 0.5em 0.5em; }"+".echo-item-expandChildren { display:none; text-align: center; padding:4px; }"+".echo-item-expandChildren .echo-item-expandChildrenLabel { display: inline-block; padding-left: 22px; }"+'.echo-item-expandChildren .echo-message-icon { background: url("//cdn.echoenabled.com/images/whirlpool.png") no-repeat 5px 4px; }'+".echo-item-expandChildren .echo-item-message-loading { background: no-repeat left top url(//cdn.echoenabled.com/images/loading.gif); }"+".echo-item-expandChildren .echo-application-message { padding: 0; border:none; border-radius: 0; }","item");var B=[];for(var D=0;D<=20;D++){B.push(".echo-item-depth-"+D+" { margin-left: "+(D?68+(D-1)*44:0)+"px; }");}A.addCss(B.join("\n"),"item-depths");if(A.browser.msie){A.addCss(".echo-item-childrenMarker { font-size: 1px; line-height: 1px; filter: chroma(color=black); }"+".echo-item-blocker-backdrop, .echo-item-blocker-message { filter:Alpha(Opacity=70); }"+".echo-stream-container { zoom: 1; }"+".echo-item-content { zoom: 1; }"+".echo-item-container { zoom: 1; }"+".echo-item-subwrapper { zoom: 1; }"+".echo-item-avatar-wrapper { position: static; }"+".echo-stream-state-picture { vertical-align: middle; }","stream-ie");}};})(jQuery);(function(A){Echo.Localization.extend({"you":"You"},"UserListItem");Echo.UserListItem=function(B){this.vars={};this.init(B);this.addCss();};Echo.UserListItem.prototype=new Echo.Object();Echo.UserListItem.prototype.namespace="UserListItem";Echo.UserListItem.prototype.cssPrefix="echo-user-list-item-";Echo.UserListItem.prototype.renderers={};Echo.UserListItem.prototype.template=''+''+'{Data:title}'+"";Echo.UserListItem.prototype.renderers.avatar=function(D,E){var B=this;var C=this.data.avatar||this.user.get("defaultAvatar"); if(this.config.get("userLabel.avatar")){D.attr("src",C);if(C!=this.user.get("defaultAvatar")){D.one({"error":function(){A(this).attr("src",B.user.get("defaultAvatar"));}});}if(!this.config.get("userLabel.text")){D.attr("title",this.data.title);}}else{E.remove(D);}};Echo.UserListItem.prototype.renderers.title=function(B,C){if(this.config.get("userLabel.text")){return this.isYou()?this.label("you"):this.data.title;}else{C.remove(B);}};Echo.UserListItem.prototype.isYou=function(){return this.data.id&&this.data.id==this.user.get("id");};Echo.UserListItem.prototype.addCss=function(){A.addCss(".echo-user-list-item-avatar { width: 16px; height: 16px; margin: 0px 3px 0px 0px; vertical-align: text-top; }"+".echo-user-list-only-avatars .echo-user-list-item-avatar { margin: 0px 2px; }"+".echo-user-list-item-container, .echo-user-list-item-container span { white-space: nowrap; }"+".echo-user-list-only-avatars .echo-user-list-item-container { white-space: normal; }","user-list-item");};Echo.Localization.extend({"and":"and","more":"more"},"UserList");Echo.UserList=function(C){if(!C||!C.target){return ;}var B=this;this.vars={};this.initVars();this.initConfig(C,{"checkViewTimeout":2,"initialUsersCount":undefined,"totalUsersCount":undefined,"query":"","suffixText":"","userLabel":{"avatar":true,"text":true}});this.messageLayout="compact";this.initApplication(function(){B.addCss();B.config.get("target").empty().append(B.render());if(B.config.get("query")){B.showMessage({"type":"loading"},B.dom.get("container"));B.initLiveUpdates(function(){return{"endpoint":"search","query":{"q":B.config.get("query"),"since":B.nextSince||0}};},function(E){B.handleLiveUpdatesResponse(E);});B.request();}else{if(B.config.get("data")){var D=B.config.get("data");D.itemsPerPage=D.itemsPerPage||2;B.config.set("liveUpdates",false);B.handleInitialResponse(D);}}});};Echo.UserList.prototype=new Echo.Application();Echo.UserList.prototype.namespace="UserList";Echo.UserList.prototype.cssPrefix="echo-user-list-";Echo.UserList.prototype.template=''+''+''+''+"";Echo.UserList.prototype.renderers={};Echo.UserList.prototype.renderers.more=function(E){var D=this;if(!this.isMoreButtonVisible()){E.hide();return ;}E.empty().show();var F=this.count.total-this.count.visible;var C=(F>0?F+" ":"")+this.label("more");var B=!this.fromExternalData()||this.count.visible"+L+"";};A.map(this.users.slice(0,this.count.visible),function(J){I.push(J.instance.render());});var B=this.config.get("userLabel.text")?", ":"";var G;if(!this.isMoreButtonVisible()){G=I.pop();}if(I.length){I=B?A.intersperse(I,E(B,"delimiter")):I;I.push(E(" "+this.label("and")+" ","and"));}if(!this.isMoreButtonVisible()){I.push(G);}A.map(I,function(J){D.append(J);});};Echo.UserList.prototype.renderers.suffixText=function(){return this.config.get("suffixText","");};Echo.UserList.prototype.initVars=function(){this.users=[];this.uniqueUsers={};this.isViewComplete=false;delete this.nextPageAfter;this.count={"total":0,"visible":0};this.cleanupErrorHandlers();};Echo.UserList.prototype.isMoreButtonVisible=function(){return !this.fromExternalData()&&!this.isViewComplete||this.count.visiblethis.users.length){this.count.visible=this.users.length;}this.rerender();}else{if(!this.moreRequestInProgress){this.showMessage({"type":"loading"},this.dom.get("more"));this.moreRequestInProgress=true;}this.request();}};Echo.UserList.prototype.request=function(){var B=this;var C=this.config.get("query");if(typeof this.nextPageAfter!="undefined"){C='pageAfter:"'+this.nextPageAfter+'" '+C;}this.sendAPIRequest({"endpoint":"search","query":{"q":C}},function(D){B.changeLiveUpdatesTimeout(D);B.handleInitialResponse(D);});};Echo.UserList.prototype.handleInitialResponse=function(B){if(B.result=="error"){this.handleErrorResponse(B);return ;}this.cleanupErrorHandlers(true);if(B.itemsPerPage&&B.itemsPerPage!=this.config.get("itemsPerPage")){this.config.set("itemsPerPage",+B.itemsPerPage);}if(this.fromExternalData()){this.count.total=this.config.get("totalUsersCount",0);}this.nextSince=B.nextSince||0;this.nextPageAfter=B.nextPageAfter||0;if(!B.entries.length){if(!this.isViewComplete){this.isViewComplete=true;this.rerender();}this.startLiveUpdates();return ;}if(!this.count.visible){if(this.fromExternalData()){this.count.visible=this.config.get("initialUsersCount",this.config.get("itemsPerPage"));}else{this.count.visible=this.config.get("itemsPerPage");}}this.processResponse(B);};Echo.UserList.prototype.handleLiveUpdatesResponse=function(C){var B=this;if(C.result=="error"){this.startLiveUpdates();return ;}this.nextSince=C.nextSince||0;if(!C.entries.length){this.startLiveUpdates();return ;}this.processResponse(C,true);};Echo.UserList.prototype.processResponse=function(F,E){var C=this;var D=new Echo.Config(this.config.getAsHash());var B=false;var G=false;A.each(F.entries,function(K,M){var L=(M.verbs&&M.verbs[0]=="http://activitystrea.ms/schema/1.0/delete");var I=C.uniqueUsers[M.actor.id];if(L&&!I){return ;}if(L){if(!--I.itemsCount){var J;A.each(C.users,function(O,N){if(N.instance.data.id==M.actor.id){J=O;return false;}});C.users.splice(J,1);delete C.uniqueUsers[M.actor.id];G=true;}}else{if(I){I.itemsCount++;}else{var H=new Echo.UserListItem({"data":M.actor,"user":C.user,"config":D});I={"itemsCount":1,"instance":H};C.users[H.isYou()?"unshift":"push"](I);C.uniqueUsers[M.actor.id]=I;B=true;}}});if(this.fromExternalData()){this.count.total=Math.max(this.users.length,this.count.total);}else{this.count.total=this.count.visible=this.users.length;}this.count.visible=Math.min(this.count.visible,this.users.length);if(!this.count.total){this.isViewComplete=false;}if(B||G){this.rerender();}if(E||B){this.startLiveUpdates();}else{this.getMoreUsers();}};Echo.UserList.prototype.refresh=function(){this.stopLiveUpdates();this.initVars();this.rerender();if(this.config.get("query")){this.request();}else{if(this.config.get("data")){this.handleInitialResponse(this.config.get("data"));}}};Echo.UserList.prototype.getVisibleUsersCount=function(){return this.count.visible;};Echo.UserList.prototype.addCss=function(){A.addCss(".echo-user-list-container { line-height: 20px; vertical-align: middle; }"+".echo-user-list-more { white-space: nowrap; }"+".echo-user-list-more .echo-application-message-icon { display: inline; margin: 0px 5px; }","user-list");};})(jQuery);(function(A){Echo.Localization.extend({"createdBy":"Created by","markers":"Markers:","markersHint":"Marker1, marker2, marker3, ...","on":"on","post":"Post","posting":"Posting...","postingFailed":'There was a server error while trying to submit your item. Please try again in a few minutes. Error: "{error}".',"postingTimeout":"There was a network issue while trying to submit your item. Please try again in a few minutes.","tagsHint":"Tag1, tag2, tag3, ...","tags":"Tags:","update":"Update","updating":"Updating...","yourName":"Your Name (required)","yourWebsiteOptional":"Your website (optional)"},"Submit");Echo.Submit=function(C){if(!C||!C.target){return ; }var B=this;this.vars={};this.initConfig(C,{"targetURL":document.location.href,"submissionProxyURL":window.location.protocol+"//apps.echoenabled.com/v2/esp/activity","markers":[],"source":{},"tags":[],"requestMethod":"GET","mode":"standard","data":{},"inReplyTo":{},"itemURIPattern":undefined,"actionString":"Type your comment here...","postingTimeout":30,"errorWindow":{"width":390,"minHeight":70,"maxHeight":150},"targetQuery":undefined});this.initialMode=this.config.get("mode");this.initApplication(function(){B.contextId=B.config.get("contextId",B.newContextId());B.addCss();B.config.get("target").empty().append(B.render());B.listenEvents();B.publish("Submit.onRender",B.prepareBroadcastParams());});};Echo.Submit.prototype=new Echo.Application();Echo.Submit.prototype.namespace="Submit";Echo.Submit.prototype.cssPrefix="echo-submit-";Echo.Submit.prototype.template=function(){return this.templates[this.config.get("mode")];};Echo.Submit.prototype.templates={};Echo.Submit.prototype.templates.standard='
    '+'
    '+'
    '+'
    '+''+"
    "+'"+'"+"
    "+'
    '+'
    '+''+"
    "+'
    '+"
    "+"
    ";Echo.Submit.prototype.templates.edit=Echo.Submit.prototype.templates.standard;Echo.Submit.prototype.templates.compact='
    '+'
    '+''+"
    "+"
    ";Echo.Submit.prototype.renderers={};Echo.Submit.prototype.renderers.container=function(B){if(this.initialMode=="compact"){B.click(function(C){C.stopPropagation();});}};Echo.Submit.prototype.renderers.tagsContainer=Echo.Submit.prototype.renderers.markersContainer=function(B,C){if(this.user.isAdmin()){B.show();}else{B.hide();}};Echo.Submit.prototype.renderers.metaFields=function(C,F,B){var D=B.type;var E=this.config.get("data.object."+D,this.config.get(D,[]));F.get(D).iHint({"text":this.label(D+"Hint"),"className":"echo-secondaryColor"}).val(A.trim(A.stripTags(E.join(", ")))).blur();};Echo.Submit.prototype.renderers.markers=function(B,C){this.render("metaFields",B,C,{"type":"markers"});};Echo.Submit.prototype.renderers.tags=function(B,C){this.render("metaFields",B,C,{"type":"tags"});};Echo.Submit.prototype.renderers.editModeUserInfo=function(C,G){var E='
    '+"{Label:createdBy} "+'{Data:author} '+"{Label:on} {Data:date}"+"
    ";var D={};var F=this.config.get("data.object.published");var B=new Date(A.timestampFromW3CDTF(F)*1000);return A.toDOM(this.substitute(E,{"date":B.toLocaleDateString()+", "+B.toLocaleTimeString(),"author":this.config.get("data.actor.title",this.label("guest"))}),this.cssPrefix,{}).content;};Echo.Submit.prototype.renderers.anonymousModeUserInfo=function(C,G){var B=this;var F="echo-submit-anonymousUserInfo";var E='
    '+'
    '+'
    '+'
    '+'
    '+''+"
    "+'
    '+''+"
    "+"
    "+"
    "+'
    '+"
    ";var D={"Avatar":function(I){var H=B.user.get("avatar",B.user.get("defaultAvatar"));I.append('');},"Name":function(H){G.set("anonymousUserInfoName",H);H.val(B.user.get("name","")).iHint({"text":B.label("yourName"),"className":"echo-secondaryColor"});},"Url":function(H){G.set("anonymousUserInfoUrl",H);H.val(B.user.get("domain","")).iHint({"text":B.label("yourWebsiteOptional"),"className":"echo-secondaryColor"});}};var E=this.substitute(E,{"prefix":F});return A.toDOM(E,F,D).content;};Echo.Submit.prototype.renderers.header=function(B,D){var C=this.config.get("mode")=="edit"?"edit":"anonymous";return this.render(C+"ModeUserInfo",B,D);};Echo.Submit.prototype.renderers.text=function(C){var B=this,D=this.config.get("data.object.content");if(D){C.val(D);}C.iHint({"text":B.config.get("actionString"),"className":"echo-secondaryColor"});if(this.config.get("mode")=="compact"){C.focus(function(){B.config.set("mode","standard");B.rerender();setTimeout(function(){B.dom.get("text").focus();},0);B.publish("Submit.onExpand",B.prepareBroadcastParams());});}};Echo.Submit.prototype.renderers.postButton=function(E){var C=this,F=this.config.get("mode")=="edit";var D=new Echo.UI.Button(E,{"normal":{"icons":false,"disabled":false,"label":C.label(F?"update":"post")},"posting":{"icons":{"primary":"ui-icon-waiting"},"disabled":true,"label":C.label(F?"updating":"posting")}});C.posting=C.posting||{};C.posting.subscriptions=C.posting.subscriptions||[];var B=function(G,I,H){A.each(["Post","Edit"],function(L,J){var K="Submit.on"+J+G;var M=C.posting.subscriptions;if(M[K]){C.unsubscribe(K,M[K]);}M[K]=C.subscribe(K,function(N,O){if(C.config.get("target").get(0)!=O.target){return ;}D.setState(I);if(H){H();}});});};B("Init","posting");B("Complete","normal",function(){C.dom.get("text").val("").trigger("blur");C.rerender(["tagsContainer","markersContainer"]);});B("Error","normal");this.posting.action=this.posting.action||function(){var G=false;A.each(["anonymousUserInfoName","text"],function(I,H){G=C.highlightMandatory(C.dom.get(H));return !G;});if(G){return ;}C.post();};E.unbind("click",this.posting.action).bind("click",this.posting.action);};Echo.Submit.prototype.post=function(){var K=this,F=this.config.get("mode")=="edit";var D=function(L){return K.dom.get(L);};var C=function(L,M){var N=F?"Edit":"Post";K.publish("Submit.on"+N+L,K.prepareBroadcastParams({"postData":M}));};var E;if(F){E=[].concat(K.getContentUpdate(D("text").val()),K.getMetaDataUpdates("tag","tags",D("tags").val()),K.getMetaDataUpdates("mark","markers",D("markers").val()));if(!E.length){C("Complete",[]);return ;}}else{E={"avatar":K.user.get("avatar",""),"content":D("text").val(),"markers":A.trim(D("markers").val()),"name":K.user.get("name",(K.user.logged()?"":D("anonymousUserInfoName").val())),"source":K.config.get("source"),"tags":A.trim(D("tags").val()),"target":K.config.get("targetURL"),"url":K.user.get("domain",(K.user.logged()?"":D("anonymousUserInfoUrl").val())),"verb":"post"};if(K.config.get("type")){E.type=K.config.get("type");}if(K.config.get("itemURIPattern")){E.itemURIPattern=K.config.get("itemURIPattern");}}var B;var J=false;var I=function(R){if(B){clearTimeout(B);}R=R||{};if(R.result=="error"){if(J){return ;}var N=J=(R.errorCode=="network_timeout");var Q=N?K.label("postingTimeout"):K.label("postingFailed",{"error":R.errorMessage||R.errorCode}); var P=K.config.get("errorWindow");var O='
    {Data:message}
    ';var M=A.toDOM(K.substitute(O,{"message":Q}));M.content.css({"width":P.width,"position":"absolute","visibility":"hidden"}).appendTo(D("container"));var S=M.content.height();var L=SP.maxHeight?P.maxHeight:S);M.get("echo-submit-error",true).height(L);A.fancybox({"content":M.get("echo-submit-error",true),"height":L,"width":P.width,"padding":15,"orig":D("text"),"autoDimensions":false,"transitionIn":"elastic","transitionOut":"elastic","onComplete":function(){M.content.remove();if(A.browser.msie&&document.compatMode!="CSS1Compat"){var T=arguments[2];var U=2*T.padding+50;A("#fancybox-wrap").css({"width":A("#fancybox-wrap").width()+U,"height":A("#fancybox-wrap").height()+U});}}});C("Error",R);}else{if(R.objectID){E.objectID=R.objectID;}C("Complete",E);}};C("Init",E);var H={"appkey":K.config.get("appkey"),"content":A.object2JSON(E),"sessionID":K.user.get("sessionID","")};if(K.config.get("targetQuery")){H["target-query"]=K.config.get("targetQuery");}if(this.config.get("requestMethod").toLowerCase()=="post"){A.sendPostRequest(this.config.get("submissionProxyURL"),H,I);}else{A.ajax({"type":"GET","url":this.config.get("submissionProxyURL"),"data":H,"success":I,"error":function(L){if(L.status==200&&L.statusText=="success"){I;}else{I({"result":"error","errorCode":"internal_error"});}},"dataType":"jsonp"});var G=this.config.get("postingTimeout");if(G){B=setTimeout(function(){I({"result":"error","errorCode":"network_timeout"});},G*1000);}}};Echo.Submit.prototype.highlightMandatory=function(B){if(B&&!A.trim(B.val())){B.parent().addClass("echo-submit-mandatory");B.focus(function(){A(this).parent().removeClass("echo-submit-mandatory");});return true;}return false;};Echo.Submit.prototype.prepareBroadcastParams=function(B){B=B||{};B.data=this.config.get("data");B.target=this.config.get("target").get(0);B.targetURL=this.config.get("targetURL");B.inReplyTo=this.config.get("inReplyTo");return B;};Echo.Submit.prototype.getContentUpdate=function(B){if(this.config.get("data.object.content","")==B){return[];}return[{"verb":"update","field":"content","value":B,"target":this.config.get("data.object.id")}];};Echo.Submit.prototype.getMetaDataUpdates=function(I,D,F){var C=this;var E=function(J){return A.map(J||[],function(K){return A.trim(K);});};var B={"modified":E(F.split(",")),"current":E(this.config.get("data.object."+D,""))};var H=[];var G=function(K,J,L){A.map(K,function(M){if(M&&A.inArray(M,J)==-1){var N={"verb":L,"target":C.config.get("data.object.id")};N[D]=M;H.push(N);}});};G(B.current,B.modified,"un"+I);G(B.modified,B.current,I);return H;};Echo.Submit.prototype.switchMode=function(C){if(!C){C=(this.config.get("mode")=="standard"?"compact":"standard");}if(this.config.get("mode")!=C){this.config.set("mode",C);this.rerender();var B="Submit.on"+(C=="compact"?"Collapse":"Expand");this.publish(B,this.prepareBroadcastParams());}};Echo.Submit.prototype.refresh=function(){this.rerender(["container","header","markersContainer","tagsContainer","postButton"]);this.publish("Submit.onRerender",this.prepareBroadcastParams());};Echo.Submit.prototype.listenEvents=function(){var B=this;this.subscribe("internal.User.onInvalidate",function(){B.refresh();});if(this.initialMode=="compact"){Echo.Broadcast.subscribe("document.onclick",function(){if(B.dom&&B.dom.get("text").val()){return ;}B.switchMode("compact");});if(!Echo.Vars.onClickRegistered){A(document).click(function(){Echo.Broadcast.publish("document.onclick");});Echo.Vars.onClickRegistered=true;}}};Echo.Submit.prototype.addCss=function(){A.addCss(".echo-submit-header { margin-bottom: 3px; }"+".echo-submit-anonymousUserInfoAvatar { float: left; margin-right: -48px; }"+".echo-submit-anonymousUserInfoAvatar img { width: 48px; height: 48px; }"+".echo-submit-anonymousUserInfoFields { width: 100%; float: left; }"+".echo-submit-anonymousUserInfoFields input { width: 100%; }"+".echo-submit-anonymousUserInfoFieldsWrapper { margin-left: 53px; }"+".echo-submit-anonymousUserInfoNameContainer { margin: 1px 0px 4px 0px; padding: 0px 2px 1px 3px; background-color: #fff; }"+".echo-submit-anonymousUserInfoName { font-size: 14px; font-weight: bold; border: none; }"+".echo-submit-anonymousUserInfoUrlContainer { padding: 0px 2px 1px 3px; background-color: #fff; }"+".echo-submit-anonymousUserInfoUrl { height: 19px; border: none; }"+".echo-submit-author { font-weight: bold; }"+".echo-submit-content { padding: 5px 5px 5px 6px; background-color: #fff; }"+".echo-submit-text-area { width: 100%; height: 102px; padding: 0px; margin: 0px; border: none; resize:none ; }"+".echo-submit-text-input { width: 100%; border: none; }"+".echo-submit-metadata-container { margin-top: 6px; }"+".echo-submit-metadata-label { float: left; width: 50px; margin-right: -50px; text-align: right; line-height: 22px; }"+".echo-submit-metadata-wrapper { float: left; width: 100%; }"+".echo-submit-metadata-subwrapper { margin-left: 55px; padding: 2px 2px 2px 3px; background-color: #fff; }"+".echo-submit-metadata-subwrapper input { width: 100%; border: none; }"+".echo-submit-controls { margin-top: 5px; }"+".echo-submit-post-container { float: right; }"+".echo-submit-border { border: 1px solid #d2d2d2; }"+".echo-submit-mandatory { border: 1px solid red; }"+".echo-submit-queries-view-option { padding-right: 5px; }"+".echo-submit-error { color: #444444; font: 14px Arial; line-height: 150%; padding-left: 85px; background: no-repeat url(//cdn.echoenabled.com/images/info70.png); }","submit");if(A.browser.msie){A.addCss(".echo-submit-container { zoom: 1; }"+".echo-submit-body { zoom: 1; }"+".echo-submit-header { zoom: 1; }"+".echo-submit-content { zoom: 1; }"+".echo-submit-markersContainer { zoom: 1; }"+".echo-submit-tagsContainer { zoom: 1; }","submit-ie");}if(A.browser.webkit){A.addCss(".echo-submit-container input, .echo-submit-container textarea { background-position: 0px; }"+".echo-submit-text-area { outline: none; }"+".echo-submit-anonymousUserInfoName { outline: none; }"+".echo-submit-anonymousUserInfoUrl { outline: none; }"+".echo-submit-metadata-subwrapper input { outline: none; }","submit-webkit");}};})(jQuery);(function(A){Echo.Counter=function(C){if(!C||!C.target){return ;}var B=this;this.vars={};this.data={};this.initConfig(C,{"debug":false});this.messageLayout="compact";this.initApplication(function(){B.contextId=B.newContextId();B.showMessage({"type":"loading"});B.initLiveUpdates(function(){return{"endpoint":"count","query":{"q":B.config.get("query","")}};},function(D){B.handleResponse(D);});if(B.config.get("data")){B.handleResponse(B.config.get("data"));}else{B.request();}B.listenEvents();});};Echo.Counter.prototype=new Echo.Application();Echo.Counter.prototype.namespace="Counter";Echo.Counter.prototype.request=function(){var B=this;this.sendAPIRequest({"endpoint":"count","query":{"q":B.config.get("query","")}},function(C){B.handleResponse(C);});};Echo.Counter.prototype.refresh=function(){this.stopLiveUpdates();this.data={};this.showMessage({"type":"loading"});this.request();};Echo.Counter.prototype.listenEvents=function(){var B=this;A.map(["Submit.onPostComplete","Submit.onEditComplete"],function(C){Echo.Broadcast.subscribe(C,function(){B.startLiveUpdates(true);});});};Echo.Counter.prototype.handleResponse=function(C){var B=this;var D=this.config.get("target");C=C||{};if(C.result=="error"&&C.errorCode!="more_than"){this.handleErrorResponse(C);return ;}this.cleanupErrorHandlers(true);D.show();D.html(C.errorCode=="more_than"?(C.errorMessage+"+"):C.count);if(A.isEmptyObject(this.data)||this.data.count!=C.count){this.publish("Counter.onUpdate",{"data":C,"query":this.config.get("query",""),"target":this.config.get("target").get(0)});}this.data=C;this.startLiveUpdates();};})(jQuery);window.Backplane=window.Backplane||{"channelByBus":{},"config":{},"initialized":false,"subscribers":{},"awaiting":{"since":0,"until":0,"queue":[]},"intervals":{"min":1,"frequent":5,"regular":60,"slowdown":120}}; Backplane.init=function(A){A=A||{};if(this.initialized||!A.serverBaseURL||!A.busName){return false;}this.initialized=true;this.timers={};this.config=A;this.channelByBus=this.getCookieChannels();this.config.customChannelName=A.channelName;this.config.channelName=this.getChannelName();this.config.serverBaseURL=this.normalizeURL(A.serverBaseURL);this.config.channelID=this.generateChannelID();this.request();return true;};Backplane.subscribe=function(B){if(!this.initialized){return false;}var A=(new Date()).valueOf()+Math.random();this.subscribers[A]=B;return A;};Backplane.unsubscribe=function(A){if(!this.initialized||!A){return false;}delete this.subscribers[A];};Backplane.getChannelID=function(){if(!this.initialized){return false;}return this.config.channelID;};Backplane.expectMessages=function(A){this.expectMessagesWithin(60,A);};Backplane.expectMessagesWithin=function(A,B){if(!this.initialized||!A){return false;}this.awaiting.since=this.getTS();this.awaiting.interval=A;this.awaiting.nonstop=!B;if(B){B=typeof B=="string"?[B]:B;this.awaiting.queue.push(B);}var C=this.awaiting.since+A;if(C>this.awaiting.until){this.awaiting.until=C;}this.request();};Backplane.generateChannelID=function(){return this.config.serverBaseURL+"/bus/"+this.config.busName+"/channel/"+this.config.channelName;};Backplane.getChannelName=function(){if(!this.initialized){return false;}if(this.config.customChannelName){return this.config.customChannelName;}if(!this.channelByBus[this.config.busName]){this.channelByBus[this.config.busName]=(new Date()).valueOf().toString()+Math.random().toString().substr(2,5);this.setCookieChannels();}return this.channelByBus[this.config.busName];};Backplane.getTS=function(){return Math.round((new Date()).valueOf()/1000);};Backplane.getCookieChannels=function(){var C=(document.cookie||"").match(/backplane-channel=(.*?)(?:$|;)/);if(!C||!C[1]){return{};}var B={};var E=C[1].split("|");for(var D=0;D0){return true;}C[B]=1;D=(C[B]>0);C[B]=0;return D;},isOverAxis:function(D,B,C){return(D>B)&&(D<(B+C));},isOver:function(C,G,D,E,B,F){return A.ui.isOverAxis(C,D,B)&&A.ui.isOverAxis(G,E,F);},keyCode:{BACKSPACE:8,CAPS_LOCK:20,COMMA:188,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38}};A.fn.extend({_focus:A.fn.focus,focus:function(B,C){return typeof B==="number"?this.each(function(){var D=this;setTimeout(function(){A(D).focus();(C&&C.call(D));},B);}):this._focus.apply(this,arguments);},enableSelection:function(){return this.attr("unselectable","off").css("MozUserSelect","").unbind("selectstart.ui");},disableSelection:function(){return this.attr("unselectable","on").css("MozUserSelect","none").bind("selectstart.ui",function(){return false;});},scrollParent:function(){var B;if((A.browser.msie&&(/(static|relative)/).test(this.css("position")))||(/absolute/).test(this.css("position"))){B=this.parents().filter(function(){return(/(relative|absolute|fixed)/).test(A.curCSS(this,"position",1))&&(/(auto|scroll)/).test(A.curCSS(this,"overflow",1)+A.curCSS(this,"overflow-y",1)+A.curCSS(this,"overflow-x",1));}).eq(0);}else{B=this.parents().filter(function(){return(/(auto|scroll)/).test(A.curCSS(this,"overflow",1)+A.curCSS(this,"overflow-y",1)+A.curCSS(this,"overflow-x",1));}).eq(0);}return(/fixed/).test(this.css("position"))||!B.length?A(document):B;},zIndex:function(C){if(C!==undefined){return this.css("zIndex",C);}if(this.length){var E=A(this[0]),B,D;while(E.length&&E[0]!==document){B=E.css("position");if(B=="absolute"||B=="relative"||B=="fixed"){D=parseInt(E.css("zIndex"));if(!isNaN(D)&&D!=0){return D;}}E=E.parent();}}return 0;}});A.extend(A.expr[":"],{data:function(C,D,B){return !!A.data(C,B[3]);},focusable:function(D){var C=D.nodeName.toLowerCase(),B=A.attr(D,"tabindex");return(/input|select|textarea|button|object/.test(C)?!D.disabled:"a"==C||"area"==C?D.href||!isNaN(B):!isNaN(B))&&!A(D)["area"==C?"parents":"closest"](":hidden").length;},tabbable:function(C){var B=A.attr(C,"tabindex");return(isNaN(B)||B>=0)&&A(C).is(":focusable");}});})(jQuery);jQuery.effects||(function(D){D.effects={};D.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","color","outlineColor"],function(K,L){D.fx.step[L]=function(M){if(!M.colorInit){M.start=A(M.elem,L); M.end=B(M.end);M.colorInit=true;}M.elem.style[L]="rgb("+Math.max(Math.min(parseInt((M.pos*(M.end[0]-M.start[0]))+M.start[0],10),255),0)+","+Math.max(Math.min(parseInt((M.pos*(M.end[1]-M.start[1]))+M.start[1],10),255),0)+","+Math.max(Math.min(parseInt((M.pos*(M.end[2]-M.start[2]))+M.start[2],10),255),0)+")";};});function B(K){var L;if(K&&K.constructor==Array&&K.length==3){return K;}if(L=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(K)){return[parseInt(L[1],10),parseInt(L[2],10),parseInt(L[3],10)];}if(L=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(K)){return[parseFloat(L[1])*2.55,parseFloat(L[2])*2.55,parseFloat(L[3])*2.55];}if(L=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(K)){return[parseInt(L[1],16),parseInt(L[2],16),parseInt(L[3],16)];}if(L=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(K)){return[parseInt(L[1]+L[1],16),parseInt(L[2]+L[2],16),parseInt(L[3]+L[3],16)];}if(L=/rgba\(0, 0, 0, 0\)/.exec(K)){return J.transparent;}return J[D.trim(K).toLowerCase()];}function A(K,M){var L;do{L=D.curCSS(K,M);if(L!=""&&L!="transparent"||D.nodeName(K,"body")){break;}M="backgroundColor";}while(K=K.parentNode);return B(L);}var J={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]};var F=["add","remove","toggle"],H={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};function E(){var O=document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle,N={},L,K;if(O&&O.length&&O[0]&&O[O[0]]){var M=O.length;while(M--){L=O[M];if(typeof O[L]=="string"){K=L.replace(/\-(\w)/g,function(Q,P){return P.toUpperCase();});N[K]=O[L];}}}else{for(L in O){if(typeof O[L]==="string"){N[L]=O[L];}}}return N;}function I(L){var M,K;for(M in L){K=L[M];if(K==null||D.isFunction(K)||M in H||(/scrollbar/).test(M)||(!(/color/i).test(M)&&isNaN(parseFloat(K)))){delete L[M];}}return L;}function C(M,K){var N={_:0},L;for(L in K){if(M[L]!=K[L]){N[L]=K[L];}}return N;}D.effects.animateClass=function(M,L,N,K){if(D.isFunction(N)){K=N;N=null;}return this.each(function(){var P=D(this),S=P.attr("style")||" ",O=I(E.call(this)),Q,R=P.attr("className");D.each(F,function(U,T){if(M[T]){P[T+"Class"](M[T]);}});Q=I(E.call(this));P.attr("className",R);P.animate(C(O,Q),L,N,function(){D.each(F,function(U,T){if(M[T]){P[T+"Class"](M[T]);}});if(typeof P.attr("style")=="object"){P.attr("style").cssText="";P.attr("style").cssText=S;}else{P.attr("style",S);}if(K){K.apply(this,arguments);}});});};D.fn.extend({_addClass:D.fn.addClass,addClass:function(L,M,N,K){return M?D.effects.animateClass.apply(this,[{add:L},M,N,K]):this._addClass(L);},_removeClass:D.fn.removeClass,removeClass:function(L,M,N,K){return M?D.effects.animateClass.apply(this,[{remove:L},M,N,K]):this._removeClass(L);},_toggleClass:D.fn.toggleClass,toggleClass:function(K,L,M,N,O){if(typeof L=="boolean"||L===undefined){if(!M){return this._toggleClass(K,L);}else{return D.effects.animateClass.apply(this,[(L?{add:K}:{remove:K}),M,N,O]);}}else{return D.effects.animateClass.apply(this,[{toggle:K},L,M,N]);}},switchClass:function(M,K,L,N,O){return D.effects.animateClass.apply(this,[{add:K,remove:M},L,N,O]);}});D.extend(D.effects,{version:"1.8",save:function(L,K){for(var M=0;M
    ").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0});M.wrap(K);K=M.parent();if(M.css("position")=="static"){K.css({position:"relative"});M.css({position:"relative"});}else{D.extend(L,{position:M.css("position"),zIndex:M.css("z-index")});D.each(["top","left","bottom","right"],function(O,N){L[N]=M.css(N);if(isNaN(parseInt(L[N],10))){L[N]="auto";}});M.css({position:"relative",top:0,left:0});}return K.css(L).show();},removeWrapper:function(K){if(K.parent().is(".ui-effects-wrapper")){return K.parent().replaceWith(K);}return K;},setTransition:function(L,N,M,K){K=K||{};D.each(N,function(O,P){unit=L.cssUnit(P);if(unit[0]>0){K[P]=unit[0]*M+unit[1];}});return K;}});function G(L,M,K,N){if(typeof L=="object"){N=M;K=null;M=L;L=M.effect;}if(D.isFunction(M)){N=M;K=null;M={};}if(D.isFunction(K)){N=K;K=null;}if(typeof M=="number"||D.fx.speeds[M]){N=K;K=M;M={};}M=M||{};K=K||M.duration;K=D.fx.off?0:typeof K=="number"?K:D.fx.speeds[K]||D.fx.speeds._default;N=N||M.complete;return[L,M,K,N];}D.fn.extend({effect:function(Q,K,O,N){var L=G.apply(this,arguments),P={options:L[1],duration:L[2],callback:L[3]},M=D.effects[Q];return M&&!D.fx.off?M.call(this,P):this;},_show:D.fn.show,show:function(K){if(!K||typeof K=="number"||D.fx.speeds[K]){return this._show.apply(this,arguments);}else{var L=G.apply(this,arguments);L[1].mode="show";return this.effect.apply(this,L);}},_hide:D.fn.hide,hide:function(K){if(!K||typeof K=="number"||D.fx.speeds[K]){return this._hide.apply(this,arguments);}else{var L=G.apply(this,arguments);L[1].mode="hide";return this.effect.apply(this,L);}},__toggle:D.fn.toggle,toggle:function(K){if(!K||typeof K=="number"||D.fx.speeds[K]||typeof K=="boolean"||D.isFunction(K)){return this.__toggle.apply(this,arguments);}else{var L=G.apply(this,arguments);L[1].mode="toggle";return this.effect.apply(this,L);}},cssUnit:function(M){var L=this.css(M),K=[];D.each(["em","px","%","pt"],function(O,N){if(L.indexOf(N)>0){K=[parseFloat(L),N];}});return K;}});D.easing.jswing=D.easing.swing;D.extend(D.easing,{def:"easeOutQuad",swing:function(L,K,M,N,O){return D.easing[D.easing.def](L,K,M,N,O);},easeInQuad:function(L,K,M,N,O){return N*(K/=O)*K+M;},easeOutQuad:function(L,K,M,N,O){return -N*(K/=O)*(K-2)+M;},easeInOutQuad:function(L,K,M,N,O){if((K/=O/2)<1){return N/2*K*K+M;}return -N/2*((--K)*(K-2)-1)+M;},easeInCubic:function(L,K,M,N,O){return N*(K/=O)*K*K+M;},easeOutCubic:function(L,K,M,N,O){return N*((K=K/O-1)*K*K+1)+M;},easeInOutCubic:function(L,K,M,N,O){if((K/=O/2)<1){return N/2*K*K*K+M;}return N/2*((K-=2)*K*K+2)+M;},easeInQuart:function(L,K,M,N,O){return N*(K/=O)*K*K*K+M;},easeOutQuart:function(L,K,M,N,O){return -N*((K=K/O-1)*K*K*K-1)+M;},easeInOutQuart:function(L,K,M,N,O){if((K/=O/2)<1){return N/2*K*K*K*K+M;}return -N/2*((K-=2)*K*K*K-2)+M;},easeInQuint:function(L,K,M,N,O){return N*(K/=O)*K*K*K*K+M;},easeOutQuint:function(L,K,M,N,O){return N*((K=K/O-1)*K*K*K*K+1)+M;},easeInOutQuint:function(L,K,M,N,O){if((K/=O/2)<1){return N/2*K*K*K*K*K+M;}return N/2*((K-=2)*K*K*K*K+2)+M;},easeInSine:function(L,K,M,N,O){return -N*Math.cos(K/O*(Math.PI/2))+N+M;},easeOutSine:function(L,K,M,N,O){return N*Math.sin(K/O*(Math.PI/2))+M; },easeInOutSine:function(L,K,M,N,O){return -N/2*(Math.cos(Math.PI*K/O)-1)+M;},easeInExpo:function(L,K,M,N,O){return(K==0)?M:N*Math.pow(2,10*(K/O-1))+M;},easeOutExpo:function(L,K,M,N,O){return(K==O)?M+N:N*(-Math.pow(2,-10*K/O)+1)+M;},easeInOutExpo:function(L,K,M,N,O){if(K==0){return M;}if(K==O){return M+N;}if((K/=O/2)<1){return N/2*Math.pow(2,10*(K-1))+M;}return N/2*(-Math.pow(2,-10*--K)+2)+M;},easeInCirc:function(L,K,M,N,O){return -N*(Math.sqrt(1-(K/=O)*K)-1)+M;},easeOutCirc:function(L,K,M,N,O){return N*Math.sqrt(1-(K=K/O-1)*K)+M;},easeInOutCirc:function(L,K,M,N,O){if((K/=O/2)<1){return -N/2*(Math.sqrt(1-K*K)-1)+M;}return N/2*(Math.sqrt(1-(K-=2)*K)+1)+M;},easeInElastic:function(L,R,M,N,O){var Q=1.70158;var P=0;var K=N;if(R==0){return M;}if((R/=O)==1){return M+N;}if(!P){P=O*0.3;}if(K=this.options.distance;},_mouseDelayMet:function(){return this.mouseDelayMet; },_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true;}});})(jQuery);(function(E){E.ui=E.ui||{};var A=/left|center|right/,D=/top|center|bottom/,C=E.fn.position,B=E.fn.offset;E.fn.position=function(G){if(!G||!G.of){return C.apply(this,arguments);}G=E.extend({},G);var F=E(G.of),L=(G.collision||"flip").split(" "),K=G.offset?G.offset.split(" "):[0,0],J,I,H;if(G.of.nodeType===9){J=F.width();I=F.height();H={top:0,left:0};}else{if(G.of.scrollTo&&G.of.document){J=F.width();I=F.height();H={top:F.scrollTop(),left:F.scrollLeft()};}else{if(G.of.preventDefault){G.at="left top";J=I=0;H={top:G.of.pageY,left:G.of.pageX};}else{J=F.outerWidth();I=F.outerHeight();H=F.offset();}}}E.each(["my","at"],function(){var M=(G[this]||"").split(" ");if(M.length===1){M=A.test(M[0])?M.concat(["center"]):D.test(M[0])?["center"].concat(M):["center","center"];}M[0]=A.test(M[0])?M[0]:"center";M[1]=D.test(M[1])?M[1]:"center";G[this]=M;});if(L.length===1){L[1]=L[0];}K[0]=parseInt(K[0],10)||0;if(K.length===1){K[1]=K[0];}K[1]=parseInt(K[1],10)||0;if(G.at[0]==="right"){H.left+=J;}else{if(G.at[0]==="center"){H.left+=J/2;}}if(G.at[1]==="bottom"){H.top+=I;}else{if(G.at[1]==="center"){H.top+=I/2;}}H.left+=K[0];H.top+=K[1];return this.each(function(){var P=E(this),N=P.outerWidth(),M=P.outerHeight(),O=E.extend({},H);if(G.my[0]==="right"){O.left-=N;}else{if(G.my[0]==="center"){O.left-=N/2;}}if(G.my[1]==="bottom"){O.top-=M;}else{if(G.my[1]==="center"){O.top-=M/2;}}O.left=parseInt(O.left);O.top=parseInt(O.top);E.each(["left","top"],function(R,Q){E.ui.position[L[R]]&&E.ui.position[L[R]][Q](O,{targetWidth:J,targetHeight:I,elemWidth:N,elemHeight:M,offset:K,my:G.my,at:G.at});});E.fn.bgiframe&&P.bgiframe();P.offset(E.extend(O,{using:G.using}));});};E.ui.position={fit:{left:function(G,F){var H=E(window);F=G.left+F.elemWidth-H.width()-H.scrollLeft();G.left=F>0?G.left-F:Math.max(0,G.left);},top:function(G,F){var H=E(window);F=G.top+F.elemHeight-H.height()-H.scrollTop();G.top=F>0?G.top-F:Math.max(0,G.top);}},flip:{left:function(G,F){if(F.at[0]!=="center"){var J=E(window);J=G.left+F.elemWidth-J.width()-J.scrollLeft();var I=F.my[0]==="left"?-F.elemWidth:F.my[0]==="right"?F.elemWidth:0,H=-2*F.offset[0];G.left+=G.left<0?I+F.targetWidth+H:J>0?I-F.targetWidth+H:0;}},top:function(G,F){if(F.at[1]!=="center"){var K=E(window);K=G.top+F.elemHeight-K.height()-K.scrollTop();var J=F.my[1]==="top"?-F.elemHeight:F.my[1]==="bottom"?F.elemHeight:0,I=F.at[1]==="top"?F.targetHeight:-F.targetHeight,H=-2*F.offset[1];G.top+=G.top<0?J+F.targetHeight+H:K>0?J+I+H:0;}}}};if(!E.offset.setOffset){E.offset.setOffset=function(G,F){if(/static/.test(E.curCSS(G,"position"))){G.style.position="relative";}var K=E(G),J=K.offset(),I=parseInt(E.curCSS(G,"top",true),10)||0,H=parseInt(E.curCSS(G,"left",true),10)||0;J={top:F.top-J.top+I,left:F.left-J.left+H};"using" in F?F.using.call(G,J):K.css(J);};E.fn.offset=function(G){var F=this[0];if(!F||!F.ownerDocument){return null;}if(G){return this.each(function(){E.offset.setOffset(this,G);});}return B.call(this);};}})(jQuery);(function(A){A.widget("ui.draggable",A.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:true,appendTo:"parent",axis:false,connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false},_create:function(){if(this.options.helper=="original"&&!/^(?:r|a|f)/.test(this.element.css("position"))){this.element[0].style.position="relative";}this.options.addClasses&&this.element.addClass("ui-draggable");this.options.disabled&&this.element.addClass("ui-draggable-disabled");this._mouseInit();},destroy:function(){if(this.element.data("draggable")){this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._mouseDestroy();return this;}},_mouseCapture:function(C){var B=this.options;if(this.helper||B.disabled||A(C.target).is(".ui-resizable-handle")){return false;}this.handle=this._getHandle(C);if(!this.handle){return false;}return true;},_mouseStart:function(C){var B=this.options;this.helper=this._createHelper(C);this._cacheHelperProportions();if(A.ui.ddmanager){A.ui.ddmanager.current=this;}this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.positionAbs=this.element.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};A.extend(this.offset,{click:{left:C.pageX-this.offset.left,top:C.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this.position=this._generatePosition(C);this.originalPageX=C.pageX;this.originalPageY=C.pageY;B.cursorAt&&this._adjustOffsetFromHelper(B.cursorAt);B.containment&&this._setContainment();if(this._trigger("start",C)===false){this._clear();return false;}this._cacheHelperProportions();A.ui.ddmanager&&!B.dropBehaviour&&A.ui.ddmanager.prepareOffsets(this,C);this.helper.addClass("ui-draggable-dragging");this._mouseDrag(C,true);return true;},_mouseDrag:function(C,B){this.position=this._generatePosition(C);this.positionAbs=this._convertPositionTo("absolute");if(!B){B=this._uiHash();if(this._trigger("drag",C,B)===false){this._mouseUp({});return false;}this.position=B.position;}if(!this.options.axis||this.options.axis!="y"){this.helper[0].style.left=this.position.left+"px";}if(!this.options.axis||this.options.axis!="x"){this.helper[0].style.top=this.position.top+"px";}A.ui.ddmanager&&A.ui.ddmanager.drag(this,C);return false;},_mouseStop:function(C){var B=false;if(A.ui.ddmanager&&!this.options.dropBehaviour){B=A.ui.ddmanager.drop(this,C);}if(this.dropped){B=this.dropped;this.dropped=false;}if(!this.element[0]||!this.element[0].parentNode){return false;}if(this.options.revert=="invalid"&&!B||this.options.revert=="valid"&&B||this.options.revert===true||A.isFunction(this.options.revert)&&this.options.revert.call(this.element,B)){var D=this;A(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){D._trigger("stop",C)!==false&&D._clear();});}else{this._trigger("stop",C)!==false&&this._clear();}return false;},cancel:function(){this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear();return this;},_getHandle:function(C){var B=!this.options.handle||!A(this.options.handle,this.element).length?true:false;A(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==C.target){B=true;}});return B;},_createHelper:function(C){var B=this.options;C=A.isFunction(B.helper)?A(B.helper.apply(this.element[0],[C])):B.helper=="clone"?this.element.clone():this.element;C.parents("body").length||C.appendTo(B.appendTo=="parent"?this.element[0].parentNode:B.appendTo);C[0]!=this.element[0]&&!/(fixed|absolute)/.test(C.css("position"))&&C.css("position","absolute");return C;},_adjustOffsetFromHelper:function(B){if(typeof B=="string"){B=B.split(" ");}if(A.isArray(B)){B={left:+B[0],top:+B[1]||0};}if("left" in B){this.offset.click.left=B.left+this.margins.left;}if("right" in B){this.offset.click.left=this.helperProportions.width-B.right+this.margins.left;}if("top" in B){this.offset.click.top=B.top+this.margins.top;}if("bottom" in B){this.offset.click.top=this.helperProportions.height-B.bottom+this.margins.top;}},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var B=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&A.ui.contains(this.scrollParent[0],this.offsetParent[0])){B.left+=this.scrollParent.scrollLeft();B.top+=this.scrollParent.scrollTop();}if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&A.browser.msie){B={top:0,left:0}; }return{top:B.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:B.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)};},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var B=this.element.position();return{top:B.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:B.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()};}else{return{top:0,left:0};}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0};},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()};},_setContainment:function(){var C=this.options;if(C.containment=="parent"){C.containment=this.helper[0].parentNode;}if(C.containment=="document"||C.containment=="window"){this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,A(C.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(A(C.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];}if(!/^(document|window|parent)$/.test(C.containment)&&C.containment.constructor!=Array){var B=A(C.containment)[0];if(B){C=A(C.containment).offset();var D=A(B).css("overflow")!="hidden";this.containment=[C.left+(parseInt(A(B).css("borderLeftWidth"),10)||0)+(parseInt(A(B).css("paddingLeft"),10)||0)-this.margins.left,C.top+(parseInt(A(B).css("borderTopWidth"),10)||0)+(parseInt(A(B).css("paddingTop"),10)||0)-this.margins.top,C.left+(D?Math.max(B.scrollWidth,B.offsetWidth):B.offsetWidth)-(parseInt(A(B).css("borderLeftWidth"),10)||0)-(parseInt(A(B).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,C.top+(D?Math.max(B.scrollHeight,B.offsetHeight):B.offsetHeight)-(parseInt(A(B).css("borderTopWidth"),10)||0)-(parseInt(A(B).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top];}}else{if(C.containment.constructor==Array){this.containment=C.containment;}}},_convertPositionTo:function(C,B){if(!B){B=this.position;}C=C=="absolute"?1:-1;var E=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&A.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,D=/(html|body)/i.test(E[0].tagName);return{top:B.top+this.offset.relative.top*C+this.offset.parent.top*C-(A.browser.safari&&A.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():D?0:E.scrollTop())*C),left:B.left+this.offset.relative.left*C+this.offset.parent.left*C-(A.browser.safari&&A.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():D?0:E.scrollLeft())*C)};},_generatePosition:function(C){var B=this.options,G=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&A.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,E=/(html|body)/i.test(G[0].tagName),F=C.pageX,D=C.pageY;if(this.originalPosition){if(this.containment){if(C.pageX-this.offset.click.leftthis.containment[2]){F=this.containment[2]+this.offset.click.left;}if(C.pageY-this.offset.click.top>this.containment[3]){D=this.containment[3]+this.offset.click.top;}}if(B.grid){D=this.originalPageY+Math.round((D-this.originalPageY)/B.grid[1])*B.grid[1];D=this.containment?!(D-this.offset.click.topthis.containment[3])?D:!(D-this.offset.click.topthis.containment[2])?F:!(F-this.offset.click.left
    ').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1000}).css(A(this).offset()).appendTo("body");});},stop:function(){A("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this);});}});A.ui.plugin.add("draggable","opacity",{start:function(C,B){C=A(B.helper);B=A(this).data("draggable").options;if(C.css("opacity")){B._opacity=C.css("opacity");}C.css("opacity",B.opacity);},stop:function(C,B){C=A(this).data("draggable").options;C._opacity&&A(B.helper).css("opacity",C._opacity);}});A.ui.plugin.add("draggable","scroll",{start:function(){var B=A(this).data("draggable");if(B.scrollParent[0]!=document&&B.scrollParent[0].tagName!="HTML"){B.overflowOffset=B.scrollParent.offset();}},drag:function(C){var B=A(this).data("draggable"),E=B.options,D=false;if(B.scrollParent[0]!=document&&B.scrollParent[0].tagName!="HTML"){if(!E.axis||E.axis!="x"){if(B.overflowOffset.top+B.scrollParent[0].offsetHeight-C.pageY=0;N--){var M=R.snapElements[N].left,K=M+R.snapElements[N].width,L=R.snapElements[N].top,J=L+R.snapElements[N].height;if(M-Q
    ').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")}));this.element=this.element.parent().data("resizable",this.element.data("resizable"));this.elementIsWrapper=true;this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")});this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});this.originalResizeStyle=this.originalElement.css("resize");this.originalElement.css("resize","none");this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"}));this.originalElement.css({margin:this.originalElement.css("margin")});this._proportionallyResize();}this.handles=E.handles||(!C(".ui-resizable-handle",this.element).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"});if(this.handles.constructor==String){if(this.handles=="all"){this.handles="n,e,s,w,se,sw,ne,nw";}var I=this.handles.split(",");this.handles={};for(var H=0;H
    ');/sw|se|ne|nw/.test(F)&&G.css({zIndex:++E.zIndex});"se"==F&&G.addClass("ui-icon ui-icon-gripsmall-diagonal-se");this.handles[F]=".ui-resizable-"+F;this.element.append(G);}}this._renderAxis=function(M){M=M||this.element;for(var L in this.handles){if(this.handles[L].constructor==String){this.handles[L]=C(this.handles[L],this.element).show();}if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var K=C(this.handles[L],this.element),J=0; J=/sw|ne|nw|se|n|s/.test(L)?K.outerHeight():K.outerWidth();K=["padding",/ne|nw|n/.test(L)?"Top":/se|sw|s/.test(L)?"Bottom":/^e$/.test(L)?"Right":"Left"].join("");M.css(K,J);this._proportionallyResize();}C(this.handles[L]);}};this._renderAxis(this.element);this._handles=C(".ui-resizable-handle",this.element).disableSelection();this._handles.mouseover(function(){if(!D.resizing){if(this.className){var J=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);}D.axis=J&&J[1]?J[1]:"se";}});if(E.autoHide){this._handles.hide();C(this.element).addClass("ui-resizable-autohide").hover(function(){C(this).removeClass("ui-resizable-autohide");D._handles.show();},function(){if(!D.resizing){C(this).addClass("ui-resizable-autohide");D._handles.hide();}});}this._mouseInit();},destroy:function(){this._mouseDestroy();var D=function(F){C(F).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove();};if(this.elementIsWrapper){D(this.element);var E=this.element;E.after(this.originalElement.css({position:E.css("position"),width:E.outerWidth(),height:E.outerHeight(),top:E.css("top"),left:E.css("left")})).remove();}this.originalElement.css("resize",this.originalResizeStyle);D(this.originalElement);return this;},_mouseCapture:function(D){var E=false;for(var F in this.handles){if(C(this.handles[F])[0]==D.target){E=true;}}return !this.options.disabled&&E;},_mouseStart:function(D){var E=this.options,H=this.element.position(),G=this.element;this.resizing=true;this.documentScroll={top:C(document).scrollTop(),left:C(document).scrollLeft()};if(G.is(".ui-draggable")||/absolute/.test(G.css("position"))){G.css({position:"absolute",top:H.top,left:H.left});}C.browser.opera&&/relative/.test(G.css("position"))&&G.css({position:"relative",top:"auto",left:"auto"});this._renderProxy();H=A(this.helper.css("left"));var F=A(this.helper.css("top"));if(E.containment){H+=C(E.containment).scrollLeft()||0;F+=C(E.containment).scrollTop()||0;}this.offset=this.helper.offset();this.position={left:H,top:F};this.size=this._helper?{width:G.outerWidth(),height:G.outerHeight()}:{width:G.width(),height:G.height()};this.originalSize=this._helper?{width:G.outerWidth(),height:G.outerHeight()}:{width:G.width(),height:G.height()};this.originalPosition={left:H,top:F};this.sizeDiff={width:G.outerWidth()-G.width(),height:G.outerHeight()-G.height()};this.originalMousePosition={left:D.pageX,top:D.pageY};this.aspectRatio=typeof E.aspectRatio=="number"?E.aspectRatio:this.originalSize.width/this.originalSize.height||1;E=C(".ui-resizable-"+this.axis).css("cursor");C("body").css("cursor",E=="auto"?this.axis+"-resize":E);G.addClass("ui-resizable-resizing");this._propagate("start",D);return true;},_mouseDrag:function(D){var E=this.helper,G=this.originalMousePosition,F=this._change[this.axis];if(!F){return false;}G=F.apply(this,[D,D.pageX-G.left||0,D.pageY-G.top||0]);if(this._aspectRatio||D.shiftKey){G=this._updateRatio(G,D);}G=this._respectSize(G,D);this._propagate("resize",D);E.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize();this._updateCache(G);this._trigger("resize",D,this.ui());return false;},_mouseStop:function(D){this.resizing=false;var E=this.options,I=this;if(this._helper){var H=this._proportionallyResizeElements,F=H.length&&/textarea/i.test(H[0].nodeName);H=F&&C.ui.hasScroll(H[0],"left")?0:I.sizeDiff.height;F={width:I.size.width-(F?0:I.sizeDiff.width),height:I.size.height-H};H=parseInt(I.element.css("left"),10)+(I.position.left-I.originalPosition.left)||null;var G=parseInt(I.element.css("top"),10)+(I.position.top-I.originalPosition.top)||null;E.animate||this.element.css(C.extend(F,{top:G,left:H}));I.helper.height(I.size.height);I.helper.width(I.size.width);this._helper&&!E.animate&&this._proportionallyResize();}C("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing");this._propagate("stop",D);this._helper&&this.helper.remove();return false;},_updateCache:function(D){this.offset=this.helper.offset();if(B(D.left)){this.position.left=D.left;}if(B(D.top)){this.position.top=D.top;}if(B(D.height)){this.size.height=D.height;}if(B(D.width)){this.size.width=D.width;}},_updateRatio:function(D){var E=this.position,G=this.size,F=this.axis;if(D.height){D.width=G.height*this.aspectRatio;}else{if(D.width){D.height=G.width/this.aspectRatio;}}if(F=="sw"){D.left=E.left+(G.width-D.width);D.top=null;}if(F=="nw"){D.top=E.top+(G.height-D.height);D.left=E.left+(G.width-D.width);}return D;},_respectSize:function(L){var M=this.options,K=this.axis,J=B(L.width)&&M.maxWidth&&M.maxWidthL.width,G=B(L.height)&&M.minHeight&&M.minHeight>L.height;if(I){L.width=M.minWidth;}if(G){L.height=M.minHeight;}if(J){L.width=M.maxWidth;}if(H){L.height=M.maxHeight;}var F=this.originalPosition.left+this.originalSize.width,E=this.position.top+this.size.height,D=/sw|nw|w/.test(K);K=/nw|ne|n/.test(K);if(I&&D){L.left=F-M.minWidth;}if(J&&D){L.left=F-M.maxWidth;}if(G&&K){L.top=E-M.minHeight;}if(H&&K){L.top=E-M.maxHeight;}if((M=!L.width&&!L.height)&&!L.left&&L.top){L.top=null;}else{if(M&&!L.top&&L.left){L.left=null;}}return L;},_proportionallyResize:function(){if(this._proportionallyResizeElements.length){for(var D=this.helper||this.element,E=0;E
    ');var E=C.browser.msie&&C.browser.version<7,F=E?1:0;E=E?2:-1;this.helper.addClass(this._helper).css({width:this.element.outerWidth()+E,height:this.element.outerHeight()+E,position:"absolute",left:this.elementOffset.left-F+"px",top:this.elementOffset.top-F+"px",zIndex:++D.zIndex});this.helper.appendTo("body").disableSelection();}else{this.helper=this.element;}},_change:{e:function(D,E){return{width:this.originalSize.width+E};},w:function(D,E){return{left:this.originalPosition.left+E,width:this.originalSize.width-E};},n:function(D,E,F){return{top:this.originalPosition.top+F,height:this.originalSize.height-F};},s:function(D,E,F){return{height:this.originalSize.height+F};},se:function(D,E,F){return C.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[D,E,F]));},sw:function(D,E,F){return C.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[D,E,F]));},ne:function(D,E,F){return C.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[D,E,F]));},nw:function(D,E,F){return C.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[D,E,F]));}},_propagate:function(D,E){C.ui.plugin.call(this,D,[E,this.ui()]);D!="resize"&&this._trigger(D,E,this.ui());},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition};}});C.extend(C.ui.resizable,{version:"1.8.1"});C.ui.plugin.add("resizable","alsoResize",{start:function(){var D=C(this).data("resizable").options,E=function(F){C(F).each(function(){C(this).data("resizable-alsoresize",{width:parseInt(C(this).width(),10),height:parseInt(C(this).height(),10),left:parseInt(C(this).css("left"),10),top:parseInt(C(this).css("top"),10)}); });};if(typeof D.alsoResize=="object"&&!D.alsoResize.parentNode){if(D.alsoResize.length){D.alsoResize=D.alsoResize[0];E(D.alsoResize);}else{C.each(D.alsoResize,function(F){E(F);});}}else{E(D.alsoResize);}},resize:function(){var D=C(this).data("resizable"),E=D.options,I=D.originalSize,H=D.originalPosition,F={height:D.size.height-I.height||0,width:D.size.width-I.width||0,top:D.position.top-H.top||0,left:D.position.left-H.left||0},G=function(K,J){C(K).each(function(){var M=C(this),L=C(this).data("resizable-alsoresize"),N={};C.each((J&&J.length?J:["width","height","top","left"])||["width","height","top","left"],function(P,O){if((P=(L[O]||0)+(F[O]||0))&&P>=0){N[O]=P||null;}});if(/relative/.test(M.css("position"))&&C.browser.opera){D._revertToRelativePosition=true;M.css({position:"absolute",top:"auto",left:"auto"});}M.css(N);});};typeof E.alsoResize=="object"&&!E.alsoResize.nodeType?C.each(E.alsoResize,function(K,J){G(K,J);}):G(E.alsoResize);},stop:function(){var D=C(this).data("resizable");if(D._revertToRelativePosition&&C.browser.opera){D._revertToRelativePosition=false;el.css({position:"relative"});}C(this).removeData("resizable-alsoresize-start");}});C.ui.plugin.add("resizable","animate",{stop:function(D){var E=C(this).data("resizable"),J=E.options,I=E._proportionallyResizeElements,G=I.length&&/textarea/i.test(I[0].nodeName),H=G&&C.ui.hasScroll(I[0],"left")?0:E.sizeDiff.height;G={width:E.size.width-(G?0:E.sizeDiff.width),height:E.size.height-H};H=parseInt(E.element.css("left"),10)+(E.position.left-E.originalPosition.left)||null;var F=parseInt(E.element.css("top"),10)+(E.position.top-E.originalPosition.top)||null;E.element.animate(C.extend(G,F&&H?{top:F,left:H}:{}),{duration:J.animateDuration,easing:J.animateEasing,step:function(){var K={width:parseInt(E.element.css("width"),10),height:parseInt(E.element.css("height"),10),top:parseInt(E.element.css("top"),10),left:parseInt(E.element.css("left"),10)};I&&I.length&&C(I[0]).css({width:K.width,height:K.height});E._updateCache(K);E._propagate("resize",D);}});}});C.ui.plugin.add("resizable","containment",{start:function(){var D=C(this).data("resizable"),E=D.element,J=D.options.containment;if(E=J instanceof C?J.get(0):/parent/.test(J)?E.parent().get(0):J){D.containerElement=C(E);if(/document/.test(J)||J==document){D.containerOffset={left:0,top:0};D.containerPosition={left:0,top:0};D.parentData={element:C(document),left:0,top:0,width:C(document).width(),height:C(document).height()||document.body.parentNode.scrollHeight};}else{var I=C(E),G=[];C(["Top","Right","Left","Bottom"]).each(function(L,K){G[L]=A(I.css("padding"+K));});D.containerOffset=I.offset();D.containerPosition=I.position();D.containerSize={height:I.innerHeight()-G[3],width:I.innerWidth()-G[1]};J=D.containerOffset;var H=D.containerSize.height,F=D.containerSize.width;F=C.ui.hasScroll(E,"left")?E.scrollWidth:F;H=C.ui.hasScroll(E)?E.scrollHeight:H;D.parentData={element:E,left:J.left,top:J.top,width:F,height:H};}}},resize:function(D){var E=C(this).data("resizable"),J=E.options,I=E.containerOffset,G=E.position;D=E._aspectRatio||D.shiftKey;var H={top:0,left:0},F=E.containerElement;if(F[0]!=document&&/static/.test(F.css("position"))){H=I;}if(G.left<(E._helper?I.left:0)){E.size.width+=E._helper?E.position.left-I.left:E.position.left-H.left;if(D){E.size.height=E.size.width/J.aspectRatio;}E.position.left=J.helper?I.left:0;}if(G.top<(E._helper?I.top:0)){E.size.height+=E._helper?E.position.top-I.top:E.position.top;if(D){E.size.width=E.size.height*J.aspectRatio;}E.position.top=E._helper?I.top:0;}E.offset.left=E.parentData.left+E.position.left;E.offset.top=E.parentData.top+E.position.top;J=Math.abs((E._helper?E.offset.left-H.left:E.offset.left-H.left)+E.sizeDiff.width);I=Math.abs((E._helper?E.offset.top-H.top:E.offset.top-I.top)+E.sizeDiff.height);G=E.containerElement.get(0)==E.element.parent().get(0);H=/relative|absolute/.test(E.containerElement.css("position"));if(G&&H){J-=E.parentData.left;}if(J+E.size.width>=E.parentData.width){E.size.width=E.parentData.width-J;if(D){E.size.height=E.size.width/E.aspectRatio;}}if(I+E.size.height>=E.parentData.height){E.size.height=E.parentData.height-I;if(D){E.size.width=E.size.height*E.aspectRatio;}}},stop:function(){var D=C(this).data("resizable"),E=D.options,K=D.containerOffset,J=D.containerPosition,H=D.containerElement,I=C(D.helper),G=I.offset(),F=I.outerWidth()-D.sizeDiff.width;I=I.outerHeight()-D.sizeDiff.height;D._helper&&!E.animate&&/relative/.test(H.css("position"))&&C(this).css({left:G.left-J.left-K.left,width:F,height:I});D._helper&&!E.animate&&/static/.test(H.css("position"))&&C(this).css({left:G.left-J.left-K.left,width:F,height:I});}});C.ui.plugin.add("resizable","ghost",{start:function(){var D=C(this).data("resizable"),E=D.options,F=D.size;D.ghost=D.originalElement.clone();D.ghost.css({opacity:0.25,display:"block",position:"relative",height:F.height,width:F.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof E.ghost=="string"?E.ghost:"");D.ghost.appendTo(D.helper);},resize:function(){var D=C(this).data("resizable");D.ghost&&D.ghost.css({position:"relative",height:D.size.height,width:D.size.width});},stop:function(){var D=C(this).data("resizable");D.ghost&&D.helper&&D.helper.get(0).removeChild(D.ghost.get(0));}});C.ui.plugin.add("resizable","grid",{resize:function(){var D=C(this).data("resizable"),E=D.options,J=D.size,I=D.originalSize,G=D.originalPosition,H=D.axis;E.grid=typeof E.grid=="number"?[E.grid,E.grid]:E.grid;var F=Math.round((J.width-I.width)/(E.grid[0]||1))*(E.grid[0]||1);E=Math.round((J.height-I.height)/(E.grid[1]||1))*(E.grid[1]||1);if(/^(se|s|e)$/.test(H)){D.size.width=I.width+F;D.size.height=I.height+E;}else{if(/^(ne)$/.test(H)){D.size.width=I.width+F;D.size.height=I.height+E;D.position.top=G.top-E;}else{if(/^(sw)$/.test(H)){D.size.width=I.width+F;D.size.height=I.height+E;}else{D.size.width=I.width+F;D.size.height=I.height+E;D.position.top=G.top-E;}D.position.left=G.left-F;}}}});var A=function(D){return parseInt(D,10)||0;},B=function(D){return !isNaN(parseInt(D,10));};})(jQuery);(function(A){var D,B=function(E){A(":ui-button",E.target.form).each(function(){var F=A(this).data("button");setTimeout(function(){F.refresh();},1);});},C=function(E){var H=E.name,G=E.form,F=A([]);if(H){F=G?A(G).find("[name='"+H+"']"):A("[name='"+H+"']",E.ownerDocument).filter(function(){return !this.form;});}return F;};A.widget("ui.button",{options:{text:true,label:null,icons:{primary:null,secondary:null}},_create:function(){this.element.closest("form").unbind("reset.button").bind("reset.button",B);this._determineButtonType();this.hasTitle=!!this.buttonElement.attr("title");var E=this,H=this.options,G=this.type==="checkbox"||this.type==="radio",F="ui-state-hover"+(!G?" ui-state-active":"");if(H.label===null){H.label=this.buttonElement.html();}if(this.element.is(":disabled")){H.disabled=true;}this.buttonElement.addClass("ui-button ui-widget ui-state-default ui-corner-all").attr("role","button").bind("mouseenter.button",function(){if(!H.disabled){A(this).addClass("ui-state-hover");this===D&&A(this).addClass("ui-state-active");}}).bind("mouseleave.button",function(){H.disabled||A(this).removeClass(F);}).bind("focus.button",function(){A(this).addClass("ui-state-focus");}).bind("blur.button",function(){A(this).removeClass("ui-state-focus");});G&&this.element.bind("change.button",function(){E.refresh();});if(this.type==="checkbox"){this.buttonElement.bind("click.button",function(){if(H.disabled){return false;}A(this).toggleClass("ui-state-active");E.buttonElement.attr("aria-pressed",E.element[0].checked);});}else{if(this.type==="radio"){this.buttonElement.bind("click.button",function(){if(H.disabled){return false;}A(this).addClass("ui-state-active");E.buttonElement.attr("aria-pressed",true);var I=E.element[0];C(I).not(I).map(function(){return A(this).button("widget")[0];}).removeClass("ui-state-active").attr("aria-pressed",false);});}else{this.buttonElement.bind("mousedown.button",function(){if(H.disabled){return false; }A(this).addClass("ui-state-active");D=this;A(document).one("mouseup",function(){D=null;});}).bind("mouseup.button",function(){if(H.disabled){return false;}A(this).removeClass("ui-state-active");}).bind("keydown.button",function(I){if(H.disabled){return false;}if(I.keyCode==A.ui.keyCode.SPACE||I.keyCode==A.ui.keyCode.ENTER){A(this).addClass("ui-state-active");}}).bind("keyup.button",function(){A(this).removeClass("ui-state-active");});this.buttonElement.is("a")&&this.buttonElement.keyup(function(I){I.keyCode===A.ui.keyCode.SPACE&&A(this).click();});}}this._setOption("disabled",H.disabled);},_determineButtonType:function(){this.type=this.element.is(":checkbox")?"checkbox":this.element.is(":radio")?"radio":this.element.is("input")?"input":"button";if(this.type==="checkbox"||this.type==="radio"){this.buttonElement=this.element.parents().last().find("[for="+this.element.attr("id")+"]");this.element.addClass("ui-helper-hidden-accessible");var E=this.element.is(":checked");E&&this.buttonElement.addClass("ui-state-active");this.buttonElement.attr("aria-pressed",E);}else{this.buttonElement=this.element;}},widget:function(){return this.buttonElement;},destroy:function(){this.element.removeClass("ui-helper-hidden-accessible");this.buttonElement.removeClass("ui-button ui-widget ui-state-default ui-corner-all ui-state-hover ui-state-active ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon ui-button-text-only").removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html());this.hasTitle||this.buttonElement.removeAttr("title");A.Widget.prototype.destroy.call(this);},_setOption:function(E,F){A.Widget.prototype._setOption.apply(this,arguments);if(E==="disabled"){F?this.element.attr("disabled",true):this.element.removeAttr("disabled");}this._resetButton();},refresh:function(){var E=this.element.is(":disabled");E!==this.options.disabled&&this._setOption("disabled",E);if(this.type==="radio"){C(this.element[0]).each(function(){A(this).is(":checked")?A(this).button("widget").addClass("ui-state-active").attr("aria-pressed",true):A(this).button("widget").removeClass("ui-state-active").attr("aria-pressed",false);});}else{if(this.type==="checkbox"){this.element.is(":checked")?this.buttonElement.addClass("ui-state-active").attr("aria-pressed",true):this.buttonElement.removeClass("ui-state-active").attr("aria-pressed",false);}}},_resetButton:function(){if(this.type==="input"){this.options.label&&this.element.val(this.options.label);}else{var E=this.buttonElement,H=A("").addClass("ui-button-text").html(this.options.label).appendTo(E.empty()).text(),G=this.options.icons,F=G.primary&&G.secondary;if(G.primary||G.secondary){E.addClass("ui-button-text-icon"+(F?"s":""));G.primary&&E.prepend("");G.secondary&&E.append("");if(!this.options.text){E.addClass(F?"ui-button-icons-only":"ui-button-icon-only").removeClass("ui-button-text-icons ui-button-text-icon");this.hasTitle||E.attr("title",H);}}else{E.addClass("ui-button-text-only");}}}});A.widget("ui.buttonset",{_create:function(){this.element.addClass("ui-buttonset");this._init();},_init:function(){this.refresh();},_setOption:function(E,F){E==="disabled"&&this.buttons.button("option",E,F);A.Widget.prototype._setOption.apply(this,arguments);},refresh:function(){this.buttons=this.element.find(":button, :submit, :reset, :checkbox, :radio, a, :data(button)").filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return A(this).button("widget")[0];}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass("ui-corner-left").end().filter(":last").addClass("ui-corner-right").end().end();},destroy:function(){this.element.removeClass("ui-buttonset");this.buttons.map(function(){return A(this).button("widget")[0];}).removeClass("ui-corner-left ui-corner-right").end().button("destroy");A.Widget.prototype.destroy.call(this);}});})(jQuery);(function(C){var B=0,A=0;C.widget("ui.tabs",{options:{add:null,ajaxOptions:null,cache:false,cookie:null,collapsible:false,disable:null,disabled:[],enable:null,event:"click",fx:null,idPrefix:"ui-tabs-",load:null,panelTemplate:"
    ",remove:null,select:null,show:null,spinner:"Loading…",tabTemplate:'
  • #{label}
  • '},_create:function(){this._tabify(true);},_setOption:function(E,D){if(E=="selected"){this.options.collapsible&&D==this.options.selected||this.select(D);}else{this.options[E]=D;this._tabify();}},_tabId:function(D){return D.title&&D.title.replace(/\s/g,"_").replace(/[^A-Za-z0-9\-_:\.]/g,"")||this.options.idPrefix+ ++B;},_sanitizeSelector:function(D){return D.replace(/:/g,"\\:");},_cookie:function(){var D=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+ ++A);return C.cookie.apply(null,[D].concat(C.makeArray(arguments)));},_ui:function(E,D){return{tab:E,panel:D,index:this.anchors.index(E)};},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var D=C(this);D.html(D.data("label.tabs")).removeData("label.tabs");});},_tabify:function(M){function L(P,Q){P.css({display:""});!C.support.opacity&&Q.opacity&&P[0].style.removeAttribute("filter");}this.list=this.element.find("ol,ul").eq(0);this.lis=C("li:has(a[href])",this.list);this.anchors=this.lis.map(function(){return C("a",this)[0];});this.panels=C([]);var O=this,N=this.options,K=/^#.+/;this.anchors.each(function(R,S){var Q=C(S).attr("href"),P=Q.split("#")[0],T;if(P&&(P===location.toString().split("#")[0]||(T=C("base")[0])&&P===T.href)){Q=S.hash;S.href=Q;}if(K.test(Q)){O.panels=O.panels.add(O._sanitizeSelector(Q));}else{if(Q!="#"){C.data(S,"href.tabs",Q);C.data(S,"load.tabs",Q.replace(/#.*$/,""));Q=O._tabId(S);S.href="#"+Q;S=C("#"+Q);if(!S.length){S=C(N.panelTemplate).attr("id",Q).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(O.panels[R-1]||O.list);S.data("destroy.tabs",true);}O.panels=O.panels.add(S);}else{N.disabled.push(R);}}});if(M){this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all");this.list.addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.lis.addClass("ui-state-default ui-corner-top");this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom");if(N.selected===undefined){location.hash&&this.anchors.each(function(P,Q){if(Q.hash==location.hash){N.selected=P;return false;}});if(typeof N.selected!="number"&&N.cookie){N.selected=parseInt(O._cookie(),10);}if(typeof N.selected!="number"&&this.lis.filter(".ui-tabs-selected").length){N.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"));}N.selected=N.selected||(this.lis.length?0:-1);}else{if(N.selected===null){N.selected=-1;}}N.selected=N.selected>=0&&this.anchors[N.selected]||N.selected<0?N.selected:0;N.disabled=C.unique(N.disabled.concat(C.map(this.lis.filter(".ui-state-disabled"),function(P){return O.lis.index(P);}))).sort();C.inArray(N.selected,N.disabled)!=-1&&N.disabled.splice(C.inArray(N.selected,N.disabled),1);this.panels.addClass("ui-tabs-hide");this.lis.removeClass("ui-tabs-selected ui-state-active");if(N.selected>=0&&this.anchors.length){this.panels.eq(N.selected).removeClass("ui-tabs-hide");this.lis.eq(N.selected).addClass("ui-tabs-selected ui-state-active");O.element.queue("tabs",function(){O._trigger("show",null,O._ui(O.anchors[N.selected],O.panels[N.selected]));});this.load(N.selected);}C(window).bind("unload",function(){O.lis.add(O.anchors).unbind(".tabs");O.lis=O.anchors=O.panels=null;});}else{N.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"));}this.element[N.collapsible?"addClass":"removeClass"]("ui-tabs-collapsible");N.cookie&&this._cookie(N.selected,N.cookie);M=0;for(var J;J=this.lis[M];M++){C(J)[C.inArray(M,N.disabled)!=-1&&!C(J).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled"); }N.cache===false&&this.anchors.removeData("cache.tabs");this.lis.add(this.anchors).unbind(".tabs");if(N.event!="mouseover"){var I=function(P,Q){Q.is(":not(.ui-state-disabled)")&&Q.addClass("ui-state-"+P);},G=function(P,Q){Q.removeClass("ui-state-"+P);};this.lis.bind("mouseover.tabs",function(){I("hover",C(this));});this.lis.bind("mouseout.tabs",function(){G("hover",C(this));});this.anchors.bind("focus.tabs",function(){I("focus",C(this).closest("li"));});this.anchors.bind("blur.tabs",function(){G("focus",C(this).closest("li"));});}var H,F;if(N.fx){if(C.isArray(N.fx)){H=N.fx[0];F=N.fx[1];}else{H=F=N.fx;}}var E=F?function(P,Q){C(P).closest("li").addClass("ui-tabs-selected ui-state-active");Q.hide().removeClass("ui-tabs-hide").animate(F,F.duration||"normal",function(){L(Q,F);O._trigger("show",null,O._ui(P,Q[0]));});}:function(P,Q){C(P).closest("li").addClass("ui-tabs-selected ui-state-active");Q.removeClass("ui-tabs-hide");O._trigger("show",null,O._ui(P,Q[0]));},D=H?function(P,Q){Q.animate(H,H.duration||"normal",function(){O.lis.removeClass("ui-tabs-selected ui-state-active");Q.addClass("ui-tabs-hide");L(Q,H);O.element.dequeue("tabs");});}:function(P,Q){O.lis.removeClass("ui-tabs-selected ui-state-active");Q.addClass("ui-tabs-hide");O.element.dequeue("tabs");};this.anchors.bind(N.event+".tabs",function(){var R=this,S=C(this).closest("li"),Q=O.panels.filter(":not(.ui-tabs-hide)"),P=C(O._sanitizeSelector(this.hash));if(S.hasClass("ui-tabs-selected")&&!N.collapsible||S.hasClass("ui-state-disabled")||S.hasClass("ui-state-processing")||O._trigger("select",null,O._ui(this,P[0]))===false){this.blur();return false;}N.selected=O.anchors.index(this);O.abort();if(N.collapsible){if(S.hasClass("ui-tabs-selected")){N.selected=-1;N.cookie&&O._cookie(N.selected,N.cookie);O.element.queue("tabs",function(){D(R,Q);}).dequeue("tabs");this.blur();return false;}else{if(!Q.length){N.cookie&&O._cookie(N.selected,N.cookie);O.element.queue("tabs",function(){E(R,P);});O.load(O.anchors.index(this));this.blur();return false;}}}N.cookie&&O._cookie(N.selected,N.cookie);if(P.length){Q.length&&O.element.queue("tabs",function(){D(R,Q);});O.element.queue("tabs",function(){E(R,P);});O.load(O.anchors.index(this));}else{throw"jQuery UI Tabs: Mismatching fragment identifier.";}C.browser.msie&&this.blur();});this.anchors.bind("click.tabs",function(){return false;});},destroy:function(){var D=this.options;this.abort();this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs");this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.anchors.each(function(){var F=C.data(this,"href.tabs");if(F){this.href=F;}var E=C(this).unbind(".tabs");C.each(["href","load","cache"],function(G,H){E.removeData(H+".tabs");});});this.lis.unbind(".tabs").add(this.panels).each(function(){C.data(this,"destroy.tabs")?C(this).remove():C(this).removeClass("ui-state-default ui-corner-top ui-tabs-selected ui-state-active ui-state-hover ui-state-focus ui-state-disabled ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide");});D.cookie&&this._cookie(null,D.cookie);return this;},add:function(I,H,E){if(E===undefined){E=this.anchors.length;}var D=this,G=this.options;H=C(G.tabTemplate.replace(/#\{href\}/g,I).replace(/#\{label\}/g,H));I=!I.indexOf("#")?I.replace("#",""):this._tabId(C("a",H)[0]);H.addClass("ui-state-default ui-corner-top").data("destroy.tabs",true);var F=C("#"+I);F.length||(F=C(G.panelTemplate).attr("id",I).data("destroy.tabs",true));F.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide");if(E>=this.lis.length){H.appendTo(this.list);F.appendTo(this.list[0].parentNode);}else{H.insertBefore(this.lis[E]);F.insertBefore(this.panels[E]);}G.disabled=C.map(G.disabled,function(J){return J>=E?++J:J;});this._tabify();if(this.anchors.length==1){G.selected=0;H.addClass("ui-tabs-selected ui-state-active");F.removeClass("ui-tabs-hide");this.element.queue("tabs",function(){D._trigger("show",null,D._ui(D.anchors[0],D.panels[0]));});this.load(0);}this._trigger("add",null,this._ui(this.anchors[E],this.panels[E]));return this;},remove:function(G){var F=this.options,E=this.lis.eq(G).remove(),D=this.panels.eq(G).remove();if(E.hasClass("ui-tabs-selected")&&this.anchors.length>1){this.select(G+(G+1=G?--H:H;});this._tabify();this._trigger("remove",null,this._ui(E.find("a")[0],D[0]));return this;},enable:function(E){var D=this.options;if(C.inArray(E,D.disabled)!=-1){this.lis.eq(E).removeClass("ui-state-disabled");D.disabled=C.grep(D.disabled,function(F){return F!=E;});this._trigger("enable",null,this._ui(this.anchors[E],this.panels[E]));return this;}},disable:function(E){var D=this.options;if(E!=D.selected){this.lis.eq(E).addClass("ui-state-disabled");D.disabled.push(E);D.disabled.sort();this._trigger("disable",null,this._ui(this.anchors[E],this.panels[E]));}return this;},select:function(D){if(typeof D=="string"){D=this.anchors.index(this.anchors.filter("[href$="+D+"]"));}else{if(D===null){D=-1;}}if(D==-1&&this.options.collapsible){D=this.options.selected;}this.anchors.eq(D).trigger(this.options.event+".tabs");return this;},load:function(I){var H=this,E=this.options,D=this.anchors.eq(I)[0],G=C.data(D,"load.tabs");this.abort();if(!G||this.element.queue("tabs").length!==0&&C.data(D,"cache.tabs")){this.element.dequeue("tabs");}else{this.lis.eq(I).addClass("ui-state-processing");if(E.spinner){var F=C("span",D);F.data("label.tabs",F.html()).html(E.spinner);}this.xhr=C.ajax(C.extend({},E.ajaxOptions,{url:G,success:function(K,L){C(H._sanitizeSelector(D.hash)).html(K);H._cleanup();E.cache&&C.data(D,"cache.tabs",true);H._trigger("load",null,H._ui(H.anchors[I],H.panels[I]));try{E.ajaxOptions.success(K,L);}catch(J){}},error:function(K,L){H._cleanup();H._trigger("load",null,H._ui(H.anchors[I],H.panels[I]));try{E.ajaxOptions.error(K,L,I,D);}catch(J){}}}));H.element.dequeue("tabs");return this;}},abort:function(){this.element.queue([]);this.panels.stop(false,true);this.element.queue("tabs",this.element.queue("tabs").splice(-2,2));if(this.xhr){this.xhr.abort();delete this.xhr;}this._cleanup();return this;},url:function(E,D){this.anchors.eq(E).removeData("cache.tabs").data("load.tabs",D);return this;},length:function(){return this.anchors.length;}});C.extend(C.ui.tabs,{version:"1.8.1"});C.extend(C.ui.tabs.prototype,{rotation:null,rotate:function(H,G){var E=this,D=this.options,F=E._rotate||(E._rotate=function(I){clearTimeout(E.rotation);E.rotation=setTimeout(function(){var J=D.selected;E.select(++J")).appendTo(document.body).hide().addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+B.dialogClass).css({zIndex:B.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(I){if(B.closeOnEscape&&I.keyCode&&I.keyCode===A.ui.keyCode.ESCAPE){C.close(I);I.preventDefault();}}).attr({role:"dialog","aria-labelledby":G}).mousedown(function(I){C.moveToTop(false,I);});C.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(E); var F=(C.uiDialogTitlebar=A("
    ")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(E),D=A('').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").hover(function(){D.addClass("ui-state-hover");},function(){D.removeClass("ui-state-hover");}).focus(function(){D.addClass("ui-state-focus");}).blur(function(){D.removeClass("ui-state-focus");}).click(function(I){C.close(I);return false;}).appendTo(F);(C.uiDialogTitlebarCloseText=A("")).addClass("ui-icon ui-icon-closethick").text(B.closeText).appendTo(D);A("").addClass("ui-dialog-title").attr("id",G).html(H).prependTo(F);if(A.isFunction(B.beforeclose)&&!A.isFunction(B.beforeClose)){B.beforeClose=B.beforeclose;}F.find("*").add(F).disableSelection();B.draggable&&A.fn.draggable&&C._makeDraggable();B.resizable&&A.fn.resizable&&C._makeResizable();C._createButtons(B.buttons);C._isOpen=false;A.fn.bgiframe&&E.bgiframe();},_init:function(){this.options.autoOpen&&this.open();},destroy:function(){var B=this;B.overlay&&B.overlay.destroy();B.uiDialog.hide();B.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body");B.uiDialog.remove();B.originalTitle&&B.element.attr("title",B.originalTitle);return B;},widget:function(){return this.uiDialog;},close:function(C){var B=this,D;if(false!==B._trigger("beforeClose",C)){B.overlay&&B.overlay.destroy();B.uiDialog.unbind("keypress.ui-dialog");B._isOpen=false;if(B.options.hide){B.uiDialog.hide(B.options.hide,function(){B._trigger("close",C);});}else{B.uiDialog.hide();B._trigger("close",C);}A.ui.dialog.overlay.resize();if(B.options.modal){D=0;A(".ui-dialog").each(function(){if(this!==B.uiDialog[0]){D=Math.max(D,A(this).css("z-index"));}});A.ui.dialog.maxZ=D;}return B;}},isOpen:function(){return this._isOpen;},moveToTop:function(C,B){var E=this,D=E.options;if(D.modal&&!C||!D.stack&&!D.modal){return E._trigger("focus",B);}if(D.zIndex>A.ui.dialog.maxZ){A.ui.dialog.maxZ=D.zIndex;}if(E.overlay){A.ui.dialog.maxZ+=1;E.overlay.$el.css("z-index",A.ui.dialog.overlay.maxZ=A.ui.dialog.maxZ);}C={scrollTop:E.element.attr("scrollTop"),scrollLeft:E.element.attr("scrollLeft")};A.ui.dialog.maxZ+=1;E.uiDialog.css("z-index",A.ui.dialog.maxZ);E.element.attr(C);E._trigger("focus",B);return E;},open:function(){if(!this._isOpen){var C=this,B=C.options,D=C.uiDialog;C.overlay=B.modal?new A.ui.dialog.overlay(C):null;D.next().length&&D.appendTo("body");C._size();C._position(B.position);D.show(B.show);C.moveToTop(true);B.modal&&D.bind("keypress.ui-dialog",function(G){if(G.keyCode===A.ui.keyCode.TAB){var E=A(":tabbable",this),F=E.filter(":first");E=E.filter(":last");if(G.target===E[0]&&!G.shiftKey){F.focus(1);return false;}else{if(G.target===F[0]&&G.shiftKey){E.focus(1);return false;}}}});A([]).add(D.find(".ui-dialog-content :tabbable:first")).add(D.find(".ui-dialog-buttonpane :tabbable:first")).add(D).filter(":first").focus();C._trigger("open");C._isOpen=true;return C;}},_createButtons:function(C){var B=this,E=false,D=A("
    ").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix");B.uiDialog.find(".ui-dialog-buttonpane").remove();typeof C==="object"&&C!==null&&A.each(C,function(){return !(E=true);});if(E){A.each(C,function(F,G){F=A('').text(F).click(function(){G.apply(B.element[0],arguments);}).appendTo(D);A.fn.button&&F.button();});D.appendTo(B.uiDialog);}},_makeDraggable:function(){function C(G){return{position:G.position,offset:G.offset};}var B=this,F=B.options,E=A(document),D;B.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(H,G){D=F.height==="auto"?"auto":A(this).height();A(this).height(A(this).height()).addClass("ui-dialog-dragging");B._trigger("dragStart",H,C(G));},drag:function(H,G){B._trigger("drag",H,C(G));},stop:function(H,G){F.position=[G.position.left-E.scrollLeft(),G.position.top-E.scrollTop()];A(this).removeClass("ui-dialog-dragging").height(D);B._trigger("dragStop",H,C(G));A.ui.dialog.overlay.resize();}});},_makeResizable:function(C){function B(G){return{originalPosition:G.originalPosition,originalSize:G.originalSize,position:G.position,size:G.size};}C=C===undefined?this.options.resizable:C;var F=this,E=F.options,D=F.uiDialog.css("position");C=typeof C==="string"?C:"n,e,s,w,se,sw,ne,nw";F.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:F.element,maxWidth:E.maxWidth,maxHeight:E.maxHeight,minWidth:E.minWidth,minHeight:F._minHeight(),handles:C,start:function(H,G){A(this).addClass("ui-dialog-resizing");F._trigger("resizeStart",H,B(G));},resize:function(H,G){F._trigger("resize",H,B(G));},stop:function(H,G){A(this).removeClass("ui-dialog-resizing");E.height=A(this).height();E.width=A(this).width();F._trigger("resizeStop",H,B(G));A.ui.dialog.overlay.resize();}}).css("position",D).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se");},_minHeight:function(){var B=this.options;return B.height==="auto"?B.minHeight:Math.min(B.minHeight,B.height);},_position:function(C){var B=[],D=[0,0];C=C||A.ui.dialog.prototype.options.position;if(typeof C==="string"||typeof C==="object"&&"0" in C){B=C.split?C.split(" "):[C[0],C[1]];if(B.length===1){B[1]=B[0];}A.each(["left","top"],function(F,E){if(+B[F]===B[F]){D[F]=B[F];B[F]=E;}});}else{if(typeof C==="object"){if("left" in C){B[0]="left";D[0]=C.left;}else{if("right" in C){B[0]="right";D[0]=-C.right;}}if("top" in C){B[1]="top";D[1]=C.top;}else{if("bottom" in C){B[1]="bottom";D[1]=-C.bottom;}}}}(C=this.uiDialog.is(":visible"))||this.uiDialog.show();this.uiDialog.css({top:0,left:0}).position({my:B.join(" "),at:B.join(" "),offset:D.join(" "),of:window,collision:"fit",using:function(F){var E=A(this).css(F).offset().top;E<0&&A(this).css("top",F.top-E);}});C||this.uiDialog.hide();},_setOption:function(C,B){var G=this,F=G.uiDialog,D=F.is(":data(resizable)"),E=false;switch(C){case"beforeclose":C="beforeClose";break;case"buttons":G._createButtons(B);break;case"closeText":G.uiDialogTitlebarCloseText.text(""+B);break;case"dialogClass":F.removeClass(G.options.dialogClass).addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+B);break;case"disabled":B?F.addClass("ui-dialog-disabled"):F.removeClass("ui-dialog-disabled");break;case"draggable":B?G._makeDraggable():F.draggable("destroy");break;case"height":E=true;break;case"maxHeight":D&&F.resizable("option","maxHeight",B);E=true;break;case"maxWidth":D&&F.resizable("option","maxWidth",B);E=true;break;case"minHeight":D&&F.resizable("option","minHeight",B);E=true;break;case"minWidth":D&&F.resizable("option","minWidth",B);E=true;break;case"position":G._position(B);break;case"resizable":D&&!B&&F.resizable("destroy");D&&typeof B==="string"&&F.resizable("option","handles",B);!D&&B!==false&&G._makeResizable(B);break;case"title":A(".ui-dialog-title",G.uiDialogTitlebar).html(""+(B||" "));break;case"width":E=true;break;}A.Widget.prototype._setOption.apply(G,arguments);E&&G._size();},_size:function(){var C=this.options,B;this.element.css({width:"auto",minHeight:0,height:0});B=this.uiDialog.css({height:"auto",width:C.width}).height();this.element.css(C.height==="auto"?{minHeight:Math.max(C.minHeight-B,0),height:"auto"}:{minHeight:0,height:Math.max(C.height-B,0)}).show();this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight());}});A.extend(A.ui.dialog,{version:"1.8.1",uuid:0,maxZ:0,getTitleId:function(B){B=B.attr("id");if(!B){this.uuid+=1;B=this.uuid;}return"ui-dialog-title-"+B;},overlay:function(B){this.$el=A.ui.dialog.overlay.create(B);}});A.extend(A.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:A.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(B){return B+".dialog-overlay";}).join(" "),create:function(C){if(this.instances.length===0){setTimeout(function(){A.ui.dialog.overlay.instances.length&&A(document).bind(A.ui.dialog.overlay.events,function(D){return A(D.target).zIndex()>=A.ui.dialog.overlay.maxZ; });},1);A(document).bind("keydown.dialog-overlay",function(D){if(C.options.closeOnEscape&&D.keyCode&&D.keyCode===A.ui.keyCode.ESCAPE){C.close(D);D.preventDefault();}});A(window).bind("resize.dialog-overlay",A.ui.dialog.overlay.resize);}var B=(this.oldInstances.pop()||A("
    ").addClass("ui-widget-overlay")).appendTo(document.body).css({width:this.width(),height:this.height()});A.fn.bgiframe&&B.bgiframe();this.instances.push(B);return B;},destroy:function(C){this.oldInstances.push(this.instances.splice(A.inArray(C,this.instances),1)[0]);this.instances.length===0&&A([document,window]).unbind(".dialog-overlay");C.remove();var B=0;A.each(this.instances,function(){B=Math.max(B,this.css("z-index"));});this.maxZ=B;},height:function(){var C,B;if(A.browser.msie&&A.browser.version<7){C=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);B=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);return C")[0],{prop:0}),AX=0,AD=!Am.support.opacity&&!window.XMLHttpRequest,AI=function(){AY.hide();AZ.onerror=AZ.onload=null;AN&&AN.abort();Ad.empty();},AC=function(){Am.fancybox('

    The requested content cannot be loaded.
    Please try again later.

    ',{scrolling:"no",padding:20,transitionIn:"none",transitionOut:"none"});},AH=function(){return[Am(window).width(),Am(window).height(),Am(document).scrollLeft(),Am(document).scrollTop()];},w=function(){var B=AH(),G={},E=Al.margin,F=Al.autoScale,C=(20+E)*2,A=(20+E)*2,D=Al.padding*2;if(Al.width.toString().indexOf("%")>-1){G.width=B[0]*parseFloat(Al.width)/100-40;F=false;}else{G.width=Al.width+D;}if(Al.height.toString().indexOf("%")>-1){G.height=B[1]*parseFloat(Al.height)/100-40;F=false;}else{G.height=Al.height+D;}if(F&&(G.width>B[0]-C||G.height>B[1]-A)){if(Ak.type=="image"||Ak.type=="swf"){C+=D;A+=D;F=Math.min(Math.min(B[0]-C,Al.width)/Al.width,Math.min(B[1]-A,Al.height)/Al.height);G.width=Math.round(F*(G.width-D))+D;G.height=Math.round(F*(G.height-D))+D;}else{G.width=Math.min(G.width,B[0]-C);G.height=Math.min(G.height,B[1]-A);}}G.top=B[3]+(B[1]-(G.height+40))*0.5;G.left=B[2]+(B[0]-(G.width+40))*0.5;if(Al.autoScale===false){G.top=Math.max(B[3]+E,G.top);G.left=Math.max(B[2]+E,G.left);}return G;},r=function(A){if(A&&A.length){switch(Al.titlePosition){case"inside":return A;case"over":return''+A+"";default:return''+A+'';}}return false;},o=function(){var A=Al.title,C=Ae.width-Al.padding*2,B="fancybox-title-"+Al.titlePosition;Am("#fancybox-title").remove();AX=0;if(Al.titleShow!==false){A=Am.isFunction(Al.titleFormat)?Al.titleFormat(A,Ag,Ac,Al):r(A);if(!(!A||A==="")){Am('
    ').css({width:C,paddingLeft:Al.padding,paddingRight:Al.padding}).html(A).appendTo("body");switch(Al.titlePosition){case"inside":AX=Am("#fancybox-title").outerHeight(true)-Al.padding;Ae.height+=AX;break;case"over":Am("#fancybox-title").css("bottom",Al.padding);break;default:Am("#fancybox-title").css("bottom",Am("#fancybox-title").outerHeight(true)*-1);break;}Am("#fancybox-title").appendTo(AO).hide();}}},f=function(){Am(document).unbind("keydown.fb").bind("keydown.fb",function(A){if(A.keyCode==27&&Al.enableEscapeButton){A.preventDefault();Am.fancybox.close();}else{if(A.keyCode==37){A.preventDefault();Am.fancybox.prev();}else{if(A.keyCode==39){A.preventDefault();Am.fancybox.next();}}}});if(Am.fn.mousewheel){Aj.unbind("mousewheel.fb");Ag.length>1&&Aj.bind("mousewheel.fb",function(A,B){A.preventDefault();Ai||B===0||(B>0?Am.fancybox.prev():Am.fancybox.next());});}if(Al.showNavArrows){if(Al.cyclic&&Ag.length>1||Ac!==0){AR.show();}if(Al.cyclic&&Ag.length>1||Ac!=Ag.length-1){AQ.show();}}},d=function(){var A,B;if(Ag.length-1>Ac){A=Ag[Ac+1].href;if(typeof A!=="undefined"&&A.match(AL)){B=new Image;B.src=A;}}if(Ac>0){A=Ag[Ac-1].href;if(typeof A!=="undefined"&&A.match(AL)){B=new Image;B.src=A;}}},AG=function(){Ah.css("overflow",Al.scrolling=="auto"?Al.type=="image"||Al.type=="iframe"||Al.type=="swf"?"hidden":"auto":Al.scrolling=="yes"?"auto":"visible");if(!Am.support.opacity){Ah.get(0).style.removeAttribute("filter");Aj.get(0).style.removeAttribute("filter");}Am("#fancybox-title").show();Al.hideOnContentClick&&Ah.one("click",Am.fancybox.close);Al.hideOnOverlayClick&&AW.one("click",Am.fancybox.close);Al.showCloseButton&&AU.show();f();Am(window).bind("resize.fb",Am.fancybox.center);Al.centerOnScroll?Am(window).bind("scroll.fb",Am.fancybox.center):Am(window).unbind("scroll.fb");Am.isFunction(Al.onComplete)&&Al.onComplete(Ag,Ac,Al);Ai=false;d();},AF=function(A){var E=Math.round(Af.width+(Ae.width-Af.width)*A),C=Math.round(Af.height+(Ae.height-Af.height)*A),D=Math.round(Af.top+(Ae.top-Af.top)*A),B=Math.round(Af.left+(Ae.left-Af.left)*A);Aj.css({width:E+"px",height:C+"px",top:D+"px",left:B+"px"});E=Math.max(E-Al.padding*2,0);C=Math.max(C-(Al.padding*2+AX*A),0);Ah.css({width:E+"px",height:C+"px"});if(typeof Ae.opacity!=="undefined"){Aj.css("opacity",A<0.5?0.5:A);}},a=function(A){var B=A.offset();B.top+=parseFloat(A.css("paddingTop"))||0;B.left+=parseFloat(A.css("paddingLeft"))||0;B.top+=parseFloat(A.css("border-top-width"))||0;B.left+=parseFloat(A.css("border-left-width"))||0;B.width=A.width();B.height=A.height();return B;},AB=function(){var A=Ak.orig?Am(Ak.orig):false,B={};if(A&&A.length){A=a(A);B={width:A.width+Al.padding*2,height:A.height+Al.padding*2,top:A.top-Al.padding-20,left:A.left-Al.padding-20};}else{A=AH();B={width:1,height:1,top:A[3]+A[1]*0.5,left:A[2]+A[0]*0.5};}return B;},AE=function(){AY.hide();if(Aj.is(":visible")&&Am.isFunction(Al.onCleanup)){if(Al.onCleanup(Ag,Ac,Al)===false){Am.event.trigger("fancybox-cancel");Ai=false;return ;}}Ag=Aa;Ac=Ab;Al=Ak;Ah.get(0).scrollTop=0;Ah.get(0).scrollLeft=0;if(Al.overlayShow){AD&&Am("select:not(#fancybox-tmp select)").filter(function(){return this.style.visibility!=="hidden";}).css({visibility:"hidden"}).one("fancybox-cleanup",function(){this.style.visibility="inherit";});AW.css({"background-color":Al.overlayColor,opacity:Al.overlayOpacity}).unbind().show();}Ae=w();o();if(Aj.is(":visible")){Am(AU.add(AR).add(AQ)).hide();var A=Aj.position(),B;Af={top:A.top,left:A.left,width:Aj.width(),height:Aj.height()};B=Af.width==Ae.width&&Af.height==Ae.height;Ah.fadeOut(Al.changeFade,function(){var C=function(){Ah.html(Ad.contents()).fadeIn(Al.changeFade,AG); };Am.event.trigger("fancybox-change");Ah.empty().css("overflow","hidden");if(B){Ah.css({top:Al.padding,left:Al.padding,width:Math.max(Ae.width-Al.padding*2,1),height:Math.max(Ae.height-Al.padding*2-AX,1)});C();}else{Ah.css({top:Al.padding,left:Al.padding,width:Math.max(Af.width-Al.padding*2,1),height:Math.max(Af.height-Al.padding*2,1)});AV.prop=0;Am(AV).animate({prop:1},{duration:Al.changeSpeed,easing:Al.easingChange,step:AF,complete:C});}});}else{Aj.css("opacity",1);if(Al.transitionIn=="elastic"){Af=AB();Ah.css({top:Al.padding,left:Al.padding,width:Math.max(Af.width-Al.padding*2,1),height:Math.max(Af.height-Al.padding*2,1)}).html(Ad.contents());Aj.css(Af).show();if(Al.opacity){Ae.opacity=0;}AV.prop=0;Am(AV).animate({prop:1},{duration:Al.speedIn,easing:Al.easingIn,step:AF,complete:AG});}else{Ah.css({top:Al.padding,left:Al.padding,width:Math.max(Ae.width-Al.padding*2,1),height:Math.max(Ae.height-Al.padding*2-AX,1)}).html(Ad.contents());Aj.css(Ae).fadeIn(Al.transitionIn=="none"?0:Al.speedIn,AG);}}},AM=function(){Ad.width(Ak.width);Ad.height(Ak.height);if(Ak.width=="auto"){Ak.width=Ad.width();}if(Ak.height=="auto"){Ak.height=Ad.height();}AE();},R=function(){Ai=true;Ak.width=AZ.width;Ak.height=AZ.height;Am("").attr({id:"fancybox-img",src:AZ.src,alt:Ak.title}).appendTo(Ad);AE();},AP=function(){AI();var B=Aa[Ab],F,D,E,C,A;Ak=Am.extend({},Am.fn.fancybox.defaults,typeof Am(B).data("fancybox")=="undefined"?Ak:Am(B).data("fancybox"));E=B.title||Am(B).title||Ak.title||"";if(B.nodeName&&!Ak.orig){Ak.orig=Am(B).children("img:first").length?Am(B).children("img:first"):Am(B);}if(E===""&&Ak.orig){E=Ak.orig.attr("alt");}F=B.nodeName&&/^(?:javascript|#)/i.test(B.href)?Ak.href||null:Ak.href||B.href||null;if(Ak.type){D=Ak.type;if(!F){F=Ak.content;}}else{if(Ak.content){D="html";}else{if(F){if(F.match(AL)){D="image";}else{if(F.match(AA)){D="swf";}else{if(Am(B).hasClass("iframe")){D="iframe";}else{if(F.match(/#/)){B=F.substr(F.indexOf("#"));D=Am(B).length>0?"inline":"ajax";}else{D="ajax";}}}}}else{D="inline";}}}Ak.type=D;Ak.href=F;Ak.title=E;if(Ak.autoDimensions&&Ak.type!=="iframe"&&Ak.type!=="swf"){Ak.width="auto";Ak.height="auto";}if(Ak.modal){Ak.overlayShow=true;Ak.hideOnOverlayClick=false;Ak.hideOnContentClick=false;Ak.enableEscapeButton=false;Ak.showCloseButton=false;}if(Am.isFunction(Ak.onStart)){if(Ak.onStart(Aa,Ab,Ak)===false){Ai=false;return ;}}Ad.css("padding",20+Ak.padding+Ak.margin);Am(".fancybox-inline-tmp").unbind("fancybox-cancel").bind("fancybox-change",function(){Am(this).replaceWith(Ah.children());});switch(D){case"html":Ad.html(Ak.content);AM();break;case"inline":Am('
    ').hide().insertBefore(Am(B)).bind("fancybox-cleanup",function(){Am(this).replaceWith(Ah.children());}).bind("fancybox-cancel",function(){Am(this).replaceWith(Ad.children());});Am(B).appendTo(Ad);AM();break;case"image":Ai=false;Am.fancybox.showActivity();AZ=new Image;AZ.onerror=function(){AC();};AZ.onload=function(){AZ.onerror=null;AZ.onload=null;R();};AZ.src=F;break;case"swf":C='';A="";Am.each(Ak.swf,function(H,G){C+='';A+=" "+H+'="'+G+'"';});C+='";Ad.html(C);AM();break;case"ajax":B=F.split("#",2);D=Ak.ajax.data||{};if(B.length>1){F=B[0];if(typeof D=="string"){D+="&selector="+B[1];}else{D.selector=B[1];}}Ai=false;Am.fancybox.showActivity();AN=Am.ajax(Am.extend(Ak.ajax,{url:F,data:D,error:AC,success:function(G){if(AN.status==200){Ad.html(G);AM();}}}));break;case"iframe":Am('').appendTo(Ad);AE();break;}},AT=function(){if(AY.is(":visible")){Am("div",AY).css("top",AJ*-40+"px");AJ=(AJ+1)%12;}else{clearInterval(AK);}},AS=function(){if(!Am("#fancybox-wrap").length){Am("body").append(Ad=Am('
    '),AY=Am('
    '),AW=Am('
    '),Aj=Am('
    '));if(!Am.support.opacity){Aj.addClass("fancybox-ie");AY.addClass("fancybox-ie");}AO=Am('
    ').append('
    ').appendTo(Aj);AO.append(Ah=Am('
    '),AU=Am(''),AR=Am(''),AQ=Am(''));AU.click(Am.fancybox.close);AY.click(Am.fancybox.cancel);AR.click(function(A){A.preventDefault();Am.fancybox.prev();});AQ.click(function(A){A.preventDefault();Am.fancybox.next();});if(AD){AW.get(0).style.setExpression("height","document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight + 'px'");AY.get(0).style.setExpression("top","(-20 + (document.documentElement.clientHeight ? document.documentElement.clientHeight/2 : document.body.clientHeight/2 ) + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop )) + 'px'");AO.prepend('');}}};Am.fn.fancybox=function(A){Am(this).data("fancybox",Am.extend({},A,Am.metadata?Am(this).metadata():{})).unbind("click.fb").bind("click.fb",function(B){B.preventDefault();if(!Ai){Ai=true;Am(this).blur();Aa=[];Ab=0;B=Am(this).attr("rel")||"";if(!B||B==""||B==="nofollow"){Aa.push(this);}else{Aa=Am("a[rel="+B+"], area[rel="+B+"]");Ab=Aa.index(this);}AP();return false;}});return this;};Am.fancybox=function(A,D){if(!Ai){Ai=true;D=typeof D!=="undefined"?D:{};Aa=[];Ab=D.index||0;if(Am.isArray(A)){for(var B=0,C=A.length;BAa.length||Ab<0){Ab=0;}AP();}};Am.fancybox.showActivity=function(){clearInterval(AK);AY.show();AK=setInterval(AT,66);};Am.fancybox.hideActivity=function(){AY.hide();};Am.fancybox.next=function(){return Am.fancybox.pos(Ac+1);};Am.fancybox.prev=function(){return Am.fancybox.pos(Ac-1);};Am.fancybox.pos=function(A){if(!Ai){A=parseInt(A,10);if(A>-1&&Ag.length>A){Ab=A;AP();}if(Al.cyclic&&Ag.length>1&&A<0){Ab=Ag.length-1;AP();}if(Al.cyclic&&Ag.length>1&&A>=Ag.length){Ab=0;AP();}}};Am.fancybox.cancel=function(){if(!Ai){Ai=true;Am.event.trigger("fancybox-cancel");AI();Ak&&Am.isFunction(Ak.onCancel)&&Ak.onCancel(Aa,Ab,Ak);Ai=false;}};Am.fancybox.close=function(){function A(){AW.fadeOut("fast");Aj.hide();Am.event.trigger("fancybox-cleanup");Ah.empty();Am.isFunction(Al.onClosed)&&Al.onClosed(Ag,Ac,Al);Ag=Ak=[];Ac=Ab=0;Al=Ak={};Ai=false;}if(!(Ai||Aj.is(":hidden"))){Ai=true;if(Al&&Am.isFunction(Al.onCleanup)){if(Al.onCleanup(Ag,Ac,Al)===false){Ai=false;return ;}}AI();Am(AU.add(AR).add(AQ)).hide();Am("#fancybox-title").remove();Aj.add(Ah).add(AW).unbind();Am(window).unbind("resize.fb scroll.fb");Am(document).unbind("keydown.fb");Ah.css("overflow","hidden");if(Al.transitionOut=="elastic"){Af=AB();var B=Aj.position();Ae={top:B.top,left:B.left,width:Aj.width(),height:Aj.height()};if(Al.opacity){Ae.opacity=1;}AV.prop=1; Am(AV).animate({prop:0},{duration:Al.speedOut,easing:Al.easingOut,step:AF,complete:A});}else{Aj.fadeOut(Al.transitionOut=="none"?0:Al.speedOut,A);}}};Am.fancybox.resize=function(){var A,B;if(!(Ai||Aj.is(":hidden"))){Ai=true;A=Ah.wrapInner("
    ").children();B=A.height();Aj.css({height:B+Al.padding*2+AX});Ah.css({height:B});A.replaceWith(A.children());Am.fancybox.center();}};Am.fancybox.center=function(){Ai=true;var A=AH(),C=Al.margin,B={};B.top=A[3]+(A[1]-(Aj.height()-AX+40))*0.5;B.left=A[2]+(A[0]-(Aj.width()+40))*0.5;B.top=Math.max(A[3]+C,B.top);B.left=Math.max(A[2]+C,B.left);Aj.css(B);Ai=false;};Am.fn.fancybox.defaults={padding:10,margin:20,opacity:false,modal:false,cyclic:false,scrolling:"auto",width:560,height:340,autoScale:true,autoDimensions:true,centerOnScroll:false,ajax:{},swf:{wmode:"transparent"},hideOnOverlayClick:true,hideOnContentClick:false,overlayShow:true,overlayOpacity:0.3,overlayColor:"#666",titleShow:true,titlePosition:"outside",titleFormat:null,transitionIn:"fade",transitionOut:"fade",speedIn:300,speedOut:300,changeSpeed:300,changeFade:"fast",easingIn:"swing",easingOut:"swing",showCloseButton:true,showNavArrows:true,enableEscapeButton:true,onStart:null,onCancel:null,onComplete:null,onCleanup:null,onClosed:null};Am(document).ready(function(){AS();});})(jQuery);(function(jQuery){eval(function(p,a,c,k,e,r){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36));};if(!"".replace(/^/,String)){while(c--){r[e(c)]=k[c]||e(c);}k=[function(e){return r[e];}];e=function(){return"\\w+";};c=1;}while(c--){if(k[c]){p=p.replace(new RegExp("\\b"+e(c)+"\\b","g"),k[c]);}}return p;}("h.i['1a']=h.i['z'];h.O(h.i,{y:'D',z:9(x,t,b,c,d){6 h.i[h.i.y](x,t,b,c,d)},17:9(x,t,b,c,d){6 c*(t/=d)*t+b},D:9(x,t,b,c,d){6-c*(t/=d)*(t-2)+b},13:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t+b;6-c/2*((--t)*(t-2)-1)+b},X:9(x,t,b,c,d){6 c*(t/=d)*t*t+b},U:9(x,t,b,c,d){6 c*((t=t/d-1)*t*t+1)+b},R:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t*t+b;6 c/2*((t-=2)*t*t+2)+b},N:9(x,t,b,c,d){6 c*(t/=d)*t*t*t+b},M:9(x,t,b,c,d){6-c*((t=t/d-1)*t*t*t-1)+b},L:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t*t*t+b;6-c/2*((t-=2)*t*t*t-2)+b},K:9(x,t,b,c,d){6 c*(t/=d)*t*t*t*t+b},J:9(x,t,b,c,d){6 c*((t=t/d-1)*t*t*t*t+1)+b},I:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t*t*t*t+b;6 c/2*((t-=2)*t*t*t*t+2)+b},G:9(x,t,b,c,d){6-c*8.C(t/d*(8.g/2))+c+b},15:9(x,t,b,c,d){6 c*8.n(t/d*(8.g/2))+b},12:9(x,t,b,c,d){6-c/2*(8.C(8.g*t/d)-1)+b},Z:9(x,t,b,c,d){6(t==0)?b:c*8.j(2,10*(t/d-1))+b},Y:9(x,t,b,c,d){6(t==d)?b+c:c*(-8.j(2,-10*t/d)+1)+b},W:9(x,t,b,c,d){e(t==0)6 b;e(t==d)6 b+c;e((t/=d/2)<1)6 c/2*8.j(2,10*(t-1))+b;6 c/2*(-8.j(2,-10*--t)+2)+b},V:9(x,t,b,c,d){6-c*(8.o(1-(t/=d)*t)-1)+b},S:9(x,t,b,c,d){6 c*8.o(1-(t=t/d-1)*t)+b},Q:9(x,t,b,c,d){e((t/=d/2)<1)6-c/2*(8.o(1-t*t)-1)+b;6 c/2*(8.o(1-(t-=2)*t)+1)+b},P:9(x,t,b,c,d){f s=1.l;f p=0;f a=c;e(t==0)6 b;e((t/=d)==1)6 b+c;e(!p)p=d*.3;e(a<8.w(c)){a=c;f s=p/4}m f s=p/(2*8.g)*8.r(c/a);6-(a*8.j(2,10*(t-=1))*8.n((t*d-s)*(2*8.g)/p))+b},H:9(x,t,b,c,d){f s=1.l;f p=0;f a=c;e(t==0)6 b;e((t/=d)==1)6 b+c;e(!p)p=d*.3;e(a<8.w(c)){a=c;f s=p/4}m f s=p/(2*8.g)*8.r(c/a);6 a*8.j(2,-10*t)*8.n((t*d-s)*(2*8.g)/p)+c+b},T:9(x,t,b,c,d){f s=1.l;f p=0;f a=c;e(t==0)6 b;e((t/=d/2)==2)6 b+c;e(!p)p=d*(.3*1.5);e(a<8.w(c)){a=c;f s=p/4}m f s=p/(2*8.g)*8.r(c/a);e(t<1)6-.5*(a*8.j(2,10*(t-=1))*8.n((t*d-s)*(2*8.g)/p))+b;6 a*8.j(2,-10*(t-=1))*8.n((t*d-s)*(2*8.g)/p)*.5+c+b},F:9(x,t,b,c,d,s){e(s==u)s=1.l;6 c*(t/=d)*t*((s+1)*t-s)+b},E:9(x,t,b,c,d,s){e(s==u)s=1.l;6 c*((t=t/d-1)*t*((s+1)*t+s)+1)+b},16:9(x,t,b,c,d,s){e(s==u)s=1.l;e((t/=d/2)<1)6 c/2*(t*t*(((s*=(1.B))+1)*t-s))+b;6 c/2*((t-=2)*t*(((s*=(1.B))+1)*t+s)+2)+b},A:9(x,t,b,c,d){6 c-h.i.v(x,d-t,0,c,d)+b},v:9(x,t,b,c,d){e((t/=d)<(1/2.k)){6 c*(7.q*t*t)+b}m e(t<(2/2.k)){6 c*(7.q*(t-=(1.5/2.k))*t+.k)+b}m e(t<(2.5/2.k)){6 c*(7.q*(t-=(2.14/2.k))*t+.11)+b}m{6 c*(7.q*(t-=(2.18/2.k))*t+.19)+b}},1b:9(x,t,b,c,d){e(t
    ',"insertBefore","echo-submit-header");D.extendRenderer("Submit","auth",D.renderers.Submit.auth);D.extendRenderer("Submit","header",D.renderers.Submit.header);D.extendRenderer("Submit","container",D.renderers.Submit.container);D.extendRenderer("Submit","postButton",D.renderers.Submit.postButton);D.extendRenderer("Submit","forcedLoginUserInfo",D.renderers.Submit.forcedLoginUserInfo);D.addCss(D.css);}});A.css=".echo-submit-forcedLoginUserInfoMessage { font-size: 14px; font-weight: bold; }";A.addLabels({"youMustBeLoggedIn":"You must be logged in to comment"});A.renderers={"Submit":{}};A.renderers.Submit.auth=function(E,F){var D=this;if(!D.user.get("sessionID")||D.config.get("mode")=="edit"){return ;}var C=B.foldl({},["Edit","Login","Signup"],function(G,H){H[G.toLowerCase()]=A.config.get(D,"identityManager"+G);});new Echo.Auth(A.assembleConfig(D,{"target":E,"identityManager":C}));};A.renderers.Submit.container=function(D,E){var C=this;C.parentRenderer("container",arguments);D.removeClass("echo-submit-logged echo-submit-anonymous echo-submit-forcedLogin");D.addClass("echo-submit-"+A.getStatus(C));};A.renderers.Submit.header=function(E,F){var D=this;var C=A.getStatus(D);if(C=="forcedLogin"){return D.render("forcedLoginUserInfo",E,F);}if(C=="logged"){E.empty();return ;}return D.parentRenderer("header",arguments);};A.renderers.Submit.postButton=function(D,F){var C=this;var E=A.get(C,"postButtonHandler");if(!E){E=function(G){if(C.user.logged()){G.stopImmediatePropagation();if(!C.highlightMandatory(C.dom.get("text"))){C.post();}}else{if(C.config.get("mode")!="edit"&&A.getPermissions(C)=="forceLogin"){G.stopImmediatePropagation();C.dom.get("forcedLoginUserInfoMessage").css({"color":"red"});}}};A.set(C,"postButtonHandler",E);}D.unbind("click",E).bind("click",E);C.parentRenderer("postButton",arguments);};A.renderers.Submit.forcedLoginUserInfo=function(C,G){var F="echo-submit-forcedLoginUserInfo";var E='
    '+''+"{Data:label}"+""+"
    ";var D={"Message":function(H){G.set("forcedLoginUserInfoMessage",H);}};var E=this.substitute(E,{"prefix":F,"label":A.label("youMustBeLoggedIn")});return B.toDOM(E,F,D).content;};A.getPermissions=function(C){return A.config.get(C,"submitPermissions","allowGuest");};A.getStatus=function(C){if(C.user.logged()){return"logged";}if(A.getPermissions(C)=="forceLogin"){return"forcedLogin";}return"anonymous";};})(jQuery);(function(B){var A=Echo.createPlugin({"name":"Reply","applications":["Stream"],"dependencies":[{"application":"Submit","url":"//www.washingtonpost.com/rw/sites/twpweb/js/echo2/v2/core/submit.js"}],"init":function(D,C){if(!Echo.Global){Echo.Global={};}D.extendRenderer("Item","children",D.renderers.Item.children);D.extendRenderer("Item","replyForm",D.renderers.Item.replyForm);D.extendRenderer("Item","container",D.renderers.Item.container);D.extendTemplate("Item",D.template,"insertAsLastChild","echo-item-content");D.listenEvents(C);D.addItemControl(C,D.assembleControl("Reply",C));}});A.template='
    ';A.addLabels({"replyControl":"Reply"}); A.assembleControl=function(D,C){var E=function(){var G=this;var H=G.dom.get("replyForm");if(!A.get(G,"form")){A.createForm(G,H);}if(A.get(G,"form.initialized")){if(G.depth||!G.children.length){A.view(G,"toggle");G.rerender("container");}}else{G.rerender("replyForm");}var F=A.get(G,"form");F.instance.switchMode();if(F.visible){if(F.instance.dom){text=F.instance.dom.get("text");if(text&&text.is(":visible")){text.focus();return ;}}H.get(0).scrollIntoView(false);}};return function(){var F=this;return{"name":"Reply","label":A.label("replyControl"),"visible":F.depth
    ';A.addLabels({"flaggedThis":" flagged this.","flagControl":"Flag","unflagControl":"Flagged","flagProcessing":"Flagging...","unflagProcessing":"Unflagging..."});A.assembleControl=function(D,C){var E=function(){if(D=="Flag"&&wp_e2.echo_user.logged()){var F=this;var G=B("#comment-flag-list").clone();G.bind({"mouseleave":function(H){B(this).remove();F.rerender();}});G.find("li").bind({"click":function(I){I.stopPropagation();var H=B(this).attr("id");var J={"verb":"flag","target":F.id};F.controls[A.name+"."+D].element.empty().append(A.label(D.toLowerCase()+"Processing"));B.get(A.config.get(C,"submissionProxyURL","",true),{"appkey":C.config.get("appkey"),"content":B.object2JSON(J),"sessionID":F.user.get("sessionID","")},function(){C.startLiveUpdates(true);var K={"verb":"mark","target":F.id};K["markers"]=H;B.get(C.config.get(A.config("proxyURL")),{"appkey":C.config.get("appkey"),"content":B.object2JSON(K),"sessionID":F.user.get("sessionID","")},function(){var L=A.topic(C,"on"+D+"Complete");A.publish(C,L,C.prepareBroadcastParams({"item":{"data":F.data,"target":F.dom.content}}));B(this).find("#comment-flag-list").remove();},"jsonp");},"jsonp");}});G.appendTo(F.controls[A.name+"."+D].element).show();}};return function(){var G=this;var F=G.data.object.flags.length;var H=(B.map(G.data.object.flags,function(I){if(G.user.hasIdentity(I.actor.id)){return I;}})).length>0?"Unflag":"Flag";return{"name":D,"label":A.label(D.toLowerCase()+"Control")+(G.user.isAdmin()&&F?" ("+F+")":""),"visible":H==D,"onetime":true,"callback":E};};};A.controlRenderer=function(E,J,C){var D=this;var G=this;if(this.data.object.status=="ModeratorDeleted"||!C||!C.name){return ;}if(C.name=="Flag"||C.name=="Unflag"){C.template=((wp_e2.echo_user.logged())?"":'
    ')+'{Data:label}'+((wp_e2.echo_user.logged())?"":"
    ");}var F=C.template||'{Data:label}';var H={"label":C.label||"","name":C.name,"count":C.count};var I=D.parentRenderer("control",arguments);if(C.name=="Flag"){}else{if(C.name=="Unflag"){}}return I;};A.css=".echo-item-flags { background: url(//www.washingtonpost.com/rw/sites/twpweb/img/echo2/core/curation/status/communityflagged.png) no-repeat 0px 4px; padding: 0px 0px 4px 21px; }";})(jQuery);(function($){var escapeable=/["\\\x00-\x1f\x7f-\x9f]/g,meta={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};$.toJSON=typeof JSON==="object"&&JSON.stringify?JSON.stringify:function(o){if(o===null){return"null";}var type=typeof o;if(type==="undefined"){return undefined;}if(type==="number"||type==="boolean"){return""+o;}if(type==="string"){return $.quoteString(o);}if(type==="object"){if(typeof o.toJSON==="function"){return $.toJSON(o.toJSON());}if(o.constructor===Date){var month=o.getUTCMonth()+1,day=o.getUTCDate(),year=o.getUTCFullYear(),hours=o.getUTCHours(),minutes=o.getUTCMinutes(),seconds=o.getUTCSeconds(),milli=o.getUTCMilliseconds();if(month<10){month="0"+month;}if(day<10){day="0"+day;}if(hours<10){hours="0"+hours;}if(minutes<10){minutes="0"+minutes;}if(seconds<10){seconds="0"+seconds;}if(milli<100){milli="0"+milli;}if(milli<10){milli="0"+milli;}return'"'+year+"-"+month+"-"+day+"T"+hours+":"+minutes+":"+seconds+"."+milli+'Z"'; }if(o.constructor===Array){var ret=[];for(var i=0;i';A.addLabels({"likeThis":" like this.","likesThis":" likes this.","likeControl":"Like","unlikeControl":"Unlike","likeProcessing":"Liking...","unlikeProcessing":"Unliking..."});A.getSubmissionProxyURL=function(C){if(!wp_e2.echo_user.logged()){C.config.set("submissionProxyURL",C.config.get(A.config("proxyURL")));}else{C.config.set("submissionProxyURL",C.config.get(A.config("echoSubmissionProxyURL")));}return C.config.get("submissionProxyURL",A.config("submissionProxyURL"));};A.assembleControl=function(D,C){var E=function(){var F=this;F.controls[A.name+"."+D].element.empty().append(A.label(D.toLowerCase()+"Processing"));B.get(A.getSubmissionProxyURL(C),{"appkey":C.config.get("appkey"),"content":B.object2JSON({"verb":D.toLowerCase(),"target":F.id}),"sessionID":F.user.get("sessionID","")},function(){var G=A.topic(C,"on"+D+"Complete");C.publish(G,C.prepareBroadcastParams({"item":{"data":F.data,"target":F.dom.content}}));C.startLiveUpdates(true);},"jsonp");};return function(){var F=this;var G=(B.map(F.data.object.likes,function(H){if(F.user.hasIdentity(H.actor.id)){return H;}})).length>0?"Unlike":"Like";return{"name":D,"label":A.label(D.toLowerCase()+"Control"),"visible":G==D,"onetime":true,"count":F.data.object.likes.length,"callback":E};};};A.recommendedRenderer=function(F,I){if(!(this.data.object.status=="ModeratorDeleted")&&this.data.object.likes.length&&this.data.object.likes.length>0){var G=this;var E=false;var H=G.data.object.accumulators.likesCount;var J=B.map(G.data.object.likes,function(K){if(K.actor.id==G.user.get("id")){E=true;H=H-1;}return K.actor;});var C=(G.data.object.likes.length==1&&E)?true:false;var D="";D="Liked by "+((C)?"you":(H+" reader"+((H>1)?"s":"")+((E)?" and you":"")));B(F).html(D);if(B(".echo-item-control-Like",F.prev()).length>0){F.insertAfter(B(".echo-item-control-recommend-Like",F.prev()));}else{if(B(".echo-item-control-Unlike",F.prev()).length>0){F.insertAfter(B(".echo-item-control-recommend-Unlike",F.prev()));}else{F.prependTo(F.prev());}}}};A.controlRenderer=function(E,I,C){var D=this;if(C.name=="Like"||C.name=="Unlike"){C.template='
    '+((wp_e2.echo_user.logged())?"":'
    ')+'{Data:label}'+((wp_e2.echo_user.logged())?"":"
    ")+"
    ";}var F=C.template||'{Data:label}';var G={"label":C.label||"","name":C.name,"count":C.count};var H=D.parentRenderer("control",arguments);if((C.name=="Like"||C.name=="Unlike")&&!wp_e2.echo_user.logged()){H.unbind("click");}if(this.data.object.status=="ModeratorDeleted"||!C||!C.name){}else{return H;}};A.css=".echo-item-likes { line-height: 16px; background: url(/rw/sites/twpweb/img/echo2/core/likes.png) no-repeat 0px 4px; padding: 0px 0px 4px 21px; }";})(jQuery);(function(B){var A=Echo.createPlugin({"name":"TWP_Stream","applications":["Stream"],"init":function(H,K){H.extendRenderer("Stream","more",H.moreRenderer);H.extendRenderer("Stream","body",H.streamBodyRenderer);H.extendRenderer("Stream","state",H.stateRenderer);H.extendRenderer("Item","avatar",H.avatarRenderer);H.extendRenderer("Item","authorName",H.authorNameRenderer);H.extendRenderer("Item","container",H.containerRenderer);H.extendRenderer("Item","subwrapper",H.subwrapperRenderer);H.extendRenderer("Item","date",H.dateRenderer);H.extendRenderer("Item","body",H.itemBodyRenderer);H.extendRenderer("Item","textToggleTruncated",H.textToggleTruncatedRenderer);H.extendRenderer("Item","control",H.controlRenderer);H.extendTemplate("Item","","replace","echo-item-avatar-wrapper");H.extendTemplate("Item","","replace","echo-item-authorName");H.extendTemplate("Item",H.headerWrapperTemplate,"insertBefore","echo-item-subcontainer");H.extendTemplate("Item",H.footerNewTemplate,"replace","echo-item-footer");H.extendRenderer("Item","sourceIcon",H.sourceIconRenderer);H.extendRenderer("Item","from",H.fromRenderer);H.extendRenderer("Item","expandChildrenLabel",H.expandChildrenLabelRenderer);H.extendRenderer("Item","ignoreUser",H.ignoreUserRenderer);H.extendRenderer("Item","footer",H.footerRenderer);var E=K.config.get(H.config("thisContainer"));K.config.set(H.config("thisContainer"),E);var N=wp_e2[E].isallcomments||false;K.config.set(H.config("isAllComments"),N);var C=wp_e2[E].webType||"article_story";K.config.set(H.config("webType"),C);var D=(typeof wp_e2[E].display_more=="undefined")?true:wp_e2[E].display_more;K.config.set(H.config("display_more"),D);K.config.set(H.config("allCommentsURL"),wp_e2[E].allCommentsURL);var F=wp_e2[E].allow_photos||false;K.config.set(H.config("allowPhotos"),F);var M=wp_e2[E].allow_videos||false;K.config.set(H.config("allowVideos"),M);var J=wp_e2[E].allow_links||true;K.config.set(H.config("allowLinks"),J);var L=wp_e2[E].markerDisplay||{};K.config.set(H.config("markerDisplay"),L);var G=(wp_e2[E].streamTabs.top)?wp_e2[E].streamTabs.top.userMarkers:[];K.config.set(H.config("markerListTop"),G);var I=wp_e2.bookmarkletUrl||"";K.config.set(H.config("bookmarkletUrl"),I);K.config.set("fadeTimeout","0");K.config.set("flashColor","#ffffff");K.config.set("reTag",wp_e2[E].retag);H.addItemControl(K,function(){var O=this;return{"name":"Grab","label":"Grab This","visible":O.user.logged()&&(typeof O.user.account.markers!="undefined"&&O.user.account.markers.staff==true)&&O.data.target.id!=O.conversation,"callback":function(){var P=new Date(O.data.object.published);url=K.config.get(H.config("bookmarkletUrl"))+"?contenturl="+O.data.target.id+"&commentitemurl="+O.data.object.id+"&blurb="+O.data.object.content+"&commentusername="+O.data.actor.title+"&commentuserid="+O.data.actor.id+"&img="+O.data.actor.avatar+"&source=www.washingtonpost.com"+"&commentposteddate="+P.format("yyyymmddHHMMss"); +((typeof O.data.actor.markers!="undefined")?"&commentusermarkers="+O.data.actor.markers.join(","):"")+((typeof O.data.object.markers!="undefined")?"&commentitemmarkers="+O.data.object.markers.join(","):"");window.open(url);event.preventDefault();}};});H.getIgnoredUsers();H.listenEvents(K);}});A.getIgnoredUsers=function(E){if(typeof wp_e2!="undefined"&&(wp_e2.echo_user&&wp_e2.echo_user.logged())){var D=wp_e2.echo_user.get("id");var C=B.getJSON(wp_e2.mongoUserActionUrl+"?jsonp=?",'q={"user_id":"'+D+'","action":"Ignore"}',function(F){if(!wp_e2.ignoredUsers){wp_e2.ignoredUsers=[];B.each(F.q_results[0].rows,function(G,H){wp_e2.ignoredUsers.push(H.target_user_id);});}else{wp_e2.ignoredUsers.push(E);}});}};Echo.Localization.extend({"childrenMoreItems":"View more responses"},"Item");Echo.Localization.extend({"more":"Load more comments"},"Stream");A.headerWrapperTemplate='
    '+'
    '+'
    '+"
    "+'
    '+'
    '+''+'
    '+"
    ";A.footerNewTemplate='";A.ignoreUserTemplate="
    Ignore User
    ";A.itemMarkerArray=["post_recommended"];A.textToggleTruncatedRenderer=function(D){var C=this;if(this.data.source.name!="www.guardian.co.uk"){C.parentRenderer("textToggleTruncated",arguments);return this.label((this.textExpanded?"See Less":"See More"));}else{D.parent().find(".echo-item-textEllipses").hide();D.remove();}};A.stateRenderer=function(E){var G=this;var F=B(G.config.get("target")).closest(".echo_container").attr("id");if(wp_e2[F].includepause){var K=this;var H=this.config.get("streamStateLabel");if(!H.icon&&!H.text){return ;}var D=0;if(this.activities.state=="paused"){D=B.foldl(0,K.activities.queue,function(L,M){if(L.affectCounter){return ++M;}});}var C=this.activities.state+D;if(C==this.activities.lastState){return ;}E=(E||this.dom.get("state")).empty();if(!this.activities.lastState&&this.config.get("streamStateToggleBy")=="button"){E.addClass("echo-linkColor echo-clickable").click(function(L){K.setStreamState(K.activities.state=="paused"?"live":"paused");});}var J=this.activities.state;if(this.activities.state=="paused"){J="Comments Paused";}else{J="Comments Live";}var I={"picture":'',"message":this.config.get("streamStateToggleBy")=="button"?''+J+"":''+J+"","count":' ({Data:count} {Label:new})'};if(H.icon){E.append(I.picture);}if(H.text){E.append(this.substitute(I.message));if(D&&this.activities.state=="paused"){E.append(this.substitute(I.count,{"count":D}));}}this.activities.lastState=C;}};A.moreRenderer=function(D,E){var C=this;if(C.config.get(A.config("display_more"))===false){D.remove();}else{var C=this;C.parentRenderer("more",arguments);if(C.config.get(A.config("webType"))=="promo_story"){B(D).html("View more responses");}}};A.controlRenderer=function(E,I,C){var D=this;if(C.name=="MarkAsCommunityFlagged"||C.name=="UnmarkAsCommunityFlagged"){thisTemplate=((wp_e2.echo_user.logged())?"":'
    ')+'{Data:label}'+((wp_e2.echo_user.logged())?"":"
    ");}var F=C.template||'{Data:label}';var G={"label":C.label||"","name":C.name,"count":C.count};var H=D.parentRenderer("control",arguments);if(this.data.object.status=="ModeratorDeleted"||!C||!C.name){}else{return H;}};A.streamBodyRenderer=function(E,D){var I=this;I.parentRenderer("body",arguments);var F;var N=(I.config.get(A.config("webType")).toLowerCase()==="discussion_story")?"Posts":"Comments";var G=(I.config.get(A.config("webType"))==="discussion_story")?"View all Posts":"View all Comments";var H;if(I.config.get(A.config("isAllComments"))||(I.config.get(A.config("webType")).toLowerCase()=="blogstory")){H=''+G+". ";}else{H=''+G+". ";}var C="";var K=I.config.get(A.config("markerDisplay"));var J=B(".comment-stream-tabs .tab.active a",B(I.config.get("target")).closest(".echo_stream_container")).attr("rel");if(J=="top"){C=B("#echo-more-comments-top");var M=B(".badge-list",C);var L="";if(M.length>0){B.each(I.config.get(A.config("markerListTop")),function(O,P){if(P!="staff"){L+=(typeof K[P]!=="undefined")?K[P]+", ":"";}});M.html(L.substring(0,L.lastIndexOf(", ")));}F="No Top "+N+" are available at the moment. "+H+C.html();}else{F="No "+N+" are available at the moment.";}Echo.Localization.extend({"emptyStream":''+F+"","waiting":"Building list of "+N.toLowerCase()+", please wait..."},"Stream");};A.avatarRenderer=function(D,E){var C=this;C.parentRenderer("avatar",arguments);if(!this.data.actor.avatar){B(D).html('');}else{if(this.data.object.status=="ModeratorDeleted"){B(D).html('');}else{B(D).html('');}}};A.authorNameRenderer=function(D,E){var C=this;C.parentRenderer("authorName",arguments);if(this.data.object.status=="ModeratorDeleted"){B(D).html("postmoderator");}else{if(this.data.provider.name=="Arktan"&&this.data.source.name=="Twitter"){B(D).html(''+this.data.actor.title+"");}else{B(D).html(this.data.actor.title);}}};A.subwrapperRenderer=function(E,G){var C=this;C.parentRenderer("subwrapper",arguments);var D=[];var F=[];B.map(this.data.actor.roles||[],function(H){if(H!=""){D.push("echo-item-user-role-"+H);}});B.map(this.data.actor.markers||[],function(H){if(H!=""){D.push("echo-item-user-marker-"+H);markerTranslated=C.config.get(A.config("markerDisplay"))[H]||"";F.push('
    ');}});B.map(this.data.object.markers||[],function(H){if(H!=""){if(B.inArray(H,A.itemMarkerArray)>=0){markerTranslated=C.config.get(A.config("markerDisplay"))[H];F.push('
    ');D.push("echo-item-marker-"+H);}}});if(D.length){B(E).addClass(D.join(" "));}B("div.marker",E).remove();B(E).prepend(F.join(" "));};A.containerRenderer=function(E,H){var C=this;C.parentRenderer("container",arguments);var D=[];var G=[];var F;if(typeof wp_e2.ignoredUsers!=="undefined"&&wp_e2.ignoredUsers.length>0){for(x=0;x'+currDateFmt+"";prevDatePermalink=''+prevDateFmt+"";(F.format("m/d/yyyy")==new Date().format("m/d/yyyy"))?B(E).html(currDatePermalink):B(E).html(prevDatePermalink);}else{(F.format("m/d/yyyy")==new Date().format("m/d/yyyy"))?B(E).html(currDateFmt):B(E).html(prevDateFmt);}}};A.itemBodyRenderer=function(H,F){var J=this;J.parentRenderer("body",arguments);var G=["img"];var E=["object","embed","iframe"];var I=["a"];var D;if(typeof wp_e2.ignoredUsers!=="undefined"&&wp_e2.ignoredUsers.length>0){for(x=0;xThis comment has been deleted by a moderator for violating the site\'s discussion policy.');}else{if(D){B(H).html("
    You are ignoring comments from this reader.
    ");}else{}}if(!J.config.get(A.config("allowPhotos"))){B.each(G,function(M,N){B(N,H).remove();});}if(!J.config.get(A.config("allowVideos"))){B.each(E,function(M,N){B(N,H).remove();});}if(!J.config.get(A.config("allowLinks"))){B.each(I,function(M,N){B(N,H).remove();});}var L=H.find(".metadata_image");if(L.length>0&&L.attr("src")!=""&&L.attr("data-src-web")!=""&&L.attr("data-src-full")!=""){var C=L.attr("data-src-web");var K=L.attr("data-src-full");if(this.data.source.name=="Instagram"){L.attr("src",K);}else{L.attr("src",C);}}else{if(L.length>0&&L.attr("data-src-web")==""){L.css("display","none");}}};A.sourceIconRenderer=function(D,E){var C=this;C.parentRenderer("sourceIcon",arguments);if((this.config.get("viaLabel.icon")&&(this.data.source.name=="washpost.com"))||(this.data.object.status=="ModeratorDeleted")){D.remove();}};A.fromRenderer=function(D,E){var C=this;C.parentRenderer("from",arguments);if((this.config.get("viaLabel.text")&&(this.data.source.name=="washpost.com"))||(this.data.object.status=="ModeratorDeleted")){D.remove();}else{if(this.data.provider.name=="Arktan"&&this.data.source.name=="Twitter"){B("a",D).attr("href",this.data.object.id);}}};A.expandChildrenLabelRenderer=function(F,E,D){var I=this;if(!this.children.length||!this.hasMoreChildren()){return ;}D=D||{};D.state=D.state||"regular";var G=B(I.config.get("target")).closest(".echo_container").attr("id");var K=I.config.get(A.config("isAllComments"))?3:1;var C=this.data.object.accumulators.repliesCount-K;var H=C>1?" more replies":" more reply";var J={"loading":{"css":"echo-item-message-loading","label":"loading"},"regular":{"css":"echo-linkColor echo-message-icon","label":"View "+C+H}};F.removeClass(J[D.state=="loading"?"regular":"loading"].css).addClass(J[D.state].css).html(this.label(J[D.state].label));};A.footerRenderer=function(G,I){var F=this;var H=this;F.parentRenderer("footer",arguments);var J=wp_e2.echo_user.get("id");var E=false;var D=0;if(typeof this.data.actor.markers=="object"){D=this.data.actor.markers.length;}if(D>0){for(x=0;x=0)||(this.data.actor.markers[x].indexOf("contrib")>=0)){E=true;D=x;}}}if(wp_e2.echo_user.logged()&&((J!=this.data.actor.id)&&(this.data.provider.name!="Arktan")&&(this.data.provider.name!="jskit")&&!E)){B(G).append(A.ignoreUserTemplate);var C=B("#"+thisContainer+" .echo-stream").data("stream");G.find("div.ignore-user").bind("click",function(){if(wp_e2.echo_user.logged()==false){return ;}var K={};K.actionData={};K.actionData.user_id=wp_e2.echo_user.get("id");K.actionData.action="Ignore";K.actionData.target_user_id=H.data.actor.id;K.actionData.target_user_name=H.data.actor.title;K.actionData.ignoring_date=(new Date).getTime();var L={};L.config={"action":"post","remoteUrl":wp_e2.mongoUserActionUrl,"data":K.actionData};TWP.Util.updateMongoDb(L);A.getIgnoredUsers(H.data.actor.id);A.IgnoreOmniture();C.refresh();});}};A.IgnoreOmniture=function(){var C=wp_e2.debug;var D={};D.eVar26="ignore - user";sendDataToOmniture("echo.ignorecomplete","event74",D);D.eVar26="";};A.listenEvents=function(C){C.subscribe("Stream.onReady",function(E,D){TWP.Comments.addSorts(D);});C.subscribe("internal.Item.onAdd",function(D,E){A.markNew(E);});};A.markNew=function(D){var C=D.item;if(C.data.target.id!=C.data.target.conversationID){C.dom.content.addClass("newComment");C.dom.content.mouseenter(function(E){C.dom.content.animate({"border-left-color":"#ffffff","border-left-width":"0"},800);});}else{C.dom.content.children(".echo-item-container").addClass("newComment");C.dom.content.children(".echo-item-container").mouseenter(function(E){C.dom.content.children(".echo-item-container").animate({"border-left-color":"#ffffff","border-left-width":"0"},800);});}};A.pauseButtonClick=function(C){C.click(function(G){var D=B("#echo_comment_stream").data("stream");var H=B(".comment-header",B("#"+thisContainer));var F=H.parents(".echo_stream_container").find(".echo-stream-body");var E=H.parents("div.echo_stream_container");if(B(G.currentTarget.parentElement).hasClass("stream-pausebutton")){D.setStreamState("paused");D.stopLiveUpdates();F.unbind("mouseleave");F.unbind("mouseenter");E.find("span.echo-stream-state-message").html("Comments are paused");E.find("div.stream-statebutton img").attr("src","/rw/sites/twpweb/img/echo2/core/control_play.png");E.find("div.stream-statebutton").removeClass("stream-pausebutton").addClass("stream-playbutton");}else{D.setStreamState("live");D.startLiveUpdates();F.bind({"mouseleave":function(){D.setStreamState("live");},"mouseenter":function(){D.setStreamState("paused");}});E.find("span.echo-stream-state-message").html("Comments are live");E.find("div.stream-statebutton img").attr("src","/rw/sites/twpweb/img/echo2/core/control_pause.png");E.find("div.stream-statebutton").removeClass("stream-playbutton").addClass("stream-pausebutton");}});};A.addPauseButton=function(F){var C=B(F.target).closest(".echo_container").attr("id");if(wp_e2[C].includepause!=false&&wp_e2[C].allow_comments){var D=B("#"+C+" .comment-header").attr("rel");var G=B(".comment-header",B("#"+C));if(G.length>0&&typeof D!="undefined"&&B(".stream-pausebutton",B("#"+C)).length==0){G.append('
    ');var E=B("div.stream-statebutton a");A.pauseButtonClick(E);}}};})(jQuery);(function(B){var A=Echo.createPlugin({"name":"TWP_Share","applications":["Stream"],"init":function(E,D){E.extendRenderer("Item","control",E.controlRenderer);var C=D.config.get(E.config("thisContainer"));D.config.set(E.config("thisContainer"),C);if(wp_e2[C].includeshare){E.addItemControl(D,function(){var F=this;return{"name":"Share","label":"Share","visible":F.data.target.id!=F.data.target.conversationID};});}}});A.controlRenderer=function(F,H,D){var E=this;var G=E.parentRenderer("control",arguments);if(this.data.object.status=="ModeratorDeleted"||!D||!D.name){}else{if(D.name=="Share"){var C=this;G.bind({"mouseenter":function(X){var Q;X.stopPropagation();if(B(X.target).hasClass("echo-item-control-Share")){if(B(this).find(".more").length==0){var T=(TWP&&TWP.Data&&TWP.Data.environment&&(TWP.Data.environment=="prod"||TWP.Data.environment=="stage"))?"41245586762":"98319225937"; var J=B(".comment-share-info").html();var Y=C.id;Y=Y.replace("http://","");var R=wp_e2[thisContainer].commentpermalinkurlfacet;var N=R+"?commentID="+Y;var V=C.data.object.context[0].title||B("h1.headline").text()||(document.title&&document.title.split(" - ")[0]);var M=C.data.actor.avatar;var L=M.indexOf("facebook");var K=M.indexOf("fbcdn");if(L>0||K>0){M="http://www.washingtonpost.com/rw/sites/twpweb/img/echo2/core/avatar-default.png";}var Z=C.data.actor.title;var I=Z+" commented on ";var U=I+V;var I=I+"...";U=U.replace(/ /g,"+");U=encodeURI(U);var O=V;V=encodeURI(V);var S=C.data.object.content;if(C.data.object.content.length>100){S=S.substr(0,100)+"...";}var W=S;S=escape(S);J=J.replace(/{shareURL}/g,N);J=J.replace(/{headline}/g,U);J=J.replace(/{summaryText}/g,S);J=J.replace(/{FBCaption}/g,V);J=J.replace(/{FBHeadline}/g,I);J=J.replace(/{readerAvatar}/g,M);J=J.replace(/{appKey}/g,T);var P=B(J);P.appendTo(B(this));P.find("a.facebook-link").bind("click",function(a){A.postCommentToFB(N,M,I,O,W);a.stopPropagation();});Q=B(this).find(".more");B(Q).show();}else{B(this).find(".more").show();}}},"mouseleave":function(I){I.stopPropagation();if(B(I.target).hasClass("echo-item-control-Share")||B(I.target).hasClass("more")||B(I.target).hasClass("morebottom")){B(this).find(".more").hide();}}});}}return G;};A.postCommentToFB=function(F,G,D,C,E){var H={method:"feed",link:F,picture:G,name:D,caption:C,description:E};FB.ui(H,wp_e2.FBShareCallback);};A.FBShareCallback=function(){debug&&window.console&&console.log&&console.log("["+(new Date()-TWP_Debug.initialTime)/1000+"]"+"echo2/v2/core/twp_comments_echo2.js - Share Complete");};})(jQuery);(function(A){Echo.Localization.extend({"post":"Submit","posting":"Submitting..."},"Submit");})(jQuery);(function(B){var A=Echo.createPlugin({"name":"SubmitForm","applications":["Submit"],"dependencies":[{"application":"Auth","url":((typeof eidosBase!=="undefined"&&eidosBase!=="")?eidosBase:"")+"/rw/sites/twpweb/js/echo2/v2/core/auth.js"}],"init":function(G,E){G.extendRenderer("Submit","header",G.headerRenderer);G.extendRenderer("Submit","container",G.containerRenderer);G.extendRenderer("Submit","postButton",G.postButtonRenderer);var D=E.config.get(G.config("thisContainer"));E.config.set(G.config("thisContainer"),D);var C=wp_e2[D].commentMaxLength||3000;E.config.set(G.config("commentMaxLength"),C);var H=wp_e2[D].display_ugc_photos||false;E.config.set(G.config("displayUGCPhotos"),H);var F=wp_e2[D].photoCommentMaxLength||500;E.config.set(G.config("photoCommentMaxLength"),F);E.config.set(G.config("proxyURL"),wp_e2.proxyURL);E.config.set(G.config("echoSubmissionProxyURL"),wp_e2.echoSubmissionProxyURL);E.config.set(G.config("pageURL"),wp_e2.pageURL);E.config.set(G.config("loginURL"),wp_e2.logInURL);E.config.set(G.config("logoutURL"),wp_e2.logOutURL);E.config.set(G.config("profileURL"),wp_e2.profileURL);E.config.set(G.config("registerURL"),wp_e2.registerURL);var I=wp_e2.isWashingtonpostDomainName()||true;E.config.set(G.config("isWashingtonpostDomain"),I);G.listenEvents(E);}});A.listenEvents=function(C){C.subscribe("Submit.onExpand",function(F,G,D){debug&&window.console&&console.log&&console.log("["+(new Date()-TWP_Debug.initialTime)/1000+"]"+"echo2/v2/core/twp_comments_echo2.js - onExpand triggered. wp_e2.echo_user.logged is: "+wp_e2.echo_user.logged());var E=B(G.target).closest(".echo_container").attr("id");B("input.echo-submit-markers",G.target).val(wp_e2[E].submitMarkers);wp_e2.setAvatarEvent();});C.subscribe("Submit.onRender",function(F,G,D){var E=B(G.target).closest(".echo_container").attr("id");featureNotification=B(".echo-feature-notification");if(featureNotification.length>0&&B("#"+E+" .comments .echo-feature-notification").length===0){featureNotification.clone().insertBefore(B("#"+E+" .echo_stream_container"));B("#"+E+" .echo-close").click(function(){B(this).parent().fadeOut("slow");});}});C.subscribe("Submit.onPostComplete",function(G,H,E){debug&&window.console&&console.log&&console.log("["+(new Date()-TWP_Debug.initialTime)/1000+"]"+"echo2/v2/core/twp_comments_echo2.js - onExpand triggered. wp_e2.echo_user.logged is: "+wp_e2.echo_user.logged());var F=B(H.target).closest(".echo_container").attr("id");if(B("#social-share-fb.active").length>0){if(typeof window.FB=="object"){var D=H.postData.objectID.substring(H.postData.objectID.indexOf("://")+3);var I={method:"feed",link:wp_e2[F].guid,name:document.title,picture:(typeof B("meta[property=og\\:image]").attr("content")!="undefined")?B("meta[property=og\\:image]").attr("content"):"",caption:"I just commented on washingtonpost.com: ",description:'"'+H.postData.content+'"'};if(wp_e2[F].display_ugc_photos===true){I.caption=B(H.postData.content).find("img").attr("alt");I.description="";}FB.ui(I,A.FBCallback);}}});};A.FBCallback=function(){var C={};C.eVar26=(wp_e2[thisContainer].display_ugc_photos===true)?"submit - ugc":"submit - comments";sendDataToOmniture("echo.fbsharecomplete","event29",C);debug&&window.console&&console.log&&console.log("["+(new Date()-TWP_Debug.initialTime)/1000+"]"+"echo2/v2/core/twp_comments_echo2.js - Post COmplete: omniture event3");C.eVar26="";};A.headerRenderer=function(G,F){var I=this;var D="";var J="";var C="";var E='Sign in';var K='Sign in';var L=(I.config.get(A.config("isWashingtonpostDomain")))?E:K;G=I.parentRenderer("header",arguments);if(I.config.get(A.config("displayUGCPhotos"))===true){J='";C='

    You do not have a valid washingtonpost.com display name. You must create a valid display name with the Washington Post to submit a photo.

    '+'';}else{J='";C='

    You do not have a valid washingtonpost.com display name. You must create a valid display name to comment or post. If you post before creating a washingtonpost.com display name, your comment will be saved while you are guided through the process to create a unique washingtonpost.com display name.

    '+'';}if(!wp_e2.echo_user.logged()){D=(TWP.isSignedIn()&&(typeof wapoIdentity!="undefined"&&!wapoIdentity.isMemberOfCommentingGroup()))?C:J;B(".echo-submit-anonymousUserInfoFields",G).append(D);}B("input.echo-submit-anonymousUserInfoUrl",G).addClass("hidden");var H=B("input.echo-submit-anonymousUserInfoName",G);H.addClass("hidden");if(H!==null){H.val("Guest");}return G;};A.containerRenderer=function(G,I){var F=this;F.parentRenderer("container",arguments);G.removeClass("echo-submit-logged echo-submit-anonymous echo-submit-forcedLogin");if(!wp_e2.echo_user.logged()){B("div.echo-submit-auth",G).addClass("hidden");}else{B("div.echo-submit-auth",G).removeClass("hidden"); }B(".echo-submit-controls p.character-limit",G).remove();var D;var E;if(B("#ugc-photo-gallery").length==0){D=F.config.get(A.config("commentMaxLength"));E=B(G).find("textarea");}else{D=F.config.get(A.config("photoCommentMaxLength"));E=B(G).find("textarea");}var J=B(".echo-submit-controls",G);if(J.length>0){charLimit='

    '+D+" characters left

    ";shareDiv='
    '+"
    ";J.prepend(shareDiv).prepend(charLimit);E.bind("keyup",function(){var K=B(this).val().length;if(K>D){B(this).val(B(this).val().substr(0,D));K=B(this).val().length;}B(".characters-remaining",G).html(D-K);});shareElm='

    Sharing Off

    '+'
    ';B(".echo_submit-share-wrapper",J).append(B(".echo-submit-post-container",G));if(wp_e2.echo_user.logged()&&B("#ugc-photo-gallery").length==0){B(".echo_submit-share-wrapper",J).prepend(shareElm);var H=B(".echo_share-fb-button",G);var C=B(".echo_share-twitter-button",G);A.socialShareButton(H);A.socialShareButton(C);}}};A.socialShareButton=function(C){C.click(function(D){shareClickDiv=B(".share-click-div",C);if(shareClickDiv.hasClass("active")){C.removeClass("active");shareClickDiv.removeClass("active");C.parent().find(".echo_share-text").text("Sharing Off");}else{C.addClass("active");shareClickDiv.addClass("active");C.parent().find(".echo_share-text").text("Sharing On");}});};A.postButtonRenderer=function(D,E){var C=this;C.parentRenderer("postButton",arguments);if(!wp_e2.echo_user.logged()){this.config.set("submissionProxyURL",C.config.get(A.config("proxyURL")));}else{this.config.set("submissionProxyURL",C.config.get(A.config("echoSubmissionProxyURL")));}};A.getStatus=function(C){if(C.user.logged()){return"logged";}if(A.getPermissions(C)=="forceLogin"){return"forcedLogin";}return"anonymous";};})(jQuery);(function(B){var A=Echo.createPlugin({"name":"SubmitAuth","applications":["Auth"],"init":function(F,E){F.extendRenderer("Auth","name",F.nameRenderer);F.extendRenderer("Auth","edit",F.editRenderer);F.extendRenderer("Auth","logout",F.logoutRenderer);F.extendRenderer("Auth","avatar",F.avatarRenderer);var D=E.config.get(F.config("thisContainer"));E.config.set(F.config("thisContainer"),D);var C=wp_e2[D].webType||"article_story";E.config.set(F.config("webType"),C);var G=wp_e2[D].display_ugc_photos||false;E.config.set(F.config("displayUGCPhotos"),G);E.config.set(F.config("logoutURL"),wp_e2.logOutURL);E.config.set(F.config("pageURL"),wp_e2.pageURL);}});A.nameRenderer=function(D){var C=this;C.parentRenderer("name",arguments);var F="Your washingtonpost.com display name, ";if(typeof TWP.signedInProvider=="function"&&typeof TWP.signedInProvider()!="undefined"&&TWP.signedInProvider().toLowerCase()=="facebook"){F="Your Facebook ID, ";}var E=(C.config.get(A.config("displayUGCPhotos"))===true)?", will be displayed with your photo.":((C.config.get(A.config("webType")).toLowerCase()==="discussion_story")?", will be displayed with your post.":", will be displayed with your comment.");B(D).html("");B(D).append('

    '+F+""+''+C.user.get("name")+""+E+"

    "+'");};A.editRenderer=function(C){B(C).remove();};A.logoutRenderer=function(C){B(C).remove();};A.avatarRenderer=function(E){var D=this;var C=wp_e2.echo_user.get("avatar",wp_e2.echo_user.get("defaultAvatar"));var G="";var F="";ovrlay="";if(C==="http://www.washingtonpost.com/rw/sites/twpweb/img/echo2/core/avatar-default.png"){F="Add photo";}else{F="Change
    photo";}if(wp_e2.echo_user.logged()){B(E).html(''+''+"");}};})(jQuery);(function(B){var A=Echo.createPlugin({"name":"ReplyForm","applications":["Submit"],"dependencies":[{"application":"Auth","url":((typeof eidosBase!=="undefined"&&eidosBase!=="")?eidosBase:"")+"/rw/sites/twpweb/js/echo2/v2/core/auth.js"}],"init":function(F,E){F.extendRenderer("Submit","header",F.headerRenderer);F.extendRenderer("Submit","postButton",F.postButtonRenderer);F.extendRenderer("Submit","container",F.containerRenderer);var D=E.config.get(F.config("thisContainer"));E.config.set(F.config("thisContainer"),D);E.config.set(F.config("proxyURL"),wp_e2.proxyURL);E.config.set(F.config("echoSubmissionProxyURL"),wp_e2.echoSubmissionProxyURL);var C=wp_e2[D].commentMaxLength||3000;E.config.set(F.config("commentMaxLength"),C);}});A.postButtonRenderer=function(D,E){var C=this;C.parentRenderer("postButton",arguments);if(!wp_e2.echo_user.logged()){this.config.set("submissionProxyURL",C.config.get(A.config("proxyURL")));}else{this.config.set("submissionProxyURL",C.config.get(A.config("echoSubmissionProxyURL")));}};A.headerRenderer=function(E,F){var C=this;E=C.parentRenderer("header",arguments);not_logged_msg='

    You are not signed in. You may post a reply, and your comment will be saved while you are guided through the sign-in process.

    ';no_id_msg='

    You must create a washingtonpost.com display name to comment or post. You may post a reply, and your comment will be saved while you are guided through the process to create a unique washingtonpost.com display name.

    ';this_msg=(!wapoIdentity.isMemberOfCommentingGroup())?no_id_msg:not_logged_msg;if(!wp_e2.echo_user.logged()){B(".echo-submit-anonymousUserInfoAvatar",E).addClass("hidden");B(".echo-submit-anonymousUserInfoFields",E).append(this_msg);B("input.echo-submit-anonymousUserInfoUrl",E).addClass("hidden");var D=B("input.echo-submit-anonymousUserInfoName",E);D.addClass("hidden");if(D!==null){D.val("Guest");}}return E;};A.containerRenderer=function(F,G){var E=this;E.parentRenderer("container",arguments);F.removeClass("echo-submit-logged echo-submit-anonymous echo-submit-forcedLogin");if(!wp_e2.echo_user.logged()){B("div.echo-submit-auth",F).addClass("hidden");}else{B("div.echo-submit-auth",F).removeClass("hidden");}B(".echo-submit-controls p.character-limit",F).remove();var C;var D;C=E.config.get(A.config("commentMaxLength"));D=B(F).find("textarea");B(".echo-submit-controls",F).prepend('

    '+C+" characters left

    ");D.bind("keyup",function(){var H=B(this).val().length;if(H>C){B(this).val(B(this).val().substr(0,C));H=B(this).val().length;}B(".characters-remaining",F).html(C-H);});};})(jQuery);(function(B){var A=Echo.createPlugin({"name":"ReplyAuth","applications":["Auth"],"init":function(D,C){D.extendRenderer("Auth","name",D.nameRenderer);D.extendRenderer("Auth","edit",D.editRenderer);D.extendRenderer("Auth","logout",D.logoutRenderer);D.extendRenderer("Auth","avatar",D.avatarRenderer);}});A.editRenderer=function(C){B(C).remove();};A.logoutRenderer=function(C){B(C).remove();};A.avatarRenderer=function(C){B(C).remove();};A.nameRenderer=function(D){var C=this;C.parentRenderer("name",arguments);var E="Your washingtonpost.com display name, ";if(typeof TWP.signedInProvider=="function"&&typeof TWP.signedInProvider()!="undefined"&&TWP.signedInProvider().toLowerCase()=="facebook"){E="Your Facebook ID, ";}B(D).replaceWith("

    "+E+C.user.get("name")+", will be displayed with your reply.

    ");};})(jQuery);(function(B){var A=Echo.createPlugin({"name":"TWP_my_comments","applications":["Stream"],"init":function(F,E){F.extendRenderer("Stream","more",F.moreRenderer);F.extendTemplate("Item",F.contentTemplate,"replace","echo-item-content","TWP_my_comments");F.extendRenderer("Item","date",F.dateRenderer);F.extendRenderer("Item","container",F.containerRenderer); F.extendRenderer("Item","childrenIndicator",F.childrenIndicatorRenderer);F.extendRenderer("Item","likesIndicator",F.likesIndicatorRenderer);F.extendRenderer("Item","re",F.reRenderer);F.extendRenderer("Item","text",F.textRenderer);var D=E.config.get(F.config("thisContainer"));E.config.set(F.config("thisContainer"),D);E.config.set("reTag",E.config.get(F.config("reTag")));E.config.set("streamStateLabel",E.config.get(F.config("streamStateLabel")));E.config.set("zebraCount",0);F.listenEvents(E);var C=B("
    ",{id:"simple-overlay"}).addClass("simple-overlay");C.append(B("
    ").addClass("content-wrapper photo-display"));B("body").prepend(C);E.config.set("maxReLinkLength","39");}});A.contentTemplate='
    '+'
    '+'
    '+'
    '+'
    '+'
    '+'
    '+'
    '+''+'...'+''+"
    "+'
    '+'
    '+"
    "+'"+"
    "+"
    "+'
    '+"
    "+"
    "+'
    '+"
    "+'
    ';A.containerRenderer=function(D,F){var E=this;if(E.depth===0){var C=this.config.get("zebraCount");if(C%2!=0){D.addClass("zebra");}this.config.set("zebraCount",C+=1);}if(E.depth==1){D.find(".echo-item-footer").prepend('
    '+E.data.actor.title+"
    responded on ");}D.bind({"mouseenter":function(G){G.stopPropagation();D.addClass("hover");},"mouseleave":function(G){G.stopPropagation();D.removeClass("hover");}});};A.textRenderer=function(E,G){var F=this;var C=E.find(".echo-item-photo img");if(C.length>0){C.attr("src",C.attr("data-src-preview"));E.find(".echo-item-files").append('
    '+C.attr("alt")+"
    ");var D=E.find(".echo-item-photo");D.attr("rel","#simple-overlay");D.attr("href",C.attr("data-src-web"));D.find("a").remove();D.append(C);}};A.dateRenderer=function(E,I){var C=this;C.parentRenderer("date",arguments);var G=new Date();G.setISO8601(this.data.object.published);currDateFmt=G.format("h:MM TT Z");prevDateFmt=G.format("m/d/yyyy h:MM TT Z");var F=(typeof this.data.object.markers!="undefined"&&this.data.object.markers.join().indexOf("photo")>=0);if(wp_e2[thisContainer].includepermalink&&!F&&(this.data.target.id!=this.data.target.conversationID&&this.data.target.id==this.data.object.context[0].uri)){var D=this.id;D=D.replace("http://","");var H=this.data.object.context[0].uri.replace(/_story.html|_blog.html/,"_comment.html");currDatePermalink=''+currDateFmt+"";prevDatePermalink=''+prevDateFmt+"";(G.format("m/d/yyyy")==new Date().format("m/d/yyyy"))?B(E).html(currDatePermalink):B(E).html(prevDatePermalink);}else{(G.format("m/d/yyyy")==new Date().format("m/d/yyyy"))?B(E).html(currDateFmt):B(E).html(prevDateFmt);}};A.childrenIndicatorRenderer=function(G,H,D){if(!this.data.object.accumulators.repliesCount){G.remove();return ;}var C=this.data.object.accumulators.repliesCount;if(C>0){var F=this;D=D||{};D.state=D.state||"regular";var E={"loading":{"css":"echo-item-message-loading","label":"loading"},"regular":{"css":"echo-linkColor echo-message-icon","label":"childrenMoreItems"}};G.html(C+((C>1)?" Replies ▼":" Reply ▼"));G.bind("click",function(){if(!G.hasClass("loaded")){F.publish("internal.Item.onChildrenExpand",{"data":F.data,"element":G});G.addClass("loaded open");G.find(".children-arrow").html("▲");}else{if(G.hasClass("open")){G.addClass("closed").removeClass("open");G.find(".children-arrow").html("▼");G.closest(".echo-item-content").find(".echo-item-children").hide();}else{if(G.hasClass("closed")){G.addClass("open").removeClass("closed");G.find(".children-arrow").html("▲");G.closest(".echo-item-content").find(".echo-item-children").show();}}}});}else{G.remove();}};A.likesIndicatorRenderer=function(D,F,C){if(!this.data.object.accumulators.likesCount){D.remove();return ;}var E=this.data.object.accumulators.likesCount;if(E>0){D.css("display","block");D.html(E+((E>1)?" Likes":" Like"));}else{D.remove();}};A.reRenderer=function(F,I){var D=this;var G=this;var C=D.parentRenderer("re",arguments);if(typeof C!="undefined"){if(G.data.parentUnique.indexOf(G.data.object.context[0].uri)<0){var E=this.data.target.id;E=E.replace("http://","");var H=this.data.object.context[0].uri.replace(/_.*html/,"_comment.html");return C.html(" in reply to "+'this comment');}else{return C.html(" on "+C.html());}}};A.listenEvents=function(C){C.subscribe("internal.Item.onChildrenExpand",function(E,D){});C.subscribe("Stream.onReady",function(F,E){var D=['','','',''];TWP.Comments.addSorts(E,D);});C.subscribe("Stream.Item.onRender",function(E,D){var F=C.items[D.item.data.unique];B(".echo-item-photo",F.dom.get("text")).overlay(A.overlayConfig);});C.subscribe("Stream.onReady",function(E,D){C.config.set("zebraCount",0);});};A.overlayConfig={mask:{color:"black",opacity:0.2,zIndex:55554},top:"20%",left:"center",oneInstance:true,onBeforeLoad:function(){var C=this.getOverlay().find(".content-wrapper");C.html('
    '+this.getTrigger().find("img").attr("alt")+"
    ");},onLoad:function(){var D=this.getOverlay().find(".content-wrapper");var C=D.find("img").width();if(C>0){D.find(".photo-caption").width(C);}},load:false,fixed:false,speed:300};})(jQuery);