
function quickajax_send (f, u, id)
{
	var el = document.getElementById(f + id); if (el)
	{
		el.lastChild.onclick = returnfalse;
		sendAJAXrequest(u + id, function (data) { quickajax_confirm(f, id, data); });
	}
	return false;
}

function quickajax_confirm (f, id, data)
{
	var el = document.getElementById(f + id); if (el)
	{
		var t = quickajax_successes[f][data[0]['success']];
		if (!t) { t = quickajax_successes_def[f]; } else
		 { el.lastChild.onclick = null; el.lastChild.href = data[0]['url']; }
		el.lastChild.replaceChild(document.createTextNode(t), el.lastChild.lastChild);
//		el.lastChild.innerHTML = t;
	}
}

function quickajax_fill (f, u, id, m)
{
	var el = document.getElementById(f + id); if (el)
	 { el.lastChild.href = '#'; el.lastChild.onclick = (typeof(m) == 'undefined' ?
	  function () { return quickajax_send(f,u,id); } : function () { if (confirm(m)) { return quickajax_send(f,u,id); } else { return false; } } ); }
}

