function CommentsCore() { this.currentPage = Object(); this.ident =''; //this.formHTML = 'abcd'; this.currentReplyForm = 0; this.openReplyForm = function(ident,_commentid) { if(this.currentReplyForm!=0) $('replyform_'+this.currentReplyForm).innerHTML = ''; tmp = $('formcontainer').innerHTML; tmp = tmp.replace(/{commentid}/, _commentid); $('replyform_'+_commentid).innerHTML = tmp; $('form_'+ident).innerHTML = ''; this.currentReplyForm = _commentid; } this.Delete = function(ident,commentid,path) { this.ident = ident; var data = new Object(); data['namefull']=path; data['commentid'] = commentid; data['action'] = 'delete'; data['widget'] = 'comments'; this.InitializeRequest('POST', '/ajax.php'); this.Commit(postquery(data)); } this.Post = function(ident,namefull,nickname,email,content,captcha,parentid) { this.ident = ident; setFade(0,"form_"+ident); $("loading_"+this.ident).style.display = 'block'; var data = new Object(); data['content'] = escape(content); data['nickname'] = escape(nickname); data['email'] = escape(email); data['captcha'] = escape(captcha); data['ident'] = ident; data['parentid'] = parentid; data['namefull'] = namefull; data['action'] = 'post'; data['widget'] = 'comments'; this.InitializeRequest('POST', '/ajax.php'); this.Commit(postquery(data)); } this.OnSuccess = function() { //alert(this.GetResponseText()); eval(this.GetResponseText()); fade(0,"form_"+this.ident); $("loading_"+this.ident).style.display = 'none'; } } CommentsCore.prototype = new ajax(); Comments = new CommentsCore();