
function editComment(cid){var text=$('comment-'+cid).innerHTML.replace(/<br( \/)?>/gi,'');var txt=new Element('textarea',{value:text,name:'editcomment',rows:Math.max(2,Math.ceil(text.length/70)),cols:70}).replaces('comment-'+cid);new Element('input',{'type':'submit','class':'isubmit','value':'Save Edit'}).inject(txt,'after');var txttop=txt.getTop()-30;if(window.getScroll().y>txttop)
window.scrollTo(0,txttop);txt.focus();return false;}
function deleteConfirm(that,cid){new Element('span').set('html',"Are you sure?  &nbsp; <a href='"+window.location.toString().split('#')[0]+"?delete="+cid+"'>Yes, Delete</a>  &nbsp; <a href='#' onclick='return cancelDelete(this.parentNode)'>No, Keep</a>").replaces(that);return false;}
function cancelDelete(that){var a=new Element('a',{'text':'Delete','href':'#'});a.onclick=deleteConfirm.pass(a);a.replaces(that);return false;}
function editFavorite(action,textlink){if(textlink)textlink=$(textlink.parentNode);new Request({url:window.location.toString().split('#')[0],data:{'action':action+'Favorite','text':textlink?1:0},onComplete:function(txt){(textlink||$('favorites')).set('html',txt);}}).send();return false;}