$cat_id = $_GET['cat_id'];
    $cat_title = $_GET['cat_title'];
    $cat_dependency = $_GET['cat_dependency'];
    // IF CAT TITLE IS BLANK, DELETE
    if ($cat_title == "") {
        if ($cat_id != "new") {
            $field->cat_delete($cat_id);
        }
        // SEND AJAX CONFIRMATION
        echo "<html><head><meta http-equiv='Content-Type' content='text/html; charset=UTF-8'><script type='text/javascript'>";
        echo "window.parent.removecat('{$cat_id}');";
        echo "</script></head><body></body></html>";
        exit;
        // SAVE CHANGES
    } else {
        $newcat_id = $field->cat_modify($cat_id, $cat_title, $cat_dependency);
        // SEND AJAX CONFIRMATION
        echo "<html><head><meta http-equiv='Content-Type' content='text/html; charset=UTF-8'><script type='text/javascript'>";
        echo "window.parent.savecat_result('{$cat_id}', '{$newcat_id}', '{$cat_title}', '{$cat_dependency}');";
        echo "</script></head><body></body></html>";
        exit;
    }
    // CHANGE ORDER OF CATS/FIELDS
} elseif ($task == "changeorder") {
    $listorder = $_GET['listorder'];
    $divId = $_GET['divId'];
    $list = explode(",", $listorder);
    // RESORT CATEGORIES
    if ($divId == "categories") {
        for ($i = 0; $i < count($list); $i++) {
            $cat_id = substr($list[$i], 4);