function WallCore() {
	this.ident ='';
	this.current_page = 1;
	this.perpage = 10;
	
	this.setcurrentPage = function(page) {
		this.current_page = page;
	}
	
	this.reply = function(id,type) {
		if ($('wall_replytext').value != '') {
			var data = new Object();
			data['objectid'] = id;
			data['objecttype'] = type;
			data['content'] = encodeURIComponent($('wall_replytext').value);
			data['action'] = 'reply';
			data['widget'] = 'wall';
			this.InitializeRequest('POST', '/ajax.php');
	        this.Commit(postquery(data));
		} else {
			alert('Пустое сообщение');
		}
	}
	
	this.messageDelete = function(id) {
		var data = new Object();
		data['messageid'] = id;
		data['action'] = 'delete';
		data['widget'] = 'wall';
		this.InitializeRequest('POST', '/ajax.php');
        this.Commit(postquery(data));
	}
	
	this.query = function(id,type) {
		var data = new Object();
		data['page'] = this.current_page;
		data['perpage'] = this.perpage;
		data['objectid'] = id;
		data['objecttype'] = type;
		data['action'] = 'query';
		data['widget'] = 'wall';
		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';
      }
}

WallCore.prototype = new ajax();
Wall = new WallCore();