function quickajax_send_yn (f, u, id, yn) { var el = document.getElementById(f + id); if (el) { el.lastChild.onclick = returnfalse; yn = (typeof(yn) == "undefined" || yn < 1 ? 0 : 1); sendAJAXrequest(u + id + '/' + yn, function (data) { quickajax_confirm_yn(f, u, id, data, yn); }); } return false; } function quickajax_confirm_yn (f, u, id, data, yn) { var el = document.getElementById(f + id); if (el) { var t = quickajax_successes[f][data[0]['success']]; if (!t) { t = quickajax_successes_def[f]; } else { if (typeof(quickajax_redirect) != "undefined" && typeof(quickajax_redirect[f]) != "undefined") { window.location = quickajax_redirect[f][yn]; } else { el.lastChild.onclick = function () { return quickajax_send_yn(f,u,id,1-yn); }; } } el.lastChild.replaceChild(document.createTextNode(t), el.lastChild.lastChild); } } function quickajax_fill_yn (f, u, id, yn) { var el = document.getElementById(f + id); if (el) { el.lastChild.href = '#'; el.lastChild.onclick = function () { return quickajax_send_yn(f,u,id,yn); }; } }