function BlogsCore() {
	this.ident = '';
	
	this.editPost = function(id) {
		 var data = new Object();
		 var content = $('edit_post_content_'+id).value;
		 var title = $('edit_post_title_'+id).value;
		 data['postid'] = id;
		 data['title'] = title;
		 data['content'] = content;//.replace('\n','<br/>');
		 data['action'] = 'edit';
		 data['widget'] = 'blog';

		 this.InitializeRequest('POST', '/ajax.php');
         this.Commit(postquery(data));	
	}
	
	this.deletePost = function(id) {
		if (confirm('Вы точно хотите удалить запись?')) {
			 var data = new Object();
			 data['postid'] = id;
			 data['action'] = 'delete';
			 data['widget'] = 'blog';
	
			 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';
      }
}

BlogsCore.prototype = new ajax();
Blogs = new BlogsCore();
