const audFormatter = new Intl.NumberFormat('en-AU', { style: 'currency', currency: 'AUD' }); // Format number const numberWithCommas = (x) => { return audFormatter.format(x); //return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","); }; $(function() { var Accordion = function(el, multiple) { this.el = el || {}; this.multiple = multiple || false; // Variables privadas var links = this.el.find(".link"); // Evento links.on("click", { el: this.el, multiple: this.multiple }, this.dropdown); }; Accordion.prototype.dropdown = function(e) { var $el = e.data.el; ($this = $(this)), ($next = $this.next()); $next.slideToggle(); $this.parent().toggleClass("open"); if (!e.data.multiple) { $el .find(".submenu") .not($next) .slideUp() .parent() .removeClass("open"); } }; var accordion = new Accordion($("#accordion"), false); }); jQuery(document).ready(function($) { "use strict"; //Display Scroll Btn on 1000px $(window).on("scroll", function() { if ($(this).scrollTop() > 100) { $("#top").fadeIn(); } else { $("#top").fadeOut(); } }); //scroll effect $("#top").on("click", function() { $("html, body").animate({ scrollTop: 0 }, "slow"); return false; }); $("#top").on("click", function(event) { event.stopPropagation(); var idTo = $(this).attr("data-atr"); var Position = $("[id='" + idTo + "']").offset(); $("html, body").animate({ scrollTop: Position }, "slow"); return false; }); // Slider if ($('.flexslider').length > 0) { $('.flexslider').flexslider({ animation: "slide" }); var nextItem = '', ValidNextItem = '', prevItem = '', ValidPrevItem = ''; prevItem = $('.slider .flexslider .slides li').prev().css('background-image'); ValidPrevItem = prevItem.substr(5, prevItem.length - 11).concat('-100x50.jpg'); nextItem = $('.slider .flexslider .slides li').next().css('background-image'); ValidNextItem = nextItem.substr(5, nextItem.length - 11).concat('-100x50.jpg'); $('.slider .flexslider .flex-next').hover(function() { $(this).css('background-image', 'url(' + ValidNextItem + ')'); }, function() { $(this).css('background-image', 'url()'); }); $('.slider .flexslider .flex-prev').hover(function() { $(this).css('background-image', 'url(' + ValidPrevItem + ')'); }, function() { $(this).css('background-image', 'url()'); }); } if ($(window).width() > '900') { jQuery('.animated').each(function(i, obj) { var anim_class = jQuery(this.element).data('animated'); if (!jQuery(this).hasClass(anim_class)) { jQuery('.animated').css('opacity', 0); } }); } //___________ animate Element when it visible $('.animated').waypoint(function() { var that = $(this.element).length > 0 ? $(this.element) : $(this); that.css('opacity', 1); that.addClass(that.data('animated')); }, { offset: 'bottom-in-view' }); /*_________________________________ Carousel ___________________*/ $(".carousel_client").owlCarousel({ animateOut: 'slideOutDown', animateIn: 'flipInX', loop: true, items: 3, responsiveClass: true, responsive: { 0: { items: 2, nav: true }, 600: { items: 3, nav: false }, 1000: { items: 6, nav: true, loop: false }, 1200: { items: 6, nav: true, loop: false } } }); $(".owl-testimonail").owlCarousel({ animateOut: 'slideOutDown', animateIn: 'flipInX', items: 1, autoPlay: true, stopOnHover: true, responsiveClass: true, responsive: { 0: { items: 1, nav: true }, 800: { items: 1, nav: false }, 1000: { items: 1, nav: true, loop: false } } }); /*_________________________________ Parallax ___________________*/ if (!isMobile.apple.phone && !isMobile.android.phone && !isMobile.seven_inch) { $('.wd-form-image2').parallax("10%", -0.3); $('.wd-section-clients').parallax("30%", -0.3); } /*__________________________portfolio masonry____________*/ // isotop on gallery // cache container var $container = $('#gallery-items'); // initialize isotope $container.isotope({ filter: '*', itemSelector: '.element', animationEngine: 'best-available', }); // filter items when filter link is clicked jQuery('#filters a').on('click', function(e) { $('.gallery-filter .current').removeClass('current'); $(this).addClass('current'); var selector = $(this).attr('data-filter'); $container.isotope({ filter: selector }); return false; }); /*_________________________________ The Map ___________________*/ function initializeMap() { var styles = [{ "featureType": "administrative", "elementType": "labels.text.fill", "stylers": [{ "color": "#444444" }] }, { "featureType": "landscape", "elementType": "all", "stylers": [{ "color": "#f2f2f2" }] }, { "featureType": "poi", "elementType": "all", "stylers": [{ "visibility": "off" }] }, { "featureType": "road", "elementType": "all", "stylers": [{ "saturation": -100 }, { "lightness": 45 } ] }, { "featureType": "road.highway", "elementType": "all", "stylers": [{ "visibility": "simplified" }] }, { "featureType": "road.arterial", "elementType": "labels.icon", "stylers": [{ "visibility": "off" }] }, { "featureType": "transit", "elementType": "all", "stylers": [{ "visibility": "off" }] }, { "featureType": "water", "elementType": "all", "stylers": [{ "color": "#46bcec" }, { "visibility": "on" } ] } ]; var styledMap = new google.maps.StyledMapType(styles, { name: "Styled Map" }); var mapOptions = { scaleControl: true, scrollwheel: false, center: new google.maps.LatLng(latitude, longitude), zoom: flooring_zoom, mapTypeControlOptions: { mapTypeIds: [google.maps.MapTypeId.ROADMAP, 'map_style'] } }; var map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions); //Associate the styled map with the MapTypeId and set it to display. map.mapTypes.set('map_style', styledMap); map.setMapTypeId('map_style'); var image = window.location.origin + window.location.pathname + 'images/marker_icon.png'; var marker = new google.maps.Marker({ map: map, icon: image, position: map.getCenter() }); var infowindow = new google.maps.InfoWindow(); if (companyname != "") { companyname = "