function openWhatsApp() {
    window.open('https://wa.me/your-whatsapp-number', '_blank');
}

// Form submission
// 主表单

/*document.querySelector('form').addEventListener('submit', function(e) {
    e.preventDefault();
    alert('Thank you for your inquiry! We will contact you soon.');
});

// FAQ Form submission
document.querySelector('.faq-contact-form').addEventListener('submit', function(e) {
    e.preventDefault();
    alert('Thank you for your question! Our experts will get back to you within 2 hours.');
});*/

// Quote button functionality
document.querySelectorAll('.quote-btn, .showcase-btn').forEach(btn => {
    btn.addEventListener('click', function() {
        document.querySelector('#main-content').scrollIntoView({
            behavior: 'smooth'
        });
    });
});

// FAQ functionality
document.querySelectorAll('.faq-question').forEach(question => {
    question.addEventListener('click', function() {
        const answer = this.nextElementSibling;
        const isActive = this.classList.contains('active');
        // Close all other FAQs
        document.querySelectorAll('.faq-question').forEach(q => {
            q.classList.remove('active');
            q.nextElementSibling.classList.remove('active');
        });
        // Toggle current FAQ
        if (!isActive) {
            this.classList.add('active');
            answer.classList.add('active');
        }
    });
});
$(document).on('click','.submit-btn,.faq-submit-btn',function () {
    $(this).removeClass("submit-btn");
    var cur = $(this);
    var post_data = $(this).parent().serializeArray();

    $.ajax({
        url: '/ajax/post/',
        type: 'post',
        data: post_data,
        async: false,
        error: function () {
            alert('error');
        },
        success: function (data) {
            var data = JSON.parse(data);
            if(data.status){
                //alert('Thank you, we will contact you as soon as possible');
                window.location.href = thanks;
                return false;
            }else{
                alert(data.info);
                cur.addClass('submit-btn');

            }
            return false;
        }
    });
    return false;
})