function uniqClick(a, hash, cost)
{
	a.href += (a.href.indexOf('?')!=-1 ? '&' : '?') + 'h=' + hash;
	if (cost > 0)
		a.href += '&c=' + cost;
	a.onclick = null;

	return true;
}

var JOB_req;

function JOB_addNote(a, type, id)
{
//	alert('JOB_addNote');

	if (!JOB_req)
		JOB_req = new Subsys_JsHttpRequest_Js();

	JOB_req.onreadystatechange = function() {
//		alert('done.');
	}

	JOB_req.caching = true;
	JOB_req.open('POST', '/note/add/', true);
	JOB_req.send({ type: type, id: id });

	a.innerHTML = 'Удалить из блокнота';
	a.href = '/account/notebook/' + (type == 1 ? 'resume' : 'vacancy') + '/delete/' + id + '/';
	a.paramType = type;
	a.paramId = id;
	a.onclick = function () {
		return JOB_delNote(this, this.paramType, this.paramId);
	}

	return false;
}

function JOB_delNote(a, type, id)
{
//	alert('JOB_delNote');

	if (!JOB_req)
		JOB_req = new Subsys_JsHttpRequest_Js();

	JOB_req.onreadystatechange = function() {
	}

	JOB_req.caching = true;
	JOB_req.open('POST', '/note/del/', true);
	JOB_req.send({ type: type, id: id });

	a.innerHTML = 'В блокнот';
	a.href = '/account/notebook/' + (type == 1 ? 'resume' : 'vacancy') + '/add/' + id + '/';
	a.onclick = function () {
		return JOB_addNote(this, this.paramType, this.paramId);
	}

	return false;
}