
////site-uploads/1001617/frontjs/multislider.min.js
/*
*   MultiSlider | MIT License
*
*   Copyright (c) 2017 Trevor Blackman
*   http://www.multislider.info
*
*/
!function(n){n.fn.multislider=function(e,t){var i,s,o,a,r,l,u,c,m,d,f,p=n(this),v=p.find(".MS-content"),g=p.find("button.MS-right"),h=p.find("button.MS-left"),A=v.find(".item:first");if("string"==typeof e)return i=e,void 0!==p.data(i)?p.data(i)():console.error("Multislider currently only accepts the following methods: next, prev, pause, play"),p;function w(n){p.hasClass("ms-PAUSE")?(p.removeClass("ms-PAUSE"),n(),p.addClass("ms-PAUSE")):n(),E()}function S(){P(),r=A.width();var n=parseInt(v.find(".item:first").css("padding-left")),e=parseInt(v.find(".item:first").css("padding-right"));0!==n&&(r+=n),0!==e&&(r+=e)}function C(){f=setInterval(function(){p.hasClass("ms-PAUSE")||u()},m.interval)}function E(){0!==m.interval&&!1!==m.interval&&!0!==m.continuous&&(clearInterval(f),C())}function P(){A=v.find(".item:first"),s=v.find(".item:last")}function U(n){p.hasClass("ms-animating")||p.hasClass("ms-HOVER")||p.hasClass("ms-PAUSE")||(p.trigger("ms.before.animate"),p.addClass("ms-animating"),n())}function y(){p.hasClass("ms-animating")&&(p.removeClass("ms-animating"),p.trigger("ms.after.animate"))}function b(){o=v.width(),a=Math.floor(o/r)}function M(){U(function(){P(),function(){d=m.duration;var n=parseFloat(v.find(".item:first").css("margin-left"));d*=1-n/-(r-1)}(),A.animate({marginLeft:-(r+1)},{duration:d,easing:"linear",complete:function(){A.insertAfter(s).removeAttr("style"),y(),M()}})})}function x(){U(function(){P(),b();var e=v.children(".item").clone().splice(0,a);v.append(e),A.animate({marginLeft:-o},{duration:d,easing:"swing",complete:function(){n(v.children(".item").splice(0,a)).remove(),y()}})})}function B(){U(function(){P(),b();var e=v.children(".item").length,t=v.children(".item").clone().splice(e-a,e);n(n(t)[0]).css("margin-left",-o),v.prepend(t),P(),A.animate({marginLeft:0},{duration:d,easing:"swing",complete:function(){e=v.find(".item").length,n(v.find(".item").splice(e-a,e)).remove(),A.removeAttr("style"),y()}})})}function L(){U(function(){P(),A.animate({marginLeft:-r},{duration:d,easing:"swing",complete:function(){A.detach().removeAttr("style").appendTo(v),y()}})})}function I(){U(function(){P(),s.css("margin-left",-r).prependTo(v),s.animate({marginLeft:0},{duration:d,easing:"swing",complete:function(){s.removeAttr("style"),y()}})})}return"object"!=typeof e&&void 0!==e||(v.contents().filter(function(){return 3==this.nodeType&&!/\S/.test(this.nodeValue)}).remove(),c=m||{continuous:!1,slideAll:!1,interval:2e3,duration:500,hoverPause:!0,pauseAbove:null,pauseBelow:null},m=n.extend({},c,e),S(),d=m.duration,m.hoverPause&&(m.continuous?(v.on("mouseover",function(){y(),v.children(".item:first").stop()}),v.on("mouseout",function(){M()})):(v.on("mouseover",function(){p.addClass("ms-HOVER")}),v.on("mouseout",function(){p.removeClass("ms-HOVER")}))),!0!==m.continuous&&0!==m.interval&&!1!==m.interval&&!1!==m.autoSlide&&C(),null!==m.pauseAbove&&"number"==typeof m.pauseAbove&&(window.innerWidth>m.pauseAbove&&p.addClass("ms-PAUSE"),n(window).on("resize",function(){window.innerWidth>m.pauseAbove?p.addClass("ms-PAUSE"):p.removeClass("ms-PAUSE")})),null!==m.pauseBelow&&"number"==typeof m.pauseBelow&&(window.innerWidth<m.pauseBelow&&p.addClass("ms-PAUSE"),n(window).on("resize",function(){window.innerWidth<m.pauseBelow?p.addClass("ms-PAUSE"):p.removeClass("ms-PAUSE")})),p.data({pause:function(){p.addClass("ms-PAUSE")},unPause:function(){p.removeClass("ms-PAUSE")},continuous:function(){p.removeClass("ms-PAUSE"),M()},next:function(){w(L)},nextAll:function(){w(x)},prev:function(){w(I)},prevAll:function(){w(B)},settings:m}),m.continuous?(m.autoSlide=!1,M()):m.slideAll?(l=p.data("prevAll"),u=p.data("nextAll")):(l=p.data("prev"),u=p.data("next"))),g.on("click",u),h.on("click",l),p.on("click",".MS-right, .MS-left",E),n(window).on("resize",S),p}}(jQuery);
////site-uploads/1001617/frontjs/speed.js
$(function () {
	/*Delete slider component in mobile*/
	if ($(window).width() < 700) {
		// $('.slide').remove();
		// $('.hidden-xs').remove();
		// $('.desktop-only').remove();
	}

	/* load weatehr widget  */
	const userInteractionEvents = [
		'mouseover',
		'keydown',
		'touchmove',
		'touchstart',
	];
	userInteractionEvents.forEach(function (event) {
		window.addEventListener(event, triggerScriptLoader, {
			passive: true,
		});
	});

	function triggerScriptLoader() {
		loadScripts();
		userInteractionEvents.forEach(function (event) {
			window.removeEventListener(event, triggerScriptLoader, {
				passive: true,
			});
		});
	}

	function loadScripts() {
		if (!$('#live_chat_script').length) {
			$(
				'<script id="live_chat_script" src="https://v2-app-public.s3.us-east-2.amazonaws.com/dp360crm-widget.js?v=23445345"></script>\
        <script type="text/javascript"> window.addEventListener("load",function(){ Dp360TextWidget.init({token: "5TgS3JC9F7skBe4absQ6ns2xsXqEA5JWz8gK"});});</script>'
			).appendTo('head');
		}

	}
});
////site-uploads/1001617/frontjs/main_v1.4.js
/* update on vdp */
$(document).ready(function () {
  $("#seamaster_vdp #model-left-content").append($("#seamaster_vdp .model-tabs"))
});

/* Menu */
$(document).ready(function () {
  $(".navbar-toggle").on("click", function () {
      $(this).toggleClass("active");
  });
});

/* Active State Menu */
$(document).ready(function () {
  var url = window.location.pathname;
  $('ul.nav a[href="'+ url +'"]').parent().addClass('active');
  $('ul.nav a').filter(function() {
       return this.href == url;
  }).parent().addClass('active');
});

/* Sticky Menu on Scroll */
$(function () {
  $(window).on("scroll", function () {
      if ($(window).scrollTop() > 48) {
          $("#comp_1729192240770").addClass("sticky-nav");
      } else {
          $("#comp_1729192240770").removeClass("sticky-nav");
      }
  });
});



/* Change Slider transition from slide to fade */
$(function () {
  $(".carousel").removeClass("slide");
  $(".carousel").addClass("carousel-fade");
});



/* Slide to top */
$(document).ready(function () {
  $("a[href='#top']").on('click', function (e) {
    e.preventDefault();
    $("html, body").animate({
      scrollTop: 0
    }, "slow");
    return false;
  });
});

/* Display Slide to top on scroll */
$(function () {
  $(window).on("scroll", function () {
      if ($(window).scrollTop() > 48) {
          $("#to-up-container").addClass("show");
      } else {
          $("#to-up-container").removeClass("show");
      }
  });
});


/* homepage Brands slider */
$(document).ready(function() {
  if($('#brandSlider').length>0){$('#brandSlider').multislider({
      interval: 5000,
      duration: 500,
  });}
});



/* Change Get Financed to open page */
var theLanguage = $('html').attr('lang');
// Diferent language
if (theLanguage == "fr") {
  $(".finacning-link").attr(
    "href",
    "/fr/Finance-Request"
  );
  
  $(".finacning-link").attr("target", "_self");

} else {
  $(".finacning-link").attr(
    "href",
    "/Finance-Request"
  );
  
  $(".finacning-link").attr("target", "_self");
}

/* Mobile filters fix */
$(document).ready(function() {
  $(".filter-xs-btn").click(function(){
    $("#filters").addClass("open");
});
});

/* Hide html above component on vdp */
if($("#detailsParentDiv").size()>0){
  $('#page-banner').css("display","none");
  $('.inventory-page').css("display","none");
  };


if ($("#detailsParentDiv").length > 0 && $("#page_76183").length === 0) {
    
    
    $('#page-banner').css("display", "none");
    $('.inventory-page').css("display", "none");

    
    $('#HeaderDiv').append($('.vdp-header'));
    $(".vdp-header").removeClass("hidden-xs");
}


  /* Move VDP Header from CenterDiv to HeaderDiv */
  if($("#detailsParentDiv").size()>0){
    $('#HeaderDiv').append( $('.vdp-header') );
    $(".vdp-header").removeClass("hidden-xs");
    };

/* Blog Srp, move FooterDiv from CenterDiv???? to parent */
if($(".blog-srp").size()>0){
  $('#parent').append( $('#FooterDiv') );
  };


/*var locations_dropd =
      `<div class="formField"><div class="col-lg-12 col-md-12 col-sm-12 text-left">
			<label>Select Preferred Location</label>
				<select name="selected_location">
					<option>-- Select Location --</option>
					<option value="JCP North">JCP North</option>
					<option value="JCP South">JCP South</option>
					<option value="Ghostrider Fernie">Ghostrider Fernie</option>
					<option value="Ghostrider Kimberley">Ghostrider Kimberley</option>
				</select>
			<p></p></div></div>`;*/  // REquired by bradenp@abgmt.com on 29-Feb-2024
			
			
		
$(function(){
	//Update Get aquote to use contact us form
	if($("#seamaster_vdp .rt-action-btn.request-quote-btn").size() > 0) {
		$(".request-quote-btn").attr("onclick", "");
		$(".request-quote-btn").attr("data-toggle", "modal");
		$(".request-quote-btn").attr("data-target", "#right-form");
		$('input[name="selected_location"]').remove();
		if($('select[name="selected_location"]').size()==0){
			$(".formField:nth-child(5)").after(
				locations_dropd
			);
		}
	}
		 
});

/* Request This Service */
/*$('.request-quote-btn').replaceWith('<a class="rt-action-btn request-quote-btn request-serv" onclick="" href="javascript:void(0)" data-toggle="modal" data-target="#request-service">Request This Service</a>');*/
////site-uploads/1001617/frontjs/Search_script1.js
if($('#searchbox2').length){
    setTimeout(function() {
        document.getElementById("searchbox2")?.addEventListener("keyup", function(event) {
            event.preventDefault();
            if (event.keyCode === 13) {
                document.getElementById("searchbtn2")?.click();
            }
        });
    }, 2000);
    }
    
    var theLanguage = $("html").attr("lang");
    // Diferent language
    if (theLanguage == "fr") {
        function srch() {
            //var e = document.getElementById("pagedd");
            //var dest= e.options[e.selectedIndex].value;
            var valuee = document.getElementById('searchbox2').value;
            if (valuee != "") {
                window.location = "/fr/Inventaire/search/".concat(valuee);
            } else {
                document.getElementById('searchbox2').placeholder = "This field is required";
                var sheet = window.document.styleSheets[0];
                sheet.insertRule('input#searchbox2::-webkit-input-placeholder {color: red !important}', sheet.cssRules.length);
                sheet.insertRule('input#searchbox2::-moz-placeholder {color:#909; opacity:1;}', sheet.cssRules.length);
                sheet.insertRule('input#searchbox2:-moz-placeholder {color:#909; opacity:1;}', sheet.cssRules.length);
            }
        }
    } else {
        function srch() {
            //var e = document.getElementById("pagedd");
            //var dest= e.options[e.selectedIndex].value;
            var valuee = document.getElementById('searchbox2').value;
            if (valuee != "") {
                window.location = "/Inventory/search/".concat(valuee);
            } else {
                document.getElementById('searchbox2').placeholder = "This field is required";
                var sheet = window.document.styleSheets[0];
                sheet.insertRule('input#searchbox2::-webkit-input-placeholder {color: red !important}', sheet.cssRules.length);
                sheet.insertRule('input#searchbox2::-moz-placeholder {color:#909; opacity:1;}', sheet.cssRules.length);
                sheet.insertRule('input#searchbox2:-moz-placeholder {color:#909; opacity:1;}', sheet.cssRules.length);
            }
        }
    }
    
    
    
    $(function () {
        /* Focus on input afrer modal open */
        $('#searchModal').on('shown.bs.modal', function () {
            $('#searchbox2').focus();
        }); 
    });