$(document).ready(function(){
	$(".TQZY_dropdown").each(function(e, t) {
	    const o = $(this).find(".TQZY_dropdown_menu")
	      , a = $(t).attr("trigger") || "click"
	      , n = $(t).attr("placement") || $(this).height() || 0;
	    o.css("top", n),
	    "hover" === a ? $(this).hover(()=>$(this).addClass("active"), ()=>$(this).removeClass("active")) : ($(this).on("click", function(e) {
	        $(this).toggleClass("active"),
	        $(document).one("click", ()=>$(this).removeClass("active")),
	        e.stopPropagation()
	    }),
	    o.on("click", e=>e.stopPropagation()))
	});
	//移动端
	$(".TQZY_header_above_align").on("click", function() {
	    $(".TQZY_header_msearch").removeClass("active"),
	    $(".TQZY_header_mslide").hasClass("active") ? ($("body").css("overflow", ""),
	    $(".TQZY_header_mask").removeClass("active mslide"),
	    $(".TQZY_header_mslide").removeClass("active")) : ($("body").css("overflow", "hidden"),
	    $(".TQZY_header_mask").addClass("active mslide"),
	    $(".TQZY_header_mslide").addClass("active"))
	});
	$(".TQZY_header_above_searchicon").on("click", function() {
	    $(".TQZY_header_mslide").removeClass("active"),
	    $(".TQZY_header_msearch").hasClass("active") ? ($("body").css("overflow", ""),
	    $(".TQZY_header_mask").removeClass("active mslide"),
	    $(".TQZY_header_msearch").removeClass("active")) : ($("body").css("overflow", "hidden"),
	    $(".TQZY_header_mask").addClass("active"),
	    $(".TQZY_header_msearch").addClass("active"))
	});
	$(".TQZY_header_mask").on("click", function() {
	    $("body").css("overflow", ""),
	    $(".TQZY_header_mask").removeClass("active mslide"),
	    $(".TQZY_header_msearch").removeClass("active"),
	    $(".TQZY_header_mslide").removeClass("active")
	});
	$(".TQZY_header_menu .current").parents(".menu_Submenu").show().siblings(".menu_panel").addClass("TQZY_in"),
	$(".TQZY_header_menu .menu_panel").on("click", function() {
	    const e = $(this).parent().parent();
	    e.find(".menu_panel").not($(this)).removeClass("TQZY_in"),
	    e.find(".menu_Submenu").not($(this).siblings(".menu_Submenu")).stop().hide(),
	    $(this).toggleClass("TQZY_in").siblings(".menu_Submenu").stop().toggle();
	});
	//选项卡
	$(".profile_tab , .profile_tab_this ").click(function(){
		$(this).siblings('li').attr('class','profile_tab');
		$(this).attr('class','profile_tab_this');
		$(this).parent().siblings('ul').removeClass('this_active');
		$(this).parent().siblings('ul').eq($(this).index()).addClass('this_active');
		$("img.imgload").lazyload({effect: "fadeIn"});
	});
	$("img.imgload").lazyload({effect: "fadeIn"});
});
layui.use(function(){
    var laydate = layui.laydate;
    laydate.render({
        elem: '#tianqi_laydate',
        position: 'static'
    });
});

if (!window.TQZY.IS_MOBILE) {
	let e = !0;
	let rightside = document.getElementById('rightside');
	const t = t => {
		if (window.pageYOffset >= $(".TQZY_header").height()) {
			$(".TQZY_header").addClass("active");
			rightside.style.cssText = "opacity: 0.8; transform: translateX(-58px);";
		} else {
		    rightside.style.cssText =  "";
			$(".TQZY_header").removeClass("active");
		}
	};
	let o = window.pageYOffset;
	t(o);
	let a = Date.now();
	document.addEventListener("scroll", () => {
		let e = Date.now();
		e - a > 15 && (t(o - window.pageYOffset), o = window.pageYOffset), a = e
	});
	
}
rightside();
function rightside() {
	let pageHeight = document.body.scrollHeight || document.documentElement.scrollHeight; // 页面总高度
	// 浏览器视口高度
	let windowHeight = document.documentElement.clientHeight || document.body.clientHeigh;
	let scrollAvail = pageHeight - windowHeight; // 可滚动的高度
	window.onscroll = function() {
		let scrollTop = document.documentElement.scrollTop || document.body.scrollTop || window.pageYOffset; // 获取滚动条的高度
		let scrollcount =  Math.round(scrollTop / scrollAvail * 100);
		// 计算占比
		document.querySelector('#percent').innerHTML = scrollcount;
		if (scrollcount <= 95) {
		    document.querySelector("#go-up").childNodes[1].style.display = "none";
		    document.querySelector("#percent").style.display = "block";
		    document.querySelector("#go-down").style.display = "block";
		}else{
		    document.querySelector("#go-up").childNodes[1].style.display = "block";
		    document.querySelector("#percent").style.display = "none";
		    document.querySelector("#go-down").style.display = "none";
		}
	};
}