CommentCitation.init=function(){var b=$("commentForm");if(b){Element.observe(b,"submit",function(c){if($$("#bodyQuote[name='bodyQuote']").length===0){b.insert("<input type='hidden' name='bodyQuote' value='' />");}});}CommentCitation.scrollToMessage();if(!CommentCitation.exists()){$$("div.posting_reply").each(function(c){c.hide();c.style.overflow="hidden";c.style.height="0px";});return;}var a;if(a=$("bodyQuote")){a.hide();}if(a=$("bodyQuoteLabel")){a.hide();}$$("div.posting_reply a").each(function(c){c.observe("click",function(d){CommentCitation.citeComment(c);Event.stop(d);});});if(document.location.hash=="#commentForm"){this.focusBody();}};document.observe("dom:loaded",function(){(function(){var e=null;var d=null;var c=/\/image_processor\/1\.\d+(\.\d+)/;$$("#blog .body img").each(function(f){e=f.getAttribute("src");if(e!=null){d=c.exec(e);if(d!=null){e=e.replace(d[1],"");f.setAttribute("src",e);}}});var b=$$(".extraCommentsCommentsWrapper .scrollerlinks a");var a;b.each(function(f){a=f.getAttribute("href");if(!a.match(/article_full_discussion/)){a=a+"&articleRenderMode=article_full_discussion";f.setAttribute("href",a);}});})();});if(typeof MktWebbFB!=="undefined"){MktWebbFB.publishComment=function(frm){if(MktWebbFB.sessionUid>0){eval("props = {'"+MktWebbFB.Comment.props1+"':{'text':'"+MktWebbFB.Comment.props2+"','href':'"+location.href+"'}};");var body=$("body");var bodyText="";if(body){bodyText=body.value.replace(/\n/g,"");MktWebbFB.Comment.message=bodyText;}FB.ui({method:"feed",display:(isIE?"iframe":"popup"),message:MktWebbFB.Comment.message,name:MktWebbFB.Comment.name,link:MktWebbFB.Comment.link,picture:MktWebbFB.Comment.picture,caption:MktWebbFB.Comment.caption,description:MktWebbFB.Comment.description,properties:props},function(response){var ok=response&&response.post_id?true:false;var aborted=ok===true?"false":"true";var hiddenAborted=new Element("input",{type:"hidden",name:"fb-aborted",id:"fb-aborted",value:aborted});var hiddenSessionUid=new Element("input",{type:"hidden",name:"fb-sessionUID",id:"fb-sessionUID",value:MktWebbFB.sessionUid});frm.insert(hiddenSessionUid);frm.insert(hiddenAborted);frm.submit();});}else{frm.submit();}};}MM.searchClient=(function(d){function b(f){var e=window.console;if(e&&e.log){e.log(f);}}function c(g,f,h){var i=new Date().getTime();if(d.isArray(h)){f.apply(this,h);}else{f.call(this,h);}var e=new Date().getTime();b(g+": "+(e-i)+" ms");}function a(e,j,i,k,h,g){var f=new Date().getTime();if(i!==null&&i!==""){d.ajax({type:"GET",dataType:(MM.cfg.crossDomain?"jsonp":"json"),url:e+"/"+j+"/"+i+"/search.json",data:k,success:function(l){if(h&&l!==null){if(g){b("QT: "+((l!==null)?l.searchTimeInMillis+" ms":" N/A "));b("RTT: "+(new Date().getTime()-f)+" ms");c("Result rendering",h,l);}else{h(l);}}},complete:function(l,m){}});}}return{simpleSearch:function(e,f){a(MM.cfg.searchWSUrl,MM.cfg.ident,MM.cfg.main_search_profile,"q="+encodeURIComponent(e),f);},search:function(f,e){a(MM.cfg.searchWSUrl,MM.cfg.ident,MM.cfg.main_search_profile,MM.searchClient.encodeQuery(f),e);},relatedSearch:function(f,e){a(MM.cfg.searchWSUrl,MM.cfg.ident,MM.cfg.related_search_profile,MM.searchClient.encodeQuery(f),e);},backfillSearch:function(f,e){a(MM.cfg.searchWSUrl,MM.cfg.ident,MM.cfg.backfill_search_profile,MM.searchClient.encodeQuery(f),e);},encodeQuery:function(h){var e=h.split("&");var f="";var g="";e.each(function(k,j){var i=k.split("=");f=i[0];g=i[1];g=decodeURIComponent(g);g=encodeURIComponent(g);e[j]=f+"="+g;});h=e.join("&");return h;}};})(jQuery.noConflict());ui.renderResultInfoText=function(a,d){var b=d.select("#resultInfoText")[0];if(!b){b=d.select(".resultInfo")[0].select("span")[0];}b.update(MM.cfg.resultInfoText.replacePlaceholders(a));};ui.renderResultQueryTimeText=function(a,d){var b=d.select("#resultQueryTimeText")[0];if(!b){b=d.select(".resultInfo")[0].select("span")[1];}b.update(MM.cfg.resultQueryTimeText.replacePlaceholders(a));};PhotoAlbum.ModalSlideShow.crossfade=function(a,i){var b=i.select("a.photoLink").first();var j=this.getNodeValue(a,"url",i);var e=j.substring(j.indexOf("?"));var c=e.match(/\d\d*/g);var g=c[0];var h=c[1];var d=b.innerHTML.toLowerCase().indexOf("div")===-1;if(d){var f=$$(".photoWrapper")[0].select("img")[0];f.src=j;}else{b.insert({top:new Element("img",{src:j,width:h,height:g}).wrap("div")});PhotoAlbum.ModalSlideShow.imageElement(i).parentNode.fade({afterFinish:function(k){k.element.remove();}});}};PhotoAlbum.ModalSlideShow.navigateWithArrowKeys=function(d,c,b){if(!a&&arguments){var a=arguments;}if(!a){return;}var c=a[1];if(!([37,39].indexOf(d.keyCode)>-1)){return;}PhotoAlbum.ModalSlideShow.stopAutoplay(c,b);d.keyCode==39?PhotoAlbum.ModalSlideShow.stepAhead(c,b):PhotoAlbum.ModalSlideShow.stepBack(c,b);Event.stop(d);};
