PageSourceSearch

https://www.platinumautohaus.com/template/scripts/main.js

js platinumautohaus.com collected 2026-10-05 11:39:35 UTC 9,328 bytes, 378 lines download raw bytes

1function nl_subscribe( email ){
2	$.get( "nlsubscribe.php?email_address="+ email +"&ajax&sf" ).done( function( text ) {
3		if( text.indexOf('You are now subscribed') > -1 ){
4			document.cookie = "nl_subscribe=true";
5			$('#nl_message_box').html(text);
6			$('#nl_controls_box').hide();
7		}else{
8			if( text.indexOf('already exists') > -1 ) document.cookie = "nl_subscribe=true";
9			$('#nl_message_box').html(text);
10		}			
11	});
12}
13
14var $bannerSlider;
15var stickyFooter;
16;(function(){
17	
18	/*
19	 * hide title tooltips on mouse over
20	 */
21	$( document ).ready(function(){
22		var cachedTitle = '';
23		$( 'a[title]' ).on( 'mouseenter', function(){
24			var $this = $( this );
25			cachedTitle = $this.attr( 'title' );
26			$this.removeAttr( 'title' );
27		}).on( 'mouseleave', function(){
28			var $this = $( this );
29			if( cachedTitle ) {
30				$this.attr( 'title', cachedTitle );
31			}
32		});
33		
34		var sticky = new Waypoint.Sticky({
35			element: $('header')[0],
36			offset: -20 
37		});
38		/*var sticky = new Waypoint.Sticky({
39			element: $('header')[0]
40		});*/
41	});
42	
43	/*
44	 * main navigation hamburger menu
45	 */
46	$( 'header .menu_ic' ).on( 'click', function( e ){
47		e.preventDefault();
48		var $this = $( this );
49		var wasActive = $( 'header .menu_ic' ).hasClass( 'active' );
50		if( wasActive ){
51			$( 'header .menu>ul' ).slideUp( 'slow', function(){
52				$( 'header .menu_ic' ).removeClass( 'active' );
53			});
54		} else {
55			$( 'header .menu>ul' ).slideDown( 'slow', function(){
56				$( 'header .menu_ic' ).addClass( 'active' );
57			});
58		}
59	});
60	
61	if($(window).width()<767){
62		$('a.dropdown-toggle:contains("Inventory")').on( 'click', function( e ){
63			$(this).addClass("active");
64			window.location.href = "/inventory.htm";
65		});
66	}
67	
68	$( 'header .menu > ul > li.dropdown.submenu > a.dropdown-toggle' ).on( 'click', function( e ){
69		e.preventDefault();
70		var $this = $( this );
71		var wasActive = $this.hasClass( 'active' );
72		if( wasActive ) {
73			$this.removeClass( 'active' );
74			$this.parent().find( '.dropdown-menu' ).slideUp( 'slow', function(){
75				$( this ).removeClass( 'active' );
76			});
77		} else {
78			$( 'header .menu > ul > li > a.dropdown-toggle' ).removeClass( 'active' );
79			$( 'header .menu > ul > li > .dropdown-menu' ).slideUp( 'slow', function(){
80				$( this ).removeClass( 'active' );
81			});
82			$this.addClass( 'active' );
83			$this.parent().find( '.dropdown-menu' ).slideDown( 'slow', function(){
84				$( this ).addClass( 'active' );
85			});
86		}
87	});
88	
89	
90	/* 
91	 * main banner slider 
92	 */
93	$bannerSlider = $( 'banner .slider' );
94	$bannerSlider.on( 'init', function(event, slick){
95		//$( 'banner .slider .slide' ).matchHeight();
96		//$( 'banner .slider .slide .matchy' ).matchHeight();
97		$( 'banner .slider .slide[data-slick-index="0"]' ).addClass( 'slide-done' );
98		/*
99		$( 'banner .slider .slide' ).each( function(){
100			var $this = $( this );
101			var title = $this.attr( 'data-title' );
102			var $dot = $( 'banner ul.slick-dots li:nth-child(' + ( $this.index() + 1 ) + ')' );
103			var $span = $( '<span/>' ).text( title );
104			$dot.addClass( 'clearfix' ).append( $span );
105		});
106		*/
107	});
108	$bannerSlider.on('beforeChange', function(event, slick, currentSlide, nextSlide){
109		$( 'banner .slider .slide' ).removeClass( 'slide-done' );
110		$( 'section.banner-buttons .type' ).removeClass( 'active' );
111		$( 'section.banner-buttons .type[data-index="' + nextSlide + '"]' ).addClass( 'active' );
112	});
113	$bannerSlider.on('afterChange', function(event, slick, currentSlide, nextSlide){
114		$( 'banner .slider .slide[data-slick-index="' + currentSlide + '"]' ).addClass( 'slide-done' );
115	});
116	$bannerSlider.slick( {
117		fade: true,
118		autoplay: true,
119		autoplaySpeed: 5000,
120		speed: 1500,
121		arrows: false,
122		dots: false,
123		pauseOnHover: false,
124		pauseOnDotsHover: true,
125		customPaging : function(slider, i) {
126			var numb = i+1;
127			return '<button>'+0+numb+'</button>';
128		},
129	});
130	
131	/*
132	 * models
133	 */
134	$( '.models-section .listing-holder .arrows .arrow ' ).on( 'click', function( e ){
135		var $this = $( this );
136		var step = -1;
137		if( $this.hasClass( 'arrow-right' ) ) {
138			step = 1;
139		}
140		var $list = $( '.models-section .listing-holder .listing' );
141		$list.animate( {
142			scrollLeft: $list.scrollLeft() + ( $( '.models-section .listing-holder .listing .
142item' ).outerWidth() * 2 ) * step,
143			duration: 1000,
144			easing: 'linear'
145		});
146	});
147	
148	/* 
149	 * matched height 
150	 */
151	$( document ).ready( function(){
152		$( '.models-section .matchy' ).matchHeight();
153		$( '.actions-section .action .matchy' ).matchHeight();
154		$( '.directions-section .matchy' ).matchHeight();
155		$( '.about-section .rate .matchy' ).matchHeight();
156	});
157	
158	/*
159	 * stop propagation
160	 */
161	$( 'body' ).on( 'click', '.stopprop', function( e ){
162		e.stopPropagation();
163	});
164	
165	/*
166	 * jingle
167	 */
168	$(function(){
169		var audio = new Audio( 'template/audio/Shingle Springs Honda 60s Donut (c) 2016 The Jingle Lab.mp3' );
170		if( $( 'body' ).hasClass( 'home' ) ) {
171			if( getCookie( "jingle" ) != "1" ) {
172				audio.play();
173				setCookie( "jingle", 1, 1 );
174			}
175		}
176		$( '.jingle-play' ).on( 'click', function(){
177			audio.play();
178		});
179		$( '.jingle-pause' ).on( 'click', function(){
180			audio.pause();
181		});
182	});
183	
184	/* 
185	 * fancybox
186	 */
187	$( document ).ready( function(){
188		$( '.fancybox' ).fancybox();
189	});
190	
191	/* 
192	 * sticky footer 
193	 */
194	stickyFooter = function(){
195		var page = {
196			height: $( '#header' ).outerHeight(true) + $( '#page' ).outerHeight(true)
197		}
198		var footer = {
199			height: $( '#footer' ).height()
200		}
201		if( $( window ).height() > page.height + footer.height ) {
202			$( '#footer' ).addClass( 'sticky-footer' );
203		} else {
204			$( '#footer' ).removeClass( 'sticky-footer' );
205		}
206	}
207	$( window ).load(function() {
208		stickyFooter();
209		checkForChanges();
210	}).resize(function(){
211		stickyFooter();
212	});
213	
214	
215	var $element = $("body").eq(0);
216	var lastHeight = $("body").eq(0).css('height');
217	function checkForChanges()
218	{
219			if ($element.css('height') != lastHeight)
220			{
221					//alert('xxx');
222					//console.log("changed");
223					stickyFooter();
224					lastHeight = $element.css('height'); 
225					setTimeout(checkForChanges, 500);
226			}
227
228			setTimeout(checkForChanges, 500);
229	}
230	
231	/*
232	 * datepicker
233	 */
234	Date.parseDate = function( input, format ){
235		// you code for convert string to date object
236		// simplest variant - use native Date.parse, not given format parametr
237		return Date.parse(input);
238	};
239	Date.prototype.dateFormat = function( format ){
240		var d = this;
241		var date = (d.getUTCMonth()+1) + '/' + (d.getUTCDate()) + '/' + (d.getUTCFullYear());
242		return date;
243	};
244	$( document ).ready( function(){
245		var d = new Date();
246		var date = (d.getUTCMonth()+1) + '/' + (d.getUTCDate()) + '/' + (d.getUTCFullYear());
247		jQuery( '.datepicker' ).datetimepicker({
248			//value: date,
249			mark: false,
250			timepicker: false,
251			format: 'm/d/Y',
252			formatDate: 'm/d/Y',
253			inline: false,
254			startDate: new Date()
255		});
256	});
257	
258	/*
259	 * cookies
260	 */
261	function setCookie(cname, cvalue, exdays) {
262	    var d = new Date();
263	    d.setTime(d.getTime() + (exdays*24*60*60*1000));
264	    var expires = "expires="+d.toUTCString();
265	    document.cookie = cname + "=" + cvalue + "; " + expires;
266	}
267	function getCookie(cname) {
268	    var name = cname + "=";
269	    var ca = document.cookie.split(';');
270	    for(var i=0; i<ca.length; i++) {
271	        var c = ca[i];
272	        while (c.charAt(0)==' ') c = c.substring(1);
273	        if (c.indexOf(name) == 0) return c.substring(name.length,c.length);
274	    }
275	    return "";
276	}
277	
278	/* 
279	 * misc js goes here:
280	 */
281	$("banner .scrollBottom").click(function(){
282		$('html, body').animate({
283        scrollTop: $("#mainHome").offset().top
284    }, 500);
285	});
286	$('#tabs .dealer_slider').slick( {
287		fade: false,
288		autoplay: false,
289		arrows: true,
290		dots: false,
291		slidesToShow: 5,
292		slidesToScroll: 1,
293		responsive: [
294		{
295		  breakpoint: 1199,
296		  settings: {
297			slidesToShow: 3,
298			slidesToScroll: 1,
299			arrows: true,
300			dots: false,
301		  }
302		},
303		{
304		  breakpoint: 991,
305		  settings: {
306			slidesToShow: 2,
307			slidesToScroll: 1,
308			arrows: true,
309			dots: false,
310		  }
311		},
312		{
313		  breakpoint: 767,
314		  settings: {
315			slidesToShow: 1,
316			slidesToScroll: 1,
317			arrows: true,
318			dots: false,
319		  }
320		},
321		{
322		  breakpoint: 400,
323		  settings: {
324			slidesToShow: 1,
325			slidesToScroll: 1,
326			arrows: false,
327			dots: false,
328		  }
329		}
330		]
331	});	
332	$('.featured_cehicles_section .featured_slider').slick( {
333		fade: false,
334		autoplay: false,
335		arrows: true,
336		dots: false,
337		slidesToShow: 4,
338		slidesToScroll: 1,
339		responsive: [
340		{
341		  breakpoint: 1199,
342		  settings: {
343			slidesToShow: 3,
344			slidesToScroll: 1,
345			arrows: true,
346			dots: false,
347		  }
348		},
349		{
350		  breakpoint: 991,
351		  settings: {
352			slidesToShow: 2,
353			slidesToScroll: 1,
354			arrows: true,
355			dots: false,
356		  }
357		},
358		{
359		  breakpoint: 767,
360		  settings: {
361			slidesToShow: 1,
362			slidesToScroll: 1,
363			arrows: true,
364			dots: false,
365		  }
366		},
367		{
368		  breakpoint: 400,
369		  settings: {
370			slidesToShow: 1,
371			slidesToScroll: 1,
372			arrows: false,
373			dots: false,
374		  }
375		},
376		]
377	});
378})();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.