var Ajax = Ajax ? Ajax :  {

    reportItemTerapias: function(id, title, caller) {
        var reason = prompt("Escriba brevemente la razón por la que ya no es válido y debería ser borrado. Gracias.", "");
        if (!reason || reason == "") {
            return;
        }
        $.post("handler/reportHandler.php", {
            op: "report_bad",
            id: id,
            tit: title,
            where: 'terapias_alternativas',
            reason: reason
        },
        function(read){
            if (read == "1") {
                $(caller).replaceWith("<img src='/images/icons/accept.png' title='Gracias' />");
            } else {
                $(caller).hide();
            }
        });
    },

    reportItemNormal: function(title, tel, type, caller) {
        var reason = prompt("Escriba brevemente la razón por la que ya no es válido y debería ser borrado. Gracias.", "");
        if (!reason || reason == "") {
            return;
        }
        $.post("handler/reportHandler.php", {
            op: "report_normal",
            tit: title,
            tel: tel,
            where: type,
            reason: reason
        },
        function(read){
            if (read == "1") {
                $(caller).replaceWith("<img src='/images/icons/accept.png' title='Gracias' />");
            } else {
                $(caller).hide();
            }
        });
    }
}


