function dateToStr(n){var t=n.getDate(),i=monthNames[n.getMonth()],r=n.getFullYear();return twoDigNo(t)+"-"+i+"-"+r+" "+twoDigNo(n.getHours())+":"+twoDigNo(n.getMinutes())}function twoDigNo(n){return n>9?""+n:"0"+n}function initTooltip(n){n.tooltip({trigger:"manual",title:""}).on({click:function(){$(this).tooltip("show")},focusout:function(){$(this).tooltip("hide");$(this).attr("data-original-title","");$(this).tooltip("fixTitle")}})}var monthNames=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],VoteApp=function(n,t,i,r,u,f,e){this.uniqueId=t;this.currentUserId=i;this.origVote=r-u;this.currVote=r;this.id=n;this.updateVoteUi(n,r,this.origVote);this.postUrl=e;this.createdBy=f},CommentApp;VoteApp.prototype.changeVote=function(n,t){if(this.createdBy==this.currentUserId){$(t).attr("data-original-title","You cannot vote for your own post");$(t).tooltip("fixTitle");return}if(this.currentUserId<=0){$(t).attr("data-original-title","You must be logged on to vote");$(t).tooltip("fixTitle");return}voteChange=n;this.currVote==this.origVote?this.currVote=this.origVote+n:(voteChange=this.currVote>this.origVote?-1:1,this.currVote=this.origVote);this.updateVoteUi();var i=$.ajax({type:"POST",url:this.postUrl,dataType:"json",data:{id:this.id,delta:voteChange},success:function(){}}).responseText};VoteApp.prototype.updateVoteUi=function(){var n=$("#voteUp_"+this.uniqueId),t=$("#voteDn_"+this.uniqueId);n.removeClass("voteUpSelected");t.removeClass("voteDnSelected");this.currVote>this.origVote?n.addClass("voteUpSelected"):this.currVote

'+decodeURI(n)+' '+t+" "+i+" "};CommentApp.prototype.closeComments=function(){document.getElementById("addCommentPanel_"+this.id).style.display="none";document.getElementById("txtComment_"+this.id).textContent=""};CommentApp.prototype.beginAddComments=function(){if(currentUserId<=0){$("#addComm_"+this.id).attr("data-original-title","You must be logged on to comment");$("#addComm_"+this.id).tooltip("fixTitle");return}if(!this.canComment&&this.postOwner!=this.currentUserId){$("#addComm_"+this.id).attr("data-original-title",this.commentDeniedReason);$("#addComm_"+this.id).tooltip("fixTitle");return}document.getElementById("addCommentPanel_"+this.id).style.display="block"}