SN.comments={init:function(){var B,A,C=Element.select("bd","a.commentMessageLink");for(B=0,A=C.length;B<A;B++){ye.addListener(C[B],"click",SN.comments.onClick)}C=Element.select("bd","a.deleteCommentLink");for(B=0,A=C.length;B<A;B++){ye.addListener(C[B],"click",SN.comments.onDelete)}},onClick:function(B){ye.stopEvent(B);var A=this.href.replace("/emails","/messages");SN.popup.msg(A,"newMessage")},onDelete:function(C){ye.stopEvent(C);var A=ye.getTarget(C);if(confirm("Are you sure you wish to delete this comment?")){SN.showLoading();var B=new Ajax.Request(A.href,{onSuccess:SN.comments.onSuccess,onFailure:SN.onFailure})}},onSuccess:function(C,A){SN.hideLoading();if(A){if(A.commentId){var B=$("commentBox"+A.commentId);if(!B){B=$("galleryCommentBox"+A.commentId)}if(!B){B=$("broadcastCommentBox"+A.commentId)}if(B){B.remove()}}SN.errors(A)}}};SN.comments.init();