/* CATEGORIA */

function add (Form){
    jQuery.ajax({
        url:'loader.php?module=include/update.lib.php',
        data:'action=add&form='+Form+'&'+jQuery('#'+Form).serialize(),
        success: function () {
            $('.agregar').slideUp('slow');
            $('.button').addClass('addItem');
            $('.button').removeClass('cancel');
            $('#'+Form+' INPUT').val('');
            $('#menu-serv').find('.active').click();
        }
    });
}
function update (form,table) {
    jQuery.ajax({
        url:'loader.php?module=include/update.lib.php',
        data:'action=editar&form='+form+'&table='+table+'&'+jQuery('#'+form).serialize(),
        success: function () {
            //$('.agregar').slideUp('slow');
            //$('.button').addClass('addItem');
            //$('.button').removeClass('cancel');
            //$('#'+Form+' INPUT').val('');
            $('#menu-serv').find('.active').click();
        }
    });
}
function borrar(form,id){
    jQuery.ajax({
        url:'loader.php?module=include/update.lib.php',
        data:'action=delete&form=' + form + '&id=' + id,
        success: function () {
            $('#menu-serv').find('.active').click();
        }
    });
}
