function JobCore() {
	this.ident ='';
	this.currentPage = 1;
	this.perPage  = 20;	
	this.sort = 0;
	this.categoryid = 0;
	this.country = 0;
	this.employment = 0;
	this.salary = 0;
	
	this.setcurrentPage = function(page) {
		if (page > 0) {
			this.currentPage = page;		
		} else {
			this.currentPage = 1;
		}
	}
	
	this.setParams = function() {
		this.categoryid = $('categoryid').options[$('categoryid').selectedIndex].value;
		this.country = $('countryid').options[$('countryid').selectedIndex].value;
		this.employment = $('employment').options[$('employment').selectedIndex].value;
		this.salary = $('salary').value;
	}
	
	this.setSort = function(sort) {
		this.sort = sort;
	}
	
	this.setCategory = function(id) {
		this.categoryid = id;
	}
	
	this.query = function() {
		var data = new Object();	
		data['page'] = this.currentPage;
		data['perpage'] = this.perPage;
		data['categoryid'] = this.categoryid;
		data['country'] = this.country;
		data['employment'] = this.employment;
		data['salary'] = this.salary;
		data['sort'] = this.sort;
		data['act'] = 'query';
		data['widget'] = 'job';
		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';
      }
}

JobCore.prototype = new ajax();
Job = new JobCore();