function clanguage(a) {
    $.ajax({
        type: "POST",
        data: ({
            language: a
        }),
        url: "/lang/save_lang.php",
        success: function (b) {
            window.location.reload();
        }
    });
}
function listfiles(a, c, d, f, e, h, i, j) {
    $("#" + c + "").fileTree({
        root: "/accounts/" + a + "/" + d + "/",
        script: "/cpanel/modules/filetree/jqueryFileTree.php",
        blockname: c,
        dos: f,
        ps: h,
        idpart: e,
        filename: i
    }, function (b) {});
}
function listdownloadfiles(a, c, d) {
    $("#" + c + "").fileTree({
        root: "/sdomain/" + a + "/",
        script: "/cpanel/modules/filetree/filetreedownload.php"
    }, function (b) {});
}
function del(c, d, f, e, h) {
    if (confirm("" + f + "")) {
        $.ajax({
            type: "POST",
            dataType: "html",
            data: ({
                del: c,
                link: d
            }),
            url: "/cpanel/modules/filetree/filetreedel.php",
            beforeSend: function (b) {},
            success: function (a) {
                if (a == "true") {
                    $("#" + e + "").fileTree({
                        root: d,
                        script: "/cpanel/modules/filetree/jqueryFileTree.php",
                        blockname: e,
                        filename: c,
                        dos: "del",
                        ps: h,
                        idpart: e
                    }, function (b) {});
                }
            }
        });
    }
}
function set(c, d, f, e, h, j) {
    $.ajax({
        type: "POST",
        data: ({
            fname: c,
            di: d,
            blk: f,
            fid: e,
            idps: h
        }),
        url: "/cpanel/modules/filetree/filetreesetactive.php",
        beforeSend: function (b) {},
        success: function (a) {
            $("input[name=" + e + "]").attr("title", "" + c + "");
            $("#" + f + "").fileTree({
                root: j,
                script: "/cpanel/modules/filetree/jqueryFileTree.php",
                blockname: f,
                filename: c,
                dos: "set",
                ps: h,
                idpart: e
            }, function (b) {});
            showMovie("/exposail/expositions/prevexpo/");
        }
    });
}
function erase(a, c, d) {
    $.ajax({
        type: "POST",
        data: ({
            fid: a,
            blk: c,
            type: d
        }),
        url: "/cpanel/inc/deactive.php",
        beforeSend: function (b) {},
        success: function (b) {
            showMovie("/exposail/expositions/prevexpo/");
        }
    });
}
$(document).ready(function () {
    $("#submitchangestand").click(function () {
        var a = $("#changestand").attr("value");
        $.ajax({
            type: "POST",
            dataType: "html",
            data: ({
                changestand: a
            }),
            url: "/cpanel/inc/updates.php",
            beforeSend: function (b) {
                replaceSwfWithEmptyDiv("bg_videoBox");
                $("#fog").css("display", "block");
                $("#loader").css("display", "block");
            },
            success: function (b) {
                location.reload();
            }
        });
        return false;
    });
    $("#submitchangeexpo").click(function () {
        var a = $("#catexpo").attr("value");
        var c = $("#catsubexpo").attr("value");
		if(sprawdzWolne() == false) return false;
        $.ajax({
            type: "POST",
            dataType: "html",
            data: ({
                changeexpo: a,
                ressubexpo: c
            }),
            url: "/cpanel/inc/updateschange.php",
            beforeSend: function (b) {
                $("#fog").css("display", "block");
                $("#loader").css("display", "block");
            },
            success: function (b) {
                location.reload();
                alert(b);
            }
        });
        return false;
    });
    $(".currency").change(function () {
        $.ajax({
            cache: false,
            datatype: "json",
            data: ({
                currency: $(this).val()
            }),
            url: "/cpanel/inc/changecurrency.php",
            beforeSend: function (b) {
                $("#fog").css("display", "block");
                $("#loader").css("display", "block");
            },
            success: function (b) {
                location.reload();
            }
        });
    });
    $("#confirmed").click(function () {
        $.ajax({
            cache: false,
            datatype: "html",
            data: ({}),
            url: "/cpanel/inc/confirmed.php",
            beforeSend: function (b) {},
            success: function (b) {
                if (b.pay == "1") {
                    alert(b.desc);
                }
                if (b.pay == "2") {
                    location.href = "/expo/cpanel/payment/";
                }
                if (b.pay == "3") {
                    alert(b.desc);
                }
            }
        });
    });
});
