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).style.display = 'none';
		this.currentReplyForm = _commentid;
	}
	
	this.Delete = function(ident,commentid,namefull) {
		this.ident = ident;
		var data = new Object();
		data['commentid'] = commentid;
		data['action'] = 'delete';
		data['namefull'] = namefull;
		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'] = encodeURIComponent(content);
		data['nickname'] = encodeURIComponent(nickname);
		data['email'] = encodeURIComponent(email);
		data['captcha'] = encodeURIComponent(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();





























































