function langmarket_responsesCore() {
	this.ident='';	
	this.refresh = function(ident) {
		var data = new Object();	
		data['widget']='langmarket_responses';
		data['action'] = 'refresh';
		data['ident'] = ident;
		
		this.InitializeRequest('POST', '/ajax.php');
        this.Commit(postquery(data));		
	}
	this.addResponse = function(ident,projectid,responsebody,timeline_start,timeline_finish,budjet_start,budjet_finish,budjet_currency,timeline_type,hidden_response){
		var data = new Object();
		data['widget'] = 'langmarket_responses';
		data['action'] = 'addresponse';
		data['ident'] = ident;
		data['projectid'] = projectid;
		data['responsebody'] = responsebody;
		data['timeline_start'] = timeline_start;
		data['timeline_finish'] = timeline_finish;
		data['budjet_start'] = budjet_start;
		data['budjet_finish'] = budjet_finish;
		data['budjet_currency'] = budjet_currency;
		data['timeline_type'] = timeline_type;
		data['hidden_response'] = hidden_response;
		
		
		
		
		this.InitializeRequest('POST','/ajax.php');
		this.Commit(postquery(data));
	}
	
   this.addMessage = function (ident,projectid,projectuser,body,responseid,userid){
   	   var data = new Object();
   	   data['widget'] = 'langmarket_responses';
	   data['action'] = 'addmessage';
	   data['ident'] = ident;
	   data['projectid'] = projectid;
	   data['projectuser'] = projectuser;
	   data['body'] = body;
	   data['responseid'] = responseid;
	   data['userid'] = userid;
	   
	   
	   
	   this.InitializeRequest('POST','/ajax.php');
	   this.Commit(postquery(data));
   	
   }
   
   //type
   //2 - кандидат, 0 - отказ, 3 - исполнитель
   //subtype
   //Подтип (номер) для отказа
   //body - текст отказа (для отказа)
   this.changeMessageStatus = function (ident,type,subtype,body,responseid){
   	   var data = new Object();
   	   data['widget'] = 'langmarket_responses';
	   data['action'] = 'changeMessageStatus';
	   data['ident'] = ident;
	   data['type'] = type;
	   data['subtype'] = subtype;
	   data['body'] = body;
	   data['responseid'] = responseid;
	   
	   
	   
	   this.InitializeRequest('POST','/ajax.php');
	   this.Commit(postquery(data));
   	
   }
	
	this.OnSuccess = function() {
      	eval(this.GetResponseText());
    }
	
}
langmarket_responsesCore.prototype = new ajax();
langmarket_responses = new langmarket_responsesCore();

