{"version":3,"names":[],"mappings":"","sources":["custom.js"],"sourcesContent":["(function($) {\r\n function btmHgt() {\r\n var btmHgth1 = $('.hero-btm-sec h1').innerHeight() / 2;\r\n var btmHgt = $('.hero-btm-sec').innerHeight() / 2 + btmHgth1;\r\n $('.hero-btm-sec').css('margin-top', -btmHgt);\r\n\r\n if ($(window).width() > 991) {\r\n var ab = $('.advantage-row .advantage-img').innerHeight() + 200;\r\n $('.advantage-row .advantage-txt').css('min-height', ab);\r\n }\r\n }\r\n\r\n $(window).on(\"load\", function() {\r\n btmHgt()\r\n });\r\n\r\n $(document).ready(function() {\r\n $('#nav-icon1').click(function() {\r\n $(this).toggleClass('open');\r\n $('.header-right').slideToggle();\r\n });\r\n\r\n $(\".left-tabs-sec ul li\").mouseover(function() {\r\n $(this).addClass('active');\r\n $(this).siblings('li').removeClass('active');\r\n var valtxt = $(this).attr('value');\r\n $('#' + valtxt).siblings().hide();\r\n $('#' + valtxt).fadeIn();\r\n });\r\n\r\n $('#parentHorizontalTab').easyResponsiveTabs({\r\n type: 'default', //Types: default, vertical, accordion\r\n width: 'auto', //auto or any width like 600px\r\n fit: true, // 100% fit in a container\r\n tabidentify: 'hor_1', // The tab groups identifier\r\n });\r\n\r\n $('.accordion-list > li:not(:first-child) > .answer').hide();\r\n\r\n $('.accordion-list > li > h3').click(function() {\r\n if ($(this).parent('li').hasClass(\"active\")) {\r\n $(this).parent('li').removeClass(\"active\").find(\".answer\").slideUp();\r\n } else {\r\n $(\".accordion-list > li.active .answer\").slideUp();\r\n $(\".accordion-list > li.active\").removeClass(\"active\");\r\n $(this).parent('li').addClass(\"active\").find(\".answer\").slideDown();\r\n }\r\n return false;\r\n });\r\n\r\n $('.accordin-in > li:not(:first-child) > .data-answer').hide();\r\n $('.accordin-in > li > h4').click(function() {\r\n if ($(this).parent('li').hasClass(\"active\")) {\r\n $(this).parent('li').removeClass(\"active\").find(\".data-answer\").slideUp();\r\n } else {\r\n $(\".accordin-in > li.active .data-answer\").slideUp();\r\n $(\".accordin-in > li.active\").removeClass(\"active\");\r\n $(this).parent('li').addClass(\"active\").find(\".data-answer\").slideDown();\r\n }\r\n return false;\r\n });\r\n $('.filter-option .filter-btn').click(function(e) {\r\n\t\t\t\t \te.preventDefault()\r\n $($(this).attr('href')).fadeIn();\r\n });\r\n $('.filter-popup-wrap .close').click(function() {\r\n $('.filter-popup-wrap').fadeOut();\r\n });\r\n });\r\n\r\n //parallax scroll\r\n $(window).on(\"load scroll\", function() {\r\n if ($(window).width() > 991) {\r\n var parallaxElement = $(\".parallax_scroll\"),\r\n parallaxQuantity = parallaxElement.length;\r\n\r\n window.requestAnimationFrame(function() {\r\n for (var i = 0; i < parallaxQuantity; i++) {\r\n var currentElement = parallaxElement.eq(i),\r\n windowTop = $(window).scrollTop(),\r\n elementTop = currentElement.offset().top,\r\n elementHeight = currentElement.height(),\r\n viewPortHeight = window.innerHeight * .75 - elementHeight * 0.75,\r\n scrolled = windowTop - elementTop + viewPortHeight;\r\n currentElement.css({\r\n transform: \"translate3d(0,\" + scrolled * 0.5 + \"px, 0)\"\r\n });\r\n }\r\n });\r\n }\r\n });\r\n $(window).scroll(function() {\r\n if ($(this).scrollTop() > 60) {\r\n $('.header').addClass(\"sticky\");\r\n } else {\r\n $('.header').removeClass(\"sticky\");\r\n }\r\n });\r\n $(window).resize(function() {\r\n btmHgt();\r\n\r\n });\r\n\r\n})(jQuery);\r\n\r\n\r\n\r\n//////////////////dropdown on select\r\nvar x, i, j, l, ll, selElmnt, a, b, c;\r\n/*look for any elements with the class \"custom-select\":*/\r\nx = document.getElementsByClassName(\"custom-select\");\r\nl = x.length;\r\nfor (i = 0; i < l; i++) {\r\n selElmnt = x[i].getElementsByTagName(\"select\")[0];\r\n ll = selElmnt.length;\r\n /*for each element, create a new DIV that will act as the selected item:*/\r\n a = document.createElement(\"DIV\");\r\n a.setAttribute(\"class\", \"select-selected\");\r\n a.innerHTML = selElmnt.options[selElmnt.selectedIndex].innerHTML;\r\n x[i].appendChild(a);\r\n /*for each element, create a new DIV that will contain the option list:*/\r\n b = document.createElement(\"DIV\");\r\n b.setAttribute(\"class\", \"select-items select-hide\");\r\n for (j = 1; j < ll; j++) {\r\n /*for each option in the original select element,\r\n create a new DIV that will act as an option item:*/\r\n c = document.createElement(\"DIV\");\r\n c.innerHTML = selElmnt.options[j].innerHTML;\r\n c.addEventListener(\"click\", function(e) {\r\n /*when an item is clicked, update the original select box,\r\n and the selected item:*/\r\n var y, i, k, s, h, sl, yl;\r\n s = this.parentNode.parentNode.getElementsByTagName(\"select\")[0];\r\n sl = s.length;\r\n h = this.parentNode.previousSibling;\r\n for (i = 0; i < sl; i++) {\r\n if (s.options[i].innerHTML == this.innerHTML) {\r\n s.selectedIndex = i;\r\n h.innerHTML = this.innerHTML;\r\n y = this.parentNode.getElementsByClassName(\"same-as-selected\");\r\n yl = y.length;\r\n for (k = 0; k < yl; k++) {\r\n y[k].removeAttribute(\"class\");\r\n }\r\n this.setAttribute(\"class\", \"same-as-selected\");\r\n break;\r\n }\r\n }\r\n h.click();\r\n });\r\n b.appendChild(c);\r\n }\r\n x[i].appendChild(b);\r\n a.addEventListener(\"click\", function(e) {\r\n /*when the select box is clicked, close any other select boxes,\r\n and open/close the current select box:*/\r\n e.stopPropagation();\r\n closeAllSelect(this);\r\n this.nextSibling.classList.toggle(\"select-hide\");\r\n this.classList.toggle(\"select-arrow-active\");\r\n });\r\n}\r\nfunction closeAllSelect(elmnt) {\r\n /*a function that will close all select boxes in the document,\r\n except the current select box:*/\r\n var x, y, i, xl, yl, arrNo = [];\r\n x = document.getElementsByClassName(\"select-items\");\r\n y = document.getElementsByClassName(\"select-selected\");\r\n xl = x.length;\r\n yl = y.length;\r\n for (i = 0; i < yl; i++) {\r\n if (elmnt == y[i]) {\r\n arrNo.push(i)\r\n } else {\r\n y[i].classList.remove(\"select-arrow-active\");\r\n }\r\n }\r\n for (i = 0; i < xl; i++) {\r\n if (arrNo.indexOf(i)) {\r\n x[i].classList.add(\"select-hide\");\r\n }\r\n }\r\n}\r\n/*if the user clicks anywhere outside the select box,\r\nthen close all select boxes:*/\r\ndocument.addEventListener(\"click\", closeAllSelect);\r\n\r\n// document.getElementById(\"Courriel\").addEventListener(\"click\", emailvalidate);\r\n// function emailvalidate(){\r\n// var regemail = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\\.[a-zA-Z0-9-]+)*$/;\r\n// var email = document.getElementById('Courriel').value;\r\n\t\r\n// if(!regemail.test(email)){\r\n// document.getElementById('error-email').innerHTML=\"Saisissez une adresse e-mail, ex. exemple@monsite.com. \";\r\n\t\t\r\n// }else{\r\n// document.getElementById('error-email').innerHTML=\"\";\r\n// } \r\n\t\r\n// }\r\n// document.getElementById(\"Courriel\").focus({ focusVisible: false });\r\n\r\n // Function to validate email on input\r\n function validateEmail() {\r\n\t// Get the input value\r\n\tvar emailInput = document.getElementById('emailInput').value.trim();\r\n\r\n\t// Regular expression for a simple email validation\r\n\tvar emailRegex = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/;\r\n\r\n\t// Check if the email matches the regular expression\r\n\tif (emailRegex.test(emailInput)) {\r\n\t\tdocument.getElementById('validationResult').textContent = '';\r\n\t} else {\r\n\t\tdocument.getElementById('validationResult').textContent = 'Saisissez une adresse e-mail, ex. exemple@monsite.com.';\r\n\t}\r\n\tvar element = document.getElementById('myElement');\r\n\r\n // Check the current display property\r\n if (element.style.display === 'none') {\r\n // If currently hidden, display it\r\n element.style.display = 'block';\r\n } else {\r\n // If currently visible, hide it\r\n element.style.display = 'none';\r\n }\r\n}\r\n\r\n // Function to validate email on input\r\n function validateEmail() {\r\n\t// Get the input value\r\n\tvar emailInput = document.getElementById('emailInput').value.trim();\r\n\r\n\t// Regular expression for a simple email validation\r\n\tvar emailRegex = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/;\r\n\r\n\t// Check if the email matches the regular expression\r\n\tif (emailRegex.test(emailInput)) {\r\n\t\tdocument.getElementById('validationResult').textContent = '';\r\n\t\tvar element = document.getElementById('myElement');\r\n\t\telement.style.display = 'none';\r\n\t} else {\r\n\t\tdocument.getElementById('validationResult').textContent = 'Saisissez une adresse e-mail, ex. exemple@monsite.com.';\r\n\t\tvar element = document.getElementById('myElement');\r\n\t\telement.style.display = 'inline-block';\r\n\t}\r\n}\r\n\r\n// Attach the validateEmail function to the input event\r\ndocument.getElementById('emailInput').addEventListener('input', validateEmail);\r\n\r\n//////////////////////validate message\r\ndocument.getElementById('message').addEventListener('input', function() {\r\n\tvar inputValue = this.value.trim();\r\n\tvar validationMessageElement = document.getElementById('msg-error');\r\n\r\n\tif (inputValue === '') {\r\n\t\tvalidationMessageElement.textContent = 'Saisissez une réponse';\r\n\t\tvar element = document.getElementById('myElement_2');\r\n\t\telement.style.display = 'inline-block';\r\n\r\n\t} else {\r\n\t\tvalidationMessageElement.textContent = ''; // Clear validation message\r\n\t\tvar element = document.getElementById('myElement_2');\r\n\t\telement.style.display = 'none';\r\n\r\n\t}\r\n});\r\n\r\n\r\ndocument.getElementById('submitButton').addEventListener('click', validateFields);\r\n\r\nfunction validateFields() {\r\n\tvar inputField1Value = document.getElementById('emailInput').value.trim();\r\n\tvar inputField2Value = document.getElementById('message').value.trim();\r\n\tvar validationMessageElement_1 = document.getElementById('validationResult');\r\n\tvar validationMessageElement_2 = document.getElementById('msg-error');\r\n\r\n\tif (inputField1Value === '' || inputField2Value === '') {\r\n\t\tvalidationMessageElement_1.textContent = 'Saisissez une adresse e-mail, ex. exemple@monsite.com.';\r\n\t\tvar element = document.getElementById('myElement');\r\n\t\telement.style.display = 'inline-block';\r\n\t\tvalidationMessageElement_2.textContent = 'Saisissez une réponse';\r\n\t\tvar element = document.getElementById('myElement_2');\r\n\t\telement.style.display = 'inline-block';\r\n\t} else {\r\n\t\tvalidationMessageElement_1.textContent = ''; \r\n\t\tvar element = document.getElementById('myElement');\r\n\t\telement.style.display = 'none';\r\n\t\tvalidationMessageElement_2.textContent = ''; \r\n\t\tvar element = document.getElementById('myElement_2');\r\n\t\telement.style.display = 'none';\r\n\r\n\t\t// Clear validation message\r\n\t\t// Proceed with your logic or form submission here\r\n\t}\r\n}\r\n\r\n"],"file":"custom.js"}