u003cscriptu003enjQuery(document).ready(function($) {n // Define all target sections in an arrayn var sections = ['overview','functionandfeatures', 'modelandoption','SupportAndDownload'];nn // Iterate over each section to apply click behaviorn sections.forEach(function(sectionId) {n $('a[href=u0022#' + sectionId + 'u0022]').click(function(e) {n e.preventDefault(); // Prevent default anchor behaviornn // Clear the current hash and set the hash again to ensure the URL is updatedn history.pushState(u0022u0022, document.title, window.location.pathname + window.location.search + '#' + sectionId);n });n });n});nu003c/scriptu003en
u003cstyleu003en .support_image_5, .support_image_6, .support_image_7 {n display: none;n }nn .brochure_section, .specification_section, .firmware_section, .serviceVideo_section, .factSheets_section, .media_section {n display: block;n }nn .clicked {n background-color: #047bcb !important;n color: white !important;n }nn .clicked img {n filter: brightness(0) invert(1);n }nn .clicked h4, .clicked .et_pb_module_header {n color: white !important;n }nu003c/styleu003ennu003cscriptu003en document.addEventListener(u0022DOMContentLoadedu0022, function() {n const mappings = {n 'support_image_1': 'documents_section',n 'support_image_2': 'brochure_section',n 'support_image_3': 'firmware_section',n 'support_image_4': 'specification_section',n 'support_image_5': 'media_section',n 'support_image_6': 'factSheets_section',n 'support_image_7': 'serviceVideo_section',n };nn function displayConditionalElements() {n if (localStorage.getItem('token')) {n document.querySelectorAll('.support_image_5, .support_image_6, .support_image_7').forEach(element =u003e {n element.style.display = 'block';n });n }n }nn // Display certain elements if token is found in local storagen displayConditionalElements();nn // Function to hide all sectionsn function hideAllSections() {n document.querySelectorAll(Object.values(mappings).map(v =u003e '.' + v).join(', ')).forEach(section =u003e section.style.display = 'none');n }nn // Function to show a specific sectionn function showSection(sectionClass) {n hideAllSections();n const section = document.querySelector('.' + sectionClass);n if (section) section.style.display = 'block';n }nn // Event listeners for support imagesn const supportImages = document.querySelectorAll(Object.keys(mappings).map(k =u003e '.' + k).join(', '));n supportImages.forEach(element =u003e {n element.addEventListener('click', function() {n supportImages.forEach(el =u003e el.classList.remove('clicked'));n element.classList.add('clicked');n showSection(mappings[element.className.split(' ').find(cl =u003e cl.startsWith('support_image_'))]);n history.pushState(null, null, '#' + mappings[element.className.split(' ').find(cl =u003e cl.startsWith('support_image_'))]);n });n });nn // Function to handle hash changes and update stylesn function updateStylesBasedOnHash() {n let hash = window.location.hash.substring(1);nn if (Object.values(mappings).includes(hash)) {n Object.entries(mappings).forEach(([imageClass, sectionClass]) =u003e {n const element = document.querySelector('.' + imageClass);n if (sectionClass === hash) {n element.classList.add('clicked');n showSection(sectionClass);n } else {n if (element) element.classList.remove('clicked');n }n });n } else {n // Show the default section without updating the URLn showSection('documents_section');n document.querySelector('.support_image_1').classList.add('clicked');n }n }nn // Listening for hash changesn window.addEventListener('hashchange', updateStylesBasedOnHash);n updateStylesBasedOnHash(); // Initial callnn // Function to handle scrollingn window.addEventListener('load', function() {n function scrollToElement() {n const hash = window.location.hash.substring(1);n if (hash) {n const section = document.getElementById('SupportAndDownload');n if (section) {n section.scrollIntoView({ behavior: 'smooth' });n }n }n }nn window.addEventListener('hashchange', scrollToElement);n scrollToElement(); // Initial calln });nn // Intersection Observer to monitor the visibility of the specification_sectionn const observer = new IntersectionObserver((entries) =u003e {n entries.forEach(entry =u003e {n if (!entry.isIntersecting u0026u0026 window.location.hash === '#specification_section') {n history.pushState(u0022u0022, document.title, window.location.pathname); // Remove hash from URL without refreshing the pagen }n });n }, { threshold: 0.1 }); // Threshold to determine when the section is considered out of viewnn observer.observe(document.querySelector('.specification_section'));nn // Simulate successful login for testingn document.getElementById('loginButton').addEventListener('click', function() {n localStorage.setItem('token', 'your-login-token');n displayConditionalElements();n });n });nu003c/scriptu003en
u003cscriptu003en document.addEventListener('DOMContentLoaded', (event) =u003e {n const backToTopElements = document.querySelectorAll('.back-to-top-arrow-up');nn const toggleVisibility = () =u003e {n if (window.scrollY u003e 0) {n backToTopElements.forEach(el =u003e el.style.display = 'block');n } else {n backToTopElements.forEach(el =u003e el.style.display = 'none');n }n };nn // Throttle scroll eventn window.addEventListener('scroll', _.throttle(toggleVisibility, 100));n toggleVisibility(); // Call on initial load in case the page is not at the topn});nu003c/scriptu003e
u003cscriptu003endocument.addEventListener('DOMContentLoaded', function () {n document.querySelectorAll('.download-icon').forEach(function (icon) {n icon.addEventListener('click', function (e) {n e.preventDefault();nn const blurb = icon.closest('.blurb-product-photos');n if (!blurb) return;nn const img = blurb.querySelector('.et_pb_image_wrap img');n if (!img) return;nn const filename = img.src.split('/').pop();nn // Create canvas and draw image on itn const canvas = document.createElement('canvas');n const context = canvas.getContext('2d');n const tempImage = new Image();nn // Set crossOrigin to allow drawing (MUST be set before src)n tempImage.crossOrigin = 'anonymous';n tempImage.src = img.src;nn tempImage.onload = function () {n canvas.width = tempImage.naturalWidth;n canvas.height = tempImage.naturalHeight;n context.drawImage(tempImage, 0, 0);nn // Convert canvas to blob and downloadn canvas.toBlob(function (blob) {n const link = document.createElement('a');n link.href = URL.createObjectURL(blob);n link.download = filename;n document.body.appendChild(link);n link.click();n document.body.removeChild(link);n }, 'image/png');n };nn tempImage.onerror = function () {n alert(u0022Unable to download due to CORS or image load error.u0022);n };n });n });n});nu003c/scriptu003en
u003cscriptu003endocument.addEventListener('DOMContentLoaded', (event) =u003e {n // Preload imagesn var images = document.querySelectorAll('.product-gallery-view img');n images.forEach(function(image) {n var img = new Image();n img.src = image.src;n });nn // Get the button that opens the modaln var btn = document.querySelector('.product-gallery-view-button');n //var btn = document.getElementById('product-gallery-view-button');nn // Create the modal structuren var modal = document.createElement('div');n modal.className = 'product-gallery-view modal';nn var modalContent = document.createElement('div');n modalContent.className = 'modal-content';n modal.appendChild(modalContent);nn var closeModal = document.createElement('span');n closeModal.className = 'close-modal';n closeModal.innerHTML = '×';nn // Append the close button and modal content to the modaln modalContent.appendChild(closeModal);n // Append the modal to the bodyn document.body.appendChild(modal);nnn // Get the slider content and move it into the modal contentn var slider = document.querySelector('.product-gallery-view');n if (slider) {n modalContent.appendChild(slider);n }nn // When the user clicks the button, open the modaln btn.onclick = function(event) {n event.preventDefault(); // Prevent default actionn modal.style.display = u0022blocku0022;n n // Ensure the first image is displayedn var firstImage = images[0];n if (firstImage) {n firstImage.style.display = 'block';n }nn // Trigger a resize event to force the slider to updaten window.dispatchEvent(new Event('resize'));nn // Or you can try to re-initialize the slider if Divi provides such functionalityn if (typeof window.et_pb_init_slider !== 'undefined') {n window.et_pb_init_slider(); // Re-initialize Divi slidern }n }nn // When the user clicks on u003cspanu003e (x), close the modaln closeModal.onclick = function() {n modal.style.display = u0022noneu0022;n }nn // When the user clicks anywhere outside of the modal, close itn window.onclick = function(event) {n if (event.target === modal) {n modal.style.display = u0022noneu0022;n }n }n});nu003c/scriptu003en
u003cscriptu003en document.addEventListener('DOMContentLoaded', function() {n checkLoginStatus();nn // Add event listener if token does not existn document.querySelector('.login-for-reseller').addEventListener('click', function() {n // Directly jump to the main headern document.getElementById('main-header').scrollIntoView({ behavior: 'auto', block: 'start' });nn // Add a timeout to ensure the scrolling is completed before showing the login boxn setTimeout(showLoginBoxRow, 100); // Adjust the timeout duration as neededn });nn // Create a MutationObserver to listen for changes in local storagen const observer = new MutationObserver(checkLoginStatus);n observer.observe(document, { attributes: true, childList: true, subtree: true });nn // Override the setItem function of localStorage to detect changesn (function() {n const originalSetItem = localStorage.setItem;n localStorage.setItem = function(key, value) {n const event = new Event('itemInserted');n event.value = value;n event.key = key;n document.dispatchEvent(event);n originalSetItem.apply(this, arguments);n };n })();nn // Listen for custom event to trigger checkLoginStatusn document.addEventListener('itemInserted', function(e) {n if (e.key === 'token') {n checkLoginStatus();n }n });n });nn function checkLoginStatus() {n // Check for token in local storagen const token = localStorage.getItem('token'); // 'token' is the key namenn if (token) {n // Hide the login-for-reseller-row if token existsn document.querySelector('.login-for-reseller-row').style.display = 'none';n } else {n // Ensure the login-for-reseller-row is visible if token does not existn document.querySelector('.login-for-reseller-row').style.display = 'block';n }n }nn function showLoginBoxRow() {n document.querySelector('.login-box-row').style.display = 'block';n document.getElementById('loginBox').style.display = 'block';n }nu003c/scriptu003en