window.onload = function () {
	setTimeout(function () {
        const proactiveChatAnchor = document.getElementById('proactiveChatAnchor');
        proactiveChatAnchor.click();
	}, 120000);
};
function openChatWindow(type) {
    const proactiveChat = document.getElementById('ProActiveChat');
    if (proactiveChat) {
        proactiveChat.style.display = 'none';
    }
	
	FWEvent('LC', 'chat_open');
	const chatDimensions = { width: 360, height: 620 };
	const position = {
		left: (window.outerWidth / 2) - (chatDimensions.width / 2),
		top: (window.outerHeight / 2) - (chatDimensions.height / 2)
	};
    const sourceUrl = encodeURIComponent(window.location.href);
    const x = `&ch=${type}&source=${sourceUrl}`;
    window.open('/live-chat/?' + x, "Live Chat",
        `resizable=yes, width=${chatDimensions.width}, height=${chatDimensions.height}, left=${position.left}, top=${position.top}, toolbar=no, location=no, directories=no, menubar=no, status=no, copyhistory=no, scrollbars=no`
    );
}