
// rem设置
(function (doc, win) {
    var docEl = doc.documentElement,
        resizeEvt = "orientationchange" in window ? "orientationchange" : "resize",
        recalc = function () {
            var clientWidth = docEl.clientWidth;
            if (!clientWidth) return;
            if (clientWidth >= 1920) {
                docEl.style.fontSize = "10px";
            } else if (clientWidth >= 1280) {
                docEl.style.fontSize = 10 * (clientWidth / 1920) + "px";
            } else {
                docEl.style.fontSize = 10 * (1280 / 1920) + "px";
            }
        };
    if (!doc.addEventListener) return;
    win.addEventListener(resizeEvt, recalc, false);
    doc.addEventListener("DOMContentLoaded", recalc, false);
    recalc();
})(document, window);

var pagew = $(document).outerWidth(true) + (window.innerWidth - document.body.clientWidth);
var pageh = $(window).innerHeight();

$(window).on("resizeEnd", function (event) {
    repage();
});

repage();

function repage() {
    pagew = $(document).outerWidth(true) + (window.innerWidth - document.body.clientWidth);
    pageh = $(window).innerHeight();
    document.title = document.title + " * " + pagew + " * " + pageh;
}


try {
    var loadImg = imagesLoaded("#container");
    loadImg.on("done", function () {

    });

}
catch (e) { }


try {
    $(".topfr .top_user").each(function () {
        $(this).hover(
            function () {
                $(this).find(".top_u_c").stop(true, true).velocity("transition.slideUpIn", { duration: 650 });
            },
            function () {
                $(this).find(".top_u_c").stop(true, true).css({ "display": "none" });
            }
        );
    });
}
catch (e) { }

// 合格投资者认证
// let qualified = getCookie('qualified');
// if (!getCookie('qualified')) {
//   $('#exampleModalCenter').modal('show');
// }

//禁用滚动条
function unScroll() {
    var top = $(document).scrollTop();
    $(document).on('scroll.unable', function (e) {
        $(document).scrollTop(top);
    })
}
//停止禁用滚动条
function removeUnScroll() {
    $(document).unbind("scroll.unable");
}

// $('#exampleModalCenter').modal('show');
// unScroll()

$('#exampleModalCenter .modal-first-bottom-giveup').click(function () {
    window.location.reload();
})

$('.modal-first-bottom-accept').click(function () {
    removeUnScroll()
    $('#exampleModalCenter').modal('hide');
    setCookie('qualified', true, 60 * 70 * 1);
})