function pageScroll(){window.scrollBy(0,-100);scrolldelay=setTimeout("pageScroll()",10);var n=document.documentElement.scrollTop+document.body.scrollTop;n==0&&clearTimeout(scrolldelay)}function pageScrollBottom(){window.scrollBy(0,100);scrolldelaybottom=setTimeout("pageScrollBottom()",10);var n=$(document).height()-$(document).scrollTop();n<1e3&&clearTimeout(scrolldelaybottom)}$(function(){function t(){const n=document.documentElement.scrollTop,t=window.innerHeight,f=Math.max(document.body.scrollHeight,document.body.offsetHeight,document.documentElement.clientHeight,document.documentElement.scrollHeight,document.documentElement.offsetHeight),e=f-(n+t);n>u?i.classList.remove("hidden"):i.classList.add("hidden");e>u?r.classList.remove("hidden"):r.classList.add("hidden")}const i=document.getElementById("scrollFloatTop"),r=document.getElementById("scrollFloatBottom"),u=300;let f;window.addEventListener("scroll",function(){clearTimeout(f);f=setTimeout(t,50)});document.addEventListener("DOMContentLoaded",t);window.addEventListener("load",t);const e=document.querySelector(".side-nav"),o=document.querySelector("#section-enterprises");if(o){const s=o.offsetTop-300;let n=!1;window.addEventListener("scroll",function(){const t=window.scrollY;t>s&&!n?(e.classList.add("visible"),n=!0):t<=s&&n&&(e.classList.remove("visible"),n=!1)});window.dispatchEvent(new Event("scroll"))}});$(function(){window.onscroll=function(){$(document).scrollTop()>=200?($(".header_fixed").addClass("header_top_fixed"),$(".header_fixed > .container").addClass("container_fixed")):($(".header_fixed").removeClass("header_top_fixed"),$(".header_fixed > .container").removeClass("container_fixed"))}});$(function(){var n=layui.form,t;n.on("submit(login-btn)",function(){return $loginBtn.addClass("layui-btn-disabled"),layer.load(2),!0});alert=function(n){layui!==null&&layui!==undefined&&layui.layer!==null&&layui.layer!==undefined?layui.layer.msg(n):alert(n)};t=function(n){alert(n)}});$(function(){function t(){const n=o();r.placeholder=e[n]||"请输入您要搜索的关键字";u.setAttribute("way",n);f.style.display=n==="0"?"inline-block":"none"}function o(){const n=document.querySelector(".option.selected");return n?n.getAttribute("data-value"):"0"}const n=document.querySelectorAll(".option"),i=document.querySelector(".selected-option"),r=document.getElementById("searchInput"),u=document.querySelector("button[way]"),f=document.getElementById("batchSearchBtn"),e={"0":"请输入CAS号,化合物名称,分子式","1":"请输入企业名称","5":"请输入生物产品名称","6":"请输入功能化工材料名称或关键词"};n.forEach(r=>{r.addEventListener("click",function(){const u=this.getAttribute("data-value"),r=this.textContent;n.forEach(n=>n.classList.remove("selected"));this.classList.add("selected");i.textContent=r;t();console.log("选中了:",r,"值:",u)})});t()});$(".header_fixed .container .header_logo_search .search_box form").on("keydown",function(n){if(n.key==="Enter"||n.keyCode===13){var i=$(this),t=i.find("button"),r=t.attr("way");r&&(n.preventDefault(),t.click())}});$(".header_fixed .container .header_logo_search .search_box form>button").click(function(){var u=$(this),t=u.attr("way"),i,n,r;if(t&&(i=u.parent().find("input"),i)){if(n=i.val(),!n||n.trim()==""){r=i.attr("placeholder");r||(r="请输入关键词搜索");alert(r);return}n=encodeURIComponent(n);t=="0"?location.href="http://hg.y866.cn/compound/lib/scimg/search_"+n:t=="1"?location.href="http://hg.y866.cn/compound/lib/scimg/companysearch_"+n:t=="5"?location.href="http://hg.y866.cn/compound/lib/scimg/searchsw_"+n:t=="6"&&(location.href="http://hg.y866.cn/compound/lib/scimg/searchgncl_"+n)}});$(function(){function h(){var u=$(".li-kj-nav-procata .dropdown-menu"),r=location.href,f=$(".li-kj-nav-procata").data("homeurl"),e=r.indexOf("index.html")>0||/^https?:\/\/(localhost|127\.0\.0\.1):\d+\/$/i.test(r)||r==f;e?(u.show(),setTimeout(function(){var r=$(".li-kj-nav-procata .dropdown-menu > li").first(),t=r.find(".first-nav").data("category");t&&(i(t),n=t)},100),t=!0):(u.hide(),t=!1,n=null)}function i(t){$(".category-content").removeClass("show");$(".left-menu").hide();$(".first-nav i").css("transform","rotate(0deg)");$("#"+t).addClass("show");$('.first-nav[data-category="'+t+'"] i').css("transform","rotate(90deg)");var r=$("#"+t+" .second-nav-box a").first(),i=r.data("id");i&&e(i);currentCategory=t;n=t}function c(t){$("#"+t).removeClass("show");$(".left-menu").hide();$('.first-nav[data-category="'+t+'"] i').css("transform","rotate(0deg)");currentCategory=null;n=null}function e(n){$(".left-menu").hide();var t=$("#"+n);t.length&&t.show();currentSubCategory=n}var r=$(".side-nav a"),o=$(".side-nav li"),s=r.map(function(){var n=$($(this).attr("href"));if(n.length)return n}),f=180,u,t,n;r.click(function(n){n.preventDefault();var i=$(this).attr("href"),t=$(i);t.length&&$("html, body").animate({scrollTop:t.offset().top-f+10},500)});$(window).scroll(function(){var i=$(this).scrollTop()+f,n=s.map(function(){if($(this).offset().top0||/^https?:\/\/(localhost|127\.0\.0\.1):\d+\/$/i.test(u)||u==o,f,e,r;s||t||(f=$(".li-kj-nav-procata .dropdown-menu"),f.show(),e=$(".li-kj-nav-procata .dropdown-menu > li").first(),r=e.find(".first-nav").data("category"),r&&(i(r),n=r),t=!0)});$(".category-toggle").click(function(r){var f,e,u;r.preventDefault();r.stopPropagation();f=$(".li-kj-nav-procata .dropdown-menu");t||(f.show(),e=$(".li-kj-nav-procata .dropdown-menu > li").first(),u=e.find(".first-nav").data("category"),u&&(i(u),n=u),t=!0)});$(document).on("click",".first-nav",function(t){t.preventDefault();t.stopPropagation();var f=$(this),r=f.data("category");r&&(clearTimeout(u),n===r?c(r):i(r))});$(".second-nav-box a").mouseenter(function(){if(n){var i=$(this),t=i.data("id");if(!t)return;clearTimeout(u);e(t)}});$(".li-kj-nav-procata .dropdown-menu, .category-content, .second-nav-box, .left-menu").mouseenter(function(){clearTimeout(u)});$(".li-kj-nav-procata").mouseleave(function(){var n=location.href,r=$(".li-kj-nav-procata").data("homeurl"),u=n.indexOf("index.html")>0||/^https?:\/\/(localhost|127\.0\.0\.1):\d+\/$/i.test(n)||n==r,i;u||(i=$(".li-kj-nav-procata .dropdown-menu"),i.hide(),t=!1)});$(document).click(function(i){if(!$(i.target).closest(".li-kj-nav-procata").length){$(".category-content").removeClass("show");$(".left-menu").hide();$(".first-nav i").css("transform","rotate(0deg)");n=null;currentCategory=null;var r=location.href,u=$(".li-kj-nav-procata").data("homeurl"),f=r.indexOf("index.html")>0||/^https?:\/\/(localhost|127\.0\.0\.1):\d+\/$/i.test(r)||r==u;f||($(".li-kj-nav-procata .dropdown-menu").hide(),t=!1)}});h()});$(".toggle-hover").on("mouseenter",function(){var n=$($(this).attr("href"));$(".collapse").not(n).collapse("hide").removeClass("active");n.collapse("show").addClass("active")});$(document).ready(function(){$(".second-nav-box a[data-id]").on("mouseenter",function(){var t=$(this).data("id"),n=$(this).closest("li.dropdown");n.find(".left-menu").show();n.find(".left-menu > .dropdown").hide();n.find(".left-menu > .dropdown#"+t).show()});$(".li-kj-nav-procata > ul > li.dropdown").on("mouseleave",function(){$(this).find(".left-menu").hide()})});$(function(){var n=$("#main-nav").data("navtype");n?($("#main-nav li").removeClass("active"),$('#main-nav li[data-navtype="'+n+'"]').addClass("active")):$("#main-nav li").removeClass("active")});$(function(){var n=document.querySelectorAll(".qq-copy-link");n.forEach(function(n){var i=n.querySelector(".link-text"),r=n.getAttribute("data-original-text"),t=n.getAttribute("data-qq");n.addEventListener("mouseenter",function(){i.textContent=t});n.addEventListener("mouseleave",function(){i.textContent=r});n.addEventListener("click",function(n){function r(n){return navigator.clipboard&&navigator.clipboard.writeText?navigator.clipboard.writeText(n).then(()=>(console.log("使用Clipboard API复制成功"),!0)).catch(n=>(console.error("Clipboard API复制失败:",n),!1)):(console.error("不支持Clipboard API复制"),!1)}function i(n,t){var i=document.getElementById("copyTip");i.textContent=n;t?(i.style.setProperty("--tip-width","140px"),i.style.setProperty("--tip-right","80px"),i.style.backgroundColor="#4caf50"):(i.style.setProperty("--tip-width","180px"),i.style.setProperty("--tip-right","60px"),i.style.backgroundColor="#f44336");i.classList.add("show");setTimeout(()=>{i.classList.remove("show")},2e3)}n.preventDefault();console.log("开始复制QQ号:",t);r(t).then(n=>{var t=document.getElementById("copyTip");n?i("已复制到剪贴板",!0):i("复制失败,请手动复制",!1)})})})});$(function(){var t=[],i,n;for($(".html-placeholder").each(function(){var i=this,r=$(i).attr("pageid"),n=$(i).attr("pagedata");n&&(n=eval("("+n+")"));t.push({el:i,loaded:0,pageid:r,pagedata:n})}),i=function(n){var i=n.pageid,t=n.pagedata,r=n.el;n.loaded==0&&(n.loaded=1,$.ajax({url:"http://hg.y866.cn/compound/lib/scimg/content/chemcss/2024html/"+i+".html",type:"get",success:function(i){var u=i,f;if(n.loaded=2,t!=null)for(f in t)u=u.replaceAll("${"+f+"}",t[f]);$(r).replaceWith(u)}}))},n=0;n