/* Js for , Version=1778503971 */
 v.lang = {"confirmDelete":"\u60a8\u786e\u5b9a\u8981\u6267\u884c\u5220\u9664\u64cd\u4f5c\u5417\uff1f","deleteing":"\u5220\u9664\u4e2d","doing":"\u5904\u7406\u4e2d","loading":"\u52a0\u8f7d\u4e2d","updating":"\u66f4\u65b0\u4e2d...","timeout":"\u7f51\u7edc\u8d85\u65f6,\u8bf7\u91cd\u8bd5","errorThrown":"\u6267\u884c\u51fa\u9519\uff1a","continueShopping":"\u7ee7\u7eed\u8d2d\u7269","required":"\u5fc5\u586b","back":"\u8fd4\u56de","continue":"\u7ee7\u7eed","bindWechatTip":"\u53d1\u5e16\u529f\u80fd\u8bbe\u7f6e\u4e86\u7ed1\u5b9a\u5fae\u4fe1\u7684\u9650\u5236\uff0c\u8bf7\u5148\u7ed1\u5b9a\u5fae\u4fe1\u4f1a\u5458\u3002","importTip":"\u53ea\u5bfc\u5165\u4e3b\u9898\u7684\u98ce\u683c\u548c\u6837\u5f0f","fullImportTip":"\u5c06\u4f1a\u5bfc\u5165\u6d4b\u8bd5\u6570\u636e\u4ee5\u53ca\u66ff\u6362\u7ad9\u70b9\u6587\u7ae0\u3001\u4ea7\u54c1\u7b49\u6570\u636e"};;$('#block391').find('.slide-card').click(function(){
    location.href = $(this).data('url');
});;
document.addEventListener('DOMContentLoaded', function() {
    try {
        const canvas = document.getElementById('particles-canvas');
        if (canvas && canvas.getContext) {
            const ctx = canvas.getContext('2d');
            let particles = [];
            function resize() {
                canvas.width = window.innerWidth;
                canvas.height = window.innerHeight;
            }
            resize();
            window.addEventListener('resize', resize);

            class Particle {
                constructor() {
                    this.x = Math.random() * canvas.width;
                    this.y = Math.random() * canvas.height;
                    this.size = Math.random() * 1.5 + 0.5;
                    this.speedX = (Math.random() - 0.5) * 0.2;
                    this.speedY = (Math.random() - 0.5) * 0.2;
                    this.opacity = Math.random() * 0.3 + 0.1;
                }
                update() {
                    this.x += this.speedX;
                    this.y += this.speedY;
                    if (this.x < 0) this.x = canvas.width;
                    if (this.x > canvas.width) this.x = 0;
                    if (this.y < 0) this.y = canvas.height;
                    if (this.y > canvas.height) this.y = 0;
                }
                draw() {
                    ctx.fillStyle = `rgba(0,255,136,${this.opacity})`;
                    ctx.beginPath();
                    ctx.arc(this.x, this.y, this.size, 0, Math.PI * 2);
                    ctx.fill();
                }
            }

            function init() {
                particles = [];
                const num = Math.min(60, Math.floor((canvas.width * canvas.height) / 25000));
                for (let i = 0; i < num; i++) particles.push(new Particle());
            }

            function connect() {
                const max = 100;
                for (let i = 0; i < particles.length; i++) {
                    for (let j = i + 1; j < particles.length; j++) {
                        const dx = particles[i].x - particles[j].x;
                        const dy = particles[i].y - particles[j].y;
                        const dist = Math.hypot(dx, dy);
                        if (dist < max) {
                            ctx.strokeStyle = `rgba(0,255,136,${(1 - dist/max)*0.1})`;
                            ctx.lineWidth = 0.3;
                            ctx.beginPath();
                            ctx.moveTo(particles[i].x, particles[i].y);
                            ctx.lineTo(particles[j].x, particles[j].y);
                            ctx.stroke();
                        }
                    }
                }
            }

            function anim() {
                ctx.clearRect(0,0,canvas.width,canvas.height);
                particles.forEach(p => { p.update(); p.draw(); });
                connect();
                requestAnimationFrame(anim);
            }

            init();
            anim();
            window.addEventListener('resize', () => { resize(); init(); });
        }
    } catch(e) {}

    // 时钟
    const clock = document.getElementById('clock');
    if (clock) {
        setInterval(() => {
            clock.textContent = new Date().toLocaleTimeString('zh-CN', { hour12: false });
        }, 1000);
    }

    // 滚动动画
    const observer = new IntersectionObserver(entries => {
        entries.forEach(e => {
            if (e.isIntersecting) e.target.classList.add('animated');
        });
    }, { threshold: 0.1 });

    document.querySelectorAll('.animate-on-scroll').forEach(el => observer.observe(el));

    // 平滑滚动
    document.querySelectorAll('#pqitech-neon a[href^="#"]').forEach(a => {
        a.addEventListener('click', e => {
            e.preventDefault();
            const t = document.querySelector(a.getAttribute('href'));
            if (t) t.scrollIntoView({ behavior: 'smooth' });
        });
    });

    // 卡片点击
    document.querySelectorAll('.solution-card, .product-card, .agency-card').forEach(card => {
        card.addEventListener('click', () => {
            const url = card.dataset.url;
            if (url) window.open(url, '_blank');
        });
    });

    // 合作伙伴
    const track = document.getElementById('partnersTrack');
    if (track) {
        const listRow1 = [
            "/file.php?f=source/default/wide/20 (1).png&t=png&o=source&s=&v=1762247214", "/file.php?f=source/default/wide/20 (2).png&t=png&o=source&s=&v=1762247214",
            "/file.php?f=source/default/wide/20 (3).png&t=png&o=source&s=&v=1762247214", "/file.php?f=source/default/wide/20 (11).png&t=png&o=source&s=&v=1762247214",
            "/file.php?f=source/default/wide/20 (12).png&t=png&o=source&s=&v=1762247214", "/file.php?f=source/default/wide/20 (13).png&t=png&o=source&s=&v=1762247214",
            "/file.php?f=source/default/wide/20 (14).png&t=png&o=source&s=&v=1762247214", "/file.php?f=source/default/wide/20 (15).png&t=png&o=source&s=&v=1762247214",
            "/file.php?f=source/default/wide/20 (16).png&t=png&o=source&s=&v=1762247214", "/file.php?f=source/default/wide/20 (17).png&t=png&o=source&s=&v=1762247214",
            "/file.php?f=source/default/wide/20 (18).png&t=png&o=source&s=&v=1762247214", "/file.php?f=source/default/wide/20 (19).png&t=png&o=source&s=&v=1762247214",
            "/file.php?f=source/default/wide/20 (20).png&t=png&o=source&s=&v=1762247214", "/file.php?f=source/default/wide/20 (21).png&t=png&o=source&s=&v=1762247214"
        ];
        
        const listRow2 = [
            "/file.php?f=source/default/wide/20 (22).png&t=png&o=source&s=&v=1762247214", "/file.php?f=source/default/wide/20 (23).png&t=png&o=source&s=&v=1762247214",
            "/file.php?f=source/default/wide/20 (24).png&t=png&o=source&s=&v=1762247214", "/file.php?f=source/default/wide/20 (25).png&t=png&o=source&s=&v=1762247214",
            "/file.php?f=source/default/wide/20 (26).png&t=png&o=source&s=&v=1762247214", "/file.php?f=source/default/wide/20 (27).png&t=png&o=source&s=&v=1762247214",
            "/file.php?f=source/default/wide/20 (28).png&t=png&o=source&s=&v=1762247214", "/file.php?f=source/default/wide/20 (29).png&t=png&o=source&s=&v=1762247214",
            "/file.php?f=source/default/wide/20 (30).png&t=png&o=source&s=&v=1762247214", "/file.php?f=source/default/wide/20 (31).png&t=png&o=source&s=&v=1762247214",
            "/file.php?f=source/default/wide/20 (32).png&t=png&o=source&s=&v=1762247214", "/file.php?f=source/default/wide/20 (4).png&t=png&o=source&s=&v=1762247214",
            "/file.php?f=source/default/wide/20 (5).png&t=png&o=source&s=&v=1762247214", "/file.php?f=source/default/wide/20 (6).png&t=png&o=source&s=&v=1762247214",
            "/file.php?f=source/default/wide/20 (7).png&t=png&o=source&s=&v=1762247214", "/file.php?f=source/default/wide/33 拷贝.png&t=png&o=source&s=&v=1762325193",
            "/file.php?f=source/default/wide/20 (8).png&t=png&o=source&s=&v=1762247214", "/file.php?f=source/default/wide/20 (9).png&t=png&o=source&s=&v=1762247214",
            "/file.php?f=source/default/wide/20 (10).png&t=png&o=source&s=&v=1762247214"
        ];
        
        track.innerHTML = '';
        
        listRow1.forEach(u => {
            const d = document.createElement('div');
            d.className = 'partner-logo';
            const img = document.createElement('img');
            img.src = u;
            img.alt = '合作伙伴';
            d.appendChild(img);
            track.appendChild(d);
        });
        const clone1 = track.cloneNode(true);
        track.parentElement.appendChild(clone1);
        
        const marquee2 = document.createElement('div');
        marquee2.className = 'partners-marquee';
        marquee2.style.marginTop = '20px';
        
        const track2 = document.createElement('div');
        track2.className = 'partners-track';
        track2.style.animation = 'marquee 30s linear infinite reverse'; // 👈 关键：反向
        
        listRow2.forEach(u => {
            const d = document.createElement('div');
            d.className = 'partner-logo';
            const img = document.createElement('img');
            img.src = u;
            img.alt = '合作伙伴';
            d.appendChild(img);
            track2.appendChild(d);
        });
        const clone2 = track2.cloneNode(true);
        
        marquee2.appendChild(track2);
        marquee2.appendChild(clone2);
        track.parentElement.parentElement.appendChild(marquee2);
    }
});
;$().ready(function() { $('#execIcon').tooltip({title:$('#execInfoBar').html(), html:true, placement:'right'}); }); ;$(document).ready(function()
{          
    // add "index" class to the body element.
    $('body').addClass('index');

    $('.nav-system-home:first').addClass('active');
    $('#navbar li.active').parents('li').addClass('active');
})

;
function loadCartInfo(twinkle)
{
    $('#siteNav').load(createLink('misc', 'printTopBar'),
        function()
        {
            if(twinkle) 
            {
                bootbox.dialog(
                {  
                    message: v.addToCartSuccess,  
                    buttons:
                    {  
                        back:
                        {  
                            label:     v.lang.continueShopping,
                            className: 'btn-primary',  
                            callback:  function(){location.reload();}  
                        },
                        cart:
                        {  
                            label:     v.gotoCart,  
                            className: 'btn-primary',  
                            callback:  function(){location.href = createLink('cart', 'browse');}  
                        }  
                    }  
                });
            }
        }
    );
}
;
var hash = window.location.hash.substring(1);
var browserLanguage = navigator.language || navigator.userLanguage; 
var resolution      = screen.availWidth + ' X ' + screen.availHeight;
$.get(createLink('log', 'record', "hash=" + hash), {browserLanguage:browserLanguage, resolution:resolution});
