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")}})}function deleteComment(n,t){var r=$(n).closest(".cctr"),i=r.attr("data-id");confirm("are you sure you want to delete your comment?")&&$.ajax({url:t,type:"POST",data:{commentId:i}}).done(function(){$("#cctr_"+i).parent().remove()}).fail(function(n,t){alert(t)})}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(t)+' '+r+" "+u+" "+(i==this.currentUserId?'
":"")+" "};CommentApp.prototype.closeComments=function(){document.getElementById("addCommentPanel_"+this.pid).style.display="none";document.getElementById("txtComment_"+this.pid).textContent=""};CommentApp.prototype.beginAddComments=function(){if(currentUserId<=0){$("#addComm_"+this.pid).attr("data-original-title","You must be logged on to comment");$("#addComm_"+this.pid).tooltip("fixTitle");return}if(!this.canComment&&this.postOwner!=this.currentUserId){$("#addComm_"+this.pid).attr("data-original-title",this.commentDeniedReason);$("#addComm_"+this.pid).tooltip("fixTitle");return}document.getElementById("addCommentPanel_"+this.pid).style.display="block"},function(n,t){function yt(n){return n?Object.prototype.toString.call(n)==="[object Array]":!1}function bi(n){return n?Object.prototype.toString.call(n)==="[object Function]":!1}function tt(n,t){for(var i=0,r=t.length;i=0}function e(n,t){return t=t||"px",n&&/^\d+$/.test(n)?n+t:n}function o(n){var t;return n&&(t=/(\d+)/.exec(n))?parseInt(t[1],10):0}function a(n){return n.replace(/&/g,"&").replace(//g,">").replace(/"/g,""")}function gt(n){return n.replace(/</g,"").replace(/"/g,'"').replace(/&/g,"&")}function ni(n){var t=n.split("-");return n="",r(t,function(t,i){n+=t>0?i.charAt(0).toUpperCase()+i.substr(1):i}),n}function ki(n){function t(n){var t=parseInt(n,10).toString(16).toUpperCase();return t.length>1?t:"0"+t}return n.replace(/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/ig,function(n,i,r,u){return"#"+t(i)+t(r)+t(u)})}function s(n,i){i=i===t?",":i;var u={},e=yt(n)?n:n.split(i),f;return r(e,function(n,t){if(f=/^(\d+)\.\.(\d+)$/.exec(t))for(var i=parseInt(f[1],10);i<=parseInt(f[2],10);i++)u[i.toString()]=!0;else u[t]=!0}),u}function hr(n,t){return Array.prototype.slice.call(n,t||0)}function u(n,i){return n===t?i:n}function ke(n){return!n||/[<>"]/.test(n)}function de(n,t){return n.indexOf("?")>=0?n+"&"+t:n+"?"+t}function w(n,t,i){var u,f;i||(i=t,t=null);t?(f=function(){},f.prototype=t.prototype,u=new f,r(i,function(n,t){u[n]=t})):u=i;u.constructor=n;n.prototype=u;n.parent=t?t.prototype:null}function vu(text){var match,cx;if((match=/\{[\s\S]*\}|\[[\s\S]*\]/.exec(text))&&(text=match[0]),cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,cx.lastIndex=0,cx.test(text)&&(text=text.replace(cx,function(n){return"\\u"+("0000"+n.charCodeAt(0).toString(16)).slice(-4)})),/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return eval("("+text+")");throw"JSON parse error";}function io(){for(var i=document.getElementsByTagName("script"),n,t=0,r=i.length;t=0){r(i.split(","),function(){pt(n,this,u)});return}e=ar(n);e||(e=fo(n));h[e]===t&&(h[e]={});f=h[e][i];f&&f.length>0?gi(n,i,f[0]):(h[e][i]=[],h[e].el=n);f=h[e][i];f.length===0&&(f[0]=function(i){var u=i?new nf(n,i):t;r(f,function(t,i){t>0&&i&&i.call(n,u)})});tt(u,f)<0&&f.push(u);uo(n,i,f[0])}function ti(n,i,u){var f,e,o;if(i&&i.indexOf(",")>=0){r(i.split(","),function(){ti(n,this,u)});return}if(f=ar(n),f){if(i===t){f in h&&(r(h[f],function(t,i){t!="el"&&i.length>0&&gi(n,t,i[0])}),delete h[f],rf(n));return}h[f]&&(e=h[f][i],e&&e.length>0&&(u===t?(gi(n,i,e[0]),delete h[f][i]):(r(e,function(n,t){n>0&&t===u&&e.splice(n,1)}),e.length==1&&(gi(n,i,e[0]),delete h[f][i])),o=0,r(h[f],function(){o++}),o<2&&(delete h[f],rf(n))))}}function uf(n,t){var i,u;if(t.indexOf(",")>=0){r(t.split(","),function(){uf(n,this)});return}(i=ar(n),i)&&(u=h[i][t],h[i]&&u&&u.length>0&&u[0]())}function vr(n,t,i){var r=this;t=/^\d{2,}$/.test(t)?t:t.toUpperCase().charCodeAt(0);pt(n,"keydown",function(r){!r.ctrlKey||r.which!=t||r.shiftKey||r.altKey||(i.call(n),r.stop())})}function eo(t){function r(){i||(i=!0,t(KindEditor),yr=!0)}function f(){if(!i){try{document.documentElement.doScroll("left")}catch(n){setTimeout(f,100);return}r()}}function e(){document.readyState==="complete"&&r()}var i,u;if(yr){t(KindEditor);return}if(i=!1,document.addEventListener)pt(document,"DOMContentLoaded",r);else if(document.attachEvent){pt(document,"readystatechange",e);u=!1;try{u=n.frameElement==null}catch(o){}document.documentElement.doScroll&&u&&f()}pt(n,"load",r)}function wt(n){for(var i={},f=/\s*([\w\-]+)\s*:([^;]*)(;|$)/g,t,r,u;t=f.exec(n);)r=l(t[1].toLowerCase()),u=l(ki(t[2])),i[r]=u;return i}function d(n){for(var i={},f=/\s+(?:([\w\-:]+)|(?:([\w\-:]+)=([^\s"'<>]+))|(?:([\w\-:"]+)="([^"]*)")|(?:([\w\-:"]+)='([^']*)'))(?=(?:\s|\/|>)+)/g,t,r,u;t=f.exec(n);)r=(t[1]||t[2]||t[4]||t[6]).toLowerCase(),u=(t[2]?t[3]:t[4]?t[5]:t[7])||"",i[r]=u;return i}function oo(n,t){return/\s+class\s*=/.test(n)?n.replace(/(\s+class=["']?)([^"']*)(["']?[\s>])/,function(n,i,r,u){return(" "+r+" ").indexOf(" "+t+" ")<0?r===""?i+t+u:i+r+" "+t+u:n}):n.substr(0,n.length-1)+' class="'+t+'">'}function so(n){var t="";return r(wt(n),function(n,i){t+=n+":"+i+";"}),t}function ii(n,i,r,f){function s(n){for(var u=n.split("/"),i=[],t,r=0,f=u.length;r0&&i.pop():t!==""&&t!="."&&i.push(t);return"/"+i.join("/")}function h(t,i){var r,o,u;if(n.substr(0,t.length)===t){for(r=[],o=0;o0&&(u+="/"+r.join("/")),f=="/"&&(u+="/"),u+n.substr(t.length)}if(e=/^(.*)\//.exec(t))return h(e[1],++i)}var o,e;if(i=u(i,"").toLowerCase(),n.substr(0,5)!="data:"&&(n=n.replace(/([^:])\/\//g,"$1/")),tt(i,["absolute","relative","domain"])<0)return n;if(r=r||location.protocol+"//"+location.host,f===t&&(o=location.pathname.match(/^(\/.*)\//),f=o?o[1]:""),e=/^(\w+:\/\/[^\/]*)/.exec(n)){if(e[1]!==r)return n}else if(/^\w+:/.test(n))return n;return/^\//.test(n)?n=r+s(n.substr(1)):/^\w+:\/\//.test(n)||(n=r+s(f+"/"+n)),i==="relative"?n=h(r+f,0).substr(2):i==="absolute"&&n.substr(0,r.length)===r&&(n=n.substr(r.length)),n}function lt(n,t,i,f,e){var c,o,a,h;return n==null&&(n=""),i=i||"",f=u(f,!1),e=u(e,"\t"),c="xx-small,x-small,small,medium,large,x-large,xx-large".split(","),n=n.replace(/(]*)>)([\s\S]*?)()/ig,function(n,t,i,r){return t+i.replace(/]*)>/ig,"\n")+r}),n=n.replace(/]*)\s*\/?>\s*/ig,""),n=n.replace(/(]*)>)\s*()/ig,"$1
$2"),n=n.replace(/\u200B/g,""),n=n.replace(/\u00A9/g,"©"),n=n.replace(/\u00AE/g,"®"),n=n.replace(/]+/g,function(n){return n.replace(/\s+/g," ")}),o={},t&&(r(t,function(n,t){for(var r=n.split(","),i=0,u=r.length;i]*)>)([\s\S]*?)()/ig,"")),o.style||(n=n.replace(/(]*)>)([\s\S]*?)()/ig,""))),a=/(\s*)]+)|(?:\s+[\w\-:"]+="[^"]*")|(?:\s+[\w\-:"]+='[^']*'))*)(\/)?>(\s*)/g,h=[],n=n.replace(a,function(n,u,s,l,a,v,y){var ot=n,k=u||"",nt=s||"",p=l.toLowerCase(),rt=a||"",ut=v?" "+v:"",b=y||"",ft,et,w,it,g;if(t&&!o[p])return"";if(ut===""&&wu[p]&&(ut=" /"),yu[p]&&(k&&(k=" "),b&&(b=" ")),cr[p]&&(nt?b="\n":k="\n"),f&&p=="br"&&(b="\n"),pu[p]&&!cr[p])if(f){for(nt&&h.length>0&&h[h.length-1]===p?h.pop():h.push(p),k="\n",b="\n",ft=0,et=nt?h.length:h.length-1;ft=0&&(w[n]=ii(u,i));(t&&n!=="style"&&!o[p]["*"]&&!o[p][n]||p==="body"&&n==="contenteditable"||/^kindeditor_\d+$/.test(n))&&delete w[n];n==="style"&&u!==""&&(f=wt(u),r(f,function(n){!t||o[p].style||o[p]["."+n]||delete f[n]}),e="",r(f,function(n,t){e+=n+":"+t+";"}),w.style=e)}),rt="",r(w,function(n,t){(n!=="style"||t!=="")&&(t=t.replace(/"/g,"""),rt+=" "+n+'="'+t+'"')})),p==="font"&&(p="span"),k+""+b}),n=n.replace(/(]*)>)([\s\S]*?)()/ig,function(n,t,i,r){return t+i.replace(/\n/g,'\n')+r}),n=n.replace(/\n\s*\n/g,"\n"),n=n.replace(/\n/g,"\n"),l(n)}function ff(n,t){return n=n.replace(//ig,"").replace(//ig,"").replace(/