PageSourceSearch

https://sksong.com/wp-content/themes/consulting/assets/js/custom.js?ver=4.5.6

js sksong.com collected 2026-10-02 21:21:13 UTC 26,908 bytes, 783 lines download raw bytes

1jQuery(document).ready(function ($) {
2    "use strict";
3	
4	/** xantec **/ 
5	$(window).on( "load", function() {
6			$('body').addClass('tk-loaded');
7			$('.vc_basic_grid .vc_grid.vc_row .vc_grid-item.vc_visible-item:nth-child(2)').addClass('hover');
8			$('body.page-id-455 .vc_basic_grid .vc_grid.vc_row .vc_grid-item.vc_visible-item:nth-child(even)').addClass('hover');
9			
10		/*	$('html, body').animate({
11					scrollTop: $('html, body').offset().top - 0
12				  }, 3000); */
13				  if ($('body').length) {
14					$(window).scroll(function () {
15						if ($(window).scrollTop() > 103) {
16							$("body").addClass("has_affix");
17						} 
18					else { $("body").removeClass("has_affix");
19						}
20					});
21				}
22				
23		$('.stm_gdpr_popup-main .stm_gdpr_popup-links a.stm_gdpr_popup-privacy').attr('href', 'https://sksong.com/wp-content/uploads/2024/09/PDPA-Notice.pdf');
24		$('.stm_gdpr_popup-main .stm_gdpr_popup-links a.stm_gdpr_popup-privacy').attr('target', '_blank');
25		});
26		
27	if ($('.x-board-of_director').length) {
28		$('.x-board-of_director > .vc_column-inner > .wpb_wrapper').owlCarousel({
29            autoplay: true,
30			loop: true,
31			dots: false,
32            nav: true,
33			margin: 30,
34            smartSpeed: 700,
35			items: 3,
36            responsive: {
37                0: {
38					items: 1,
39                    slideBy: 1
40                },
41                640: {
42                    items: 2,
43					slideBy: 1
44                },
45                992: {
46                    items: 3,
47					slideBy: 1
48                },
49                1199: {
50                    items: 3,
51					slideBy: 1
52                }
53            }
54		});
55	}
56	
57	$(window).load(function() {
58		var paddLeft = $('.x-team_home').innerWidth() - $('.x-team_home').width();
59		var wideRight = (paddLeft/2) * -1;
60		$('.x-board-of_director .owl-nav').css({'right': wideRight});
61	});
62	
63	if ($('.x-team_home').length) {
64		var height = $(window).height();
65		var startPoint = $('.x-team_home').offset().top - height / 2;
66		
67		$(window).scroll(function () {
68			if ($(window).scrollTop() > startPoint) {
69				if ($('.x-team_home').hasClass('active') === false) {
70					$('.x-team_home').addClass('active');
71				}
72			}
73		});
74	}
75	if ($('.x-post-outer_home').length) {
76		var height2 = $(window).height();
77		var startPoint2 = $('.x-post-outer_home').offset().top - height2 / 2;
78		
79		$(window).scroll(function () {
80			if ($(window).scrollTop() > startPoint2) {
81				if ($('.x-post-outer_home').hasClass('active') === false) {
82					$('.x-post-outer_home').addClass('active');
83				}
84			}
85		});
86	}
87	if ($('.x-contact_home').length) {
88		var height3 = $(window).height();
89		var startPoint3 = $('.x-contact_home').offset().top - height3 / 2;
90		
91		$(window).scroll(function () {
92			if ($(window).scrollTop() > startPoint3) {
93				if ($('.x-contact_home').hasClass('active') === false) {
94					$('.x-contact_home').addClass('active');
95				}
96			}
97		});
98	}
99	
100	/** new amendment **/
101	$("#hover").mouseleave(
102	  function () {
103		$(this).removeAttr('id');
104	  }
105	);
106	$(".vc_basic_grid .vc_grid.vc_row .vc_grid-item").eq(1).mouseleave(
107	  function () {
108		$(this).removeClass('hover');
109	  }
110	);
111	
112	/** Nov 2022 **/
113	var isHome = $('body').hasClass('home');
114	if ($(!isHome).length) {
115//	$('.scroller button').click(function(){
116	$('.scroller button').bind("click", function () {	
117		var section = $('.entry-content #read-more');
118
119		$('html,body').animate({
120			scrollTop: section.offset().top + 80
121		},700); 
122	});
123	}
124	
125	if ($('#read-more').length) {
126		$(window).scroll(function () {
127			var offset = $("#read-more").offset().top;
128			var offset2 = $(".offset2").offset().top - 400;
129
130			if ($(window).scrollTop() >= offset && $(window).scrollTop() <= offset2) {
131				if ($('#read-more').hasClass('active') === false) {
132					$('#read-more').addClass('active');
133				}
134			} else if ($(window).scrollTop() >= offset2) {
135				if ($('#read-more').hasClass('active') === true) {
136					$('#read-more').removeClass('active');
137				}
138			} else {
139				if ($('#read-more').hasClass('active') === true) {
140					$('#read-more').removeClass('active');
141				}
142			}
143		});
144	}
145	
146	if ($('body').length) {
147			
148		$('ul.main_menu_nav li.menu-item-18 a, #footer .footer_widgets .widget.widget_nav_menu ul li.menu-item-166 a').bind("click", function () {
149		//	e.preventDefault();
150			
151		//	window.open( $(this).attr('href'), '_self');
152		//	window.location.href = $(this).attr('href');
153			$('html, body').animate({
154				  'scrollTop':   $('#about-us').offset().top + 96
155			  }, 300);
156			$('body').removeClass('activeMenu');
157			$('#menu_toggle').removeClass('open');
158			
159		//	return false;
160		
161/*		if(window.location.hash) {
162			setTimeout(function(){
163				$('html, body').animate({scrollTop: $('#about-us').offset().top + 192}, 0);
164				setTimeout(function(){
165							$('html, body').animate({scrollTop: $('#about-us').offset().top + 192}, 0);
166						  },100);
167				return false;
168			},100);
169		} */
170		
171		});
172	} 
173
174	
175	/** end **/
176	
177    var windowSize = $(window).width();
178    l18W();
179    $(window).load(function() {
180        l18W();
181        if($('html').hasClass('stm-site-preloader')){
182            $('html').addClass('stm-site-loaded');
183
184            setTimeout(function(){
185                $('html').removeClass('stm-site-preloader stm-site-loaded');
186            }, 250);
187
188            $(window).bind('onbeforeunload', function(e) {
189                $('html').addClass('stm-site-preloader stm-after-hidden');
190            });
191
192            if( $('a[href^=mailto], a[href^=skype], a[href^=tel]').on('click', function(e) {
193                setTimeout(function(){
194                    $('html').removeClass('stm-site-preloader stm-site-loaded');
195                });
196            }));
197        }
198    });
199
200    $(window).resize(function(){
201        l18W();
202        stm_stretch_column();
203        full_height_columns();
204    });
205
206    $.fn.is_on_screen = function(){
207        var win = $(window);
208        var viewport = {
209            top : win.scrollTop(),
210            left : win.scrollLeft()
211        };
212        viewport.right = viewport.left + win.width();
213        viewport.bottom = viewport.top + win.height();
214
215        var bounds = this.offset();
216        bounds.right = bounds.left + this.outerWidth();
217        bounds.bottom = bounds.top + this.outerHeight();
218
219        return (!(viewport.right < bounds.left || viewport.left > bounds.right || viewport.bottom < bounds.top || viewport.top > bounds.bottom));
220    };
221
222    $(".stm-register-form form").submit(function (e) {
223        e.preventDefault();
224        $.ajax({
225            type: "POST",
226            url: ajaxurl,
227            dataType: 'json',
228            context: this,
229            data: $(this).serialize() + '&action=stm_custom_register',
230            beforeSend: function(){
231                $(this).find('input').removeClass('form-error');
232                $('.stm-validation-message').empty();
233            },
234            success: function (data) {
235
236                for(var err in data.errors){
237                    $(this).find('input[name=' + err + ']').addClass('form-error');
238                }
239
240                if(data.message) {
241                    var message = $('<div class="stm-message-ajax-validation heading-font">' + data.message + '</div>').hide();
242
243                    $(this).find('.stm-validation-message').append(message);
244                    message.slideDown('fast');
245                }
246            }
247        });
248    });
249
250    $(document).on("click", ".load_more_btn", function(e){
251        e.preventDefault();
252        var page = $(this).attr("data-page");
253        var load_by = $(this).attr("data-load");
254        var filter = $(this).attr("data-filter");
255        var category = $(this).attr('data-category');
256        $.ajax({
257            url: ajaxurl,
258            type: "POST",
259            dataType: "json",
260            data: "&page=" + page + "&load_by=" + load_by + "&category=" + category +  "&filter=" + filter + "&action=stm_ajax_load_events",
261            context: this,
262            beforeSend: function (data) {
263                $(this).parent().addClass("event_posts_loading");
264            },
265            success: function (data) {
266                $(this).parent().removeClass("event_posts_loading");
267                $(".stm_events_modern_list ").append(data.html);
268                $(this).attr("data-page", data.new_page);
269                if(!data.load_more) {
270                    $(this).remove();
271                }
272            }
273        });
274    });
275
276    $('.scroll_to_event_form').click(function(e) {
277        event.preventDefault();
278        $('html,body').animate({ scrollTop: $(this.hash).offset().top}, 500);
279    });
280
281    $('.show_popup').on('click', function(e){
282        $(this).parents().find('#video').addClass('video_popup_box')
283    });
284
285    stm_stretch_column();
286
287    function stm_stretch_column() {
288        $('.wpb_column[data-stretch]').each(function () {
289            var stretch = $(this).data('stretch');
290            var xPos = $(this).offset().left;
291            var wW = $(window).width();
292            var xW = $(this).width();
293
294            var value = wW - (xW + xPos);
295            if (stretch == 'left') {
296                value = xPos;
297            }
298
299            $(this).find('.vc_column-inner').css('width', xW + value + 'px');
300            $(this).find('.vc_column-inner').css('margin-' + stretch, '-' + value + 'px');
301        });
302    };
303
304    //Full height
305    full_height_columns();
306    function full_height_columns() {
307
308        $(".full_height_columns").each(function () {
309            var full_height_columns = $(this).find(".wpb_column:first").height();
310            $(this).find("iframe").css("height", full_height_columns);
311        });
312    };
313
314    stm_ajax_add_event_member();
315
316    function stm_ajax_add_event_member() {
317        $("#event-members-form").on("submit", function (event) {
318            event.preventDefault();
319
320            var $this = $(this),
321                eventID = parseInt($($this).find('input[name="event_member_id"]').val()),
322                addedEvents = localStorage.getItem('addedEvents'),
323                eventAdded = false;
324
325            if (addedEvents) {
326                addedEvents = JSON.parse(addedEvents);
327                eventAdded = $.inArray(eventID, addedEvents) > -1;
328            }
329            if (!eventAdded) {
330                $.ajax({
331                    url: ajaxurl,
332                    type: "POST",
333                    dataType: "json",
334                    context: this,
335                    data: $(this).serialize() + "&action=stm_ajax_add_event_member",
336                    beforeSend: function () {
337                        $(".alert-modal").remove();
338                        $(this).closest("form").find("input").removeClass("form-error");
339                        $(this).closest("form").find(".stm-ajax-loader").addClass("loading");
340                    },
341                    success: function (data) {
342                        $(this).closest("form").find(".stm-ajax-loader").removeClass("loading");
343
344                        $(this).closest("form").find(".event-members-box").append('<div class="alert-modal alert alert-' + data.status + ' text-left">' + data.response + '</div>')
345                        for (var key in data.errors) {
346                            $('#event-members-form input[name="' + key + '"]').addClass("form-error");
347                        }
348                        if (!$('#event-members-form input[name="' + key + '"]').hasClass('form-error')) {
349                            $(".event-members-box-table .event-attended-count").text(parseInt($(".event-members-box-table .event-attended-count").text()) + 1);
350                            $(".event-attended-count.event-new-count").text(parseInt($(".event-attended-count.event-new-count").text()) + 1);
351                            if (addedEvents) {
352                                addedEvents.push(eventID);
353                            } else {
354                                addedEvents = [eventID];
355                            }
356                            localStorage.setItem('addedEvents', JSON.stringify(addedEvents));
357                            $($this).find(".form__notice_success").fadeIn(300);
358                        }
359                        $("#event-members-form button").addClass("disabled").prop('disabled', true);
360                    },
361                    complete: function (data) {
362                        $("#event-members-form")[0].reset();
363                    }
364                });
365                $(this).closest("form").find(".form-error").live("hover", function () {
366                    $(this).removeClass("form-error");
367                });
368            } else {
369                $($this).find(".form__notice_information").fadeIn(300);
370            }
371            return false;
372        });
373    }
374
375    $(".event_terms_conditions #event_terms_conditions").on("click", function(e){
376        if($(this).is(':checked')){
377            $("#event-members-form button").removeClass("disabled").prop('disabled', false);
378        } else {
379            $("#event-members-form button").addClass("disabled").prop('disabled', true);
380        }
381    });
382
383    $(".event_joining .show_event_list_form").on("click", function(e){
384        var eventItemValId = $(this).parents(".item").find(".event-item-id").val();
385        $(".stm_events_classic #event-members-form .event_member_id").val(eventItemValId);
386        $(".stm_events_list_form").show();
387        $(this).parents(".item").find(".event-attended-count").addClass("event-new-count");
388    });
389    $(".notice__hide").on("click", function(e){
390        $(".stm_events_list_form").hide();
391        $("#event-members-form")[0].reset();
392        $("#event-members-form .alert-modal").hide();
393        $("#event-members-form .form__notice_information").hide();
394        $(".stm_events_classic .item").find(".event-attended-count").removeClass("event-new-count");
395    });
396
397    $(".events_lessons_box .event_lesson_tabs:first-child").addClass("active");
398    $('.events_lessons_box .event_lesson_tabs a').each(function(e){
399        if( $(this).parent().hasClass("active")) {
400            $($(this).attr('href')).show();
401        }
402    });
403    $('.events_lessons_box .event_lesson_tabs a').click(function(e){
404        $(this).parents(".events_lessons_box").find(".event_lesson_info").hide();
405        $(this).parents(".events_lessons_box").find(".event_lesson_tabs").removeClass("active");
406        $(this).parent().addClass("active");
407        $($(this).attr("href")).show();
408        return false;
409    });
410
411    $(document).on("click", ".js-open-search-box", function() {
412        $(this).closest(".header_search").toggleClass("active");
413        return false;
414    });
415
416    if( $(".wpb_revslider_element").length && $('body').hasClass("header_style_7") ) {
417        $(".wpb_revslider_element").closest(".vc_row-no-padding").addClass("stm-revslider-wrapper");
418    }
419
420    $(document).on("click", "body", function(e) {
421        if( ! $(e.target).closest(".header_search").length ) {
422            $(".header_search").removeClass("active");
423
424        }
425    });
426
427    $("body .wpb_video_widget .wpb_wrapper .wpb_video_wrapper .play_video").live('click', function () {
428        $(this).parent().find('iframe').attr( 'src', $(this).parent().find('iframe').attr( 'src' ) + '?autoplay=1').delay();
429        $(this).hide();
430        $(this).parent().find('img').hide();
431        $(this).parent().find('.video').show();
432        return false;
433    });
434
435    $(".staff_read_more").live('click', function () {
436        $(this).closest('.stm_staff_2').find('.full_description').slideToggle(150);
437        return false;
438    });
439
440    $("select:not(.stm_not_select2)").each(function() {
441        if( ! $(this).closest(".gfield").hasClass("stm_not_select2") ) {
442            $(this).select2({width: '100%', minimumResultsForSearch: '-1'});
443        }
444    });
445    if( $("#rating").length ){
446        $("#rating").select2( 'destroy' );
447    }
448
449    if( $("#demos_switcher").length ) {
450        $("#demos_switcher").select2("destroy");
451
452        $("#demos_switcher").select2({
453            templateResult: demosItemTemplate,
454            width: '100%',
455            minimumResultsForSearch: '-1'
456        });
457
458    }
459
460    if( $('body').hasClass('customizer_page') ) {
461        $(".customizer_page .ui-tabs").remove();
462    }
463
464    $('#menu_toggle').live('click', function () {
465        $(this).toggleClass('open');
466		$('body').toggleClass('activeMenu');
467		$('.sidebar-search ul.sidebar-contacts li:nth-child(2) a').attr('id','hover');
468        $('.mobile_header .top_nav_mobile').slideToggle(300);
469        return false;
470    });
471    $('#menu_toggle_button').live('click', function () {
472        $(this).toggleClass('open');
473        $('.header_side').each(function(){
474            if(! $(this).hasClass('show') ) {
475                $(this).addClass('show');
476                if($('body').hasClass('rtl')) {
477                    $(this).animate({right: "0"}, 300);
478                }else {
479                    $(this).animate({left: "0"}, 300);
480                }
481            }else {
482                $(this).removeClass('show');
483                if($('body').hasClass('rtl')) {
484                    $(this).animate({right: "-100%"}, 600);
485                }else{
486                    $(this).animate({left: "-100%"}, 600);
487                }
488            }
489        });
490
491        return false;
492    });
493
494    $(".mobile_header .top_nav_mobile .main_menu_nav > li.menu-item-has-children > a").after('<span class="arrow"><i></i></span>');
495    $(".mobile_header .top_nav_mobile .main_menu_nav > li.menu-item-has-children > .sub-menu > .menu-item-has-children > a").after('<span class="arrow"><i class="fa fa-chevron-down"></i></span>');
496
497    $(".mobile_header .top_nav_mobile .main_menu_nav > li.menu-item-has-children .arrow").live('click', function () {
498        $(this).toggleClass('active');
499        $(this).closest('li').find('ul').first().slideToggle(300);
500    });
501
502    $(".mobile_header .top_nav_mobile .main_menu_nav > li.menu-item-has-children > a").live('click', function () {
503        if( $(this).attr('href') == '#' ){
504            $(this).closest('li').find('ul').slideToggle(300);
505            $(this).closest('li').find('.arrow').toggleClass('active');
506        }
507    });
508
509    // Quantity actions
510    $('body').on('click', '.quantity_actions span', function() {
511        var quantityContainer = $(this).closest('.quantity'),
512            quantityInput = quantityContainer.find('.qty'),
513            quantityVal = quantityInput.attr('value');
514
515		$('.shop_table.cart .button').removeAttr("disabled")
516
517        if( $(this).hasClass('plus') ) {
518            quantityInput.attr('value', parseInt(quantityVal) + 1);
519        } else if( $(this).hasClass('minus') ) {
520            if( quantityVal > 1 ) {
521                quantityInput.attr('value', parseInt(quantityVal) - 1);
522            }
523        }
524    });
525
526    // Stiky Header
527//	var headerHeight = $("#header").height();
528	var headerHeight = $(window).height() / 2;
529    var headerTop = $(".header_top").height();
530    var topBar = $(".top_bar").height();
531
532    $("#header .top_nav, #header .header_top").affix({
533        offset: {
534            top: headerHeight
535        }
536    });
537
538    $("#menu_toggle_button").affix({
539        offset: {
540            top: topBar
541        }
542    });
543
544    $(window).scroll(function(){
545        if( $(".sticky_menu .header_top, .sticky_menu .top_nav").hasClass('affix') ) {
546            $("#header").css("paddingBottom", headerTop);
547        } else {
548            $("#header").css("paddingBottom", 0);
549        }
550    });
551
552    $(".top_bar_info_switcher .active").on('click', function () {
553
554        if( $(".top_bar_info_switcher ul").is(':visible') ){
555            $(".top_bar_info_switcher ul").slideUp(100);
556        }else{
557            $(".top_bar_info_switcher ul").slideDown(100);
558        }
559
560        return false;
561    });
562
563    $(".top_bar_info_switcher a").on('click', function () {
564        var id = $(this).attr('href');
565        var title = $(this).text();
566        $(".top_bar_info").hide();
567        $(id).show();
568        $(".top_bar_info_switcher .active span").text(title);
569        $(".top_bar_info_switcher ul").slideUp(100);
570        return false;
571    });
572
573    if(! /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ){
574        stm_animate_block();
575    }else{
576        $(".stm_animation").css('opacity', 1);
577    }
578
579    jQuery(window).scroll(function(){
580        if(! /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ){
581            stm_animate_block();
582        }else{
583            $(".stm_animation").css('opacity', 1);
584        }
585    });
586
587	$('.single-product .product-type-variable table.variations select').live("change", function() {
588		$(this).parent().find('.select2-selection__rendered').text($(this).find('option[value="'+ $(this).val() +'"]').text());
589	});
590
591    /*Adds*/
592    if(typeof($.fancybox) !== 'undefined') {
593        $('.stm_fancy-iframe').fancybox({
594            type: 'iframe',
595            padding: 0,
596            maxWidth: '800px',
597            width: '100%',
598            fitToView: false,
599            beforeLoad: function () {
600                var url = $(this.element).data('url');
601                this.href = url;
602            }
603        });
604
605        $('.stm_fancybox').fancybox({
606            fitToView	: false,
607            padding     : 30,
608            maxWidth    : '500px',
609            autoSize	: true,
610            closeClick	: false,
611            openEffect	: 'none',
612            closeEffect	: 'none'
613        });
614    }
615
616    $('[data-scroll-to]').on('click', function(e){
617        var url = $(this).attr('data-scroll-to');
618        if(typeof(url) !== 'undefined') {
619            var url_parsed = url.split('#');
620            if(typeof(url_parsed[1]) !== 'undefined' && $('#' + url_parsed[1]).length > 0) {
621                $('html, body').stop().animate({
622                    scrollTop: $('#' + url_parsed[1]).offset().top
623                }, 700);
624            } else {
625                window.location.href = url;
626            }
627        }
628    });
629
630    if($('body').hasClass('site_layout_19')) {
631        $('.top_nav li a').on('click', function (e) {
632            e.preventDefault();
633            var url = $(this).attr('href');
634            if (typeof(url) !== 'undefined') {
635                var url_parsed = url.split('#');
636                if (typeof(url_parsed[1]) !== 'undefined' && $('#' + url_parsed[1]).length > 0) {
637                    $('html, body').stop().animate({
638                        scrollTop: $('#' + url_parsed[1]).offset().top - 50
639                    }, 700);
640                } else {
641                    window.location.href = url;
642                }
643            }
644        });
645    }
646
647    $('.stm_top_bar_l13-search button').click(function(e){
648        var $wr = $(this).closest('.stm_top_bar_l13-search');
649        if($wr.hasClass('active')) {
650            if($wr.find('input').val() == '') {
651                e.preventDefault();
652                $wr.removeClass('active active-focus');
653            }
654        } else {
655            e.preventDefault();
656            $wr.addClass('active active-focus');
657            setTimeout(function(){
658                $wr.find('input').focus();
659            }, 300);
660        }
661    })
662
663    $('body').click(function(e) {
664        if ($(e.target).closest('.stm_top_bar_l13-search').length === 0) {
665            var $wr = $('.stm_top_bar_l13-search');
666            $wr.find('input').focusout();
667            $wr.removeClass('active active-focus');
668        }
669    });
670
671});
672
673function stm_animate_block(){
674    jQuery('.stm_animation').each(function(){
675        if(jQuery(this).attr('data-animate')) {
676            var animation_blocks = jQuery(this).children('*');
677            var animationName = jQuery(this).attr('data-animate'),
678                animationDuration = jQuery(this).attr('data-animation-duration') + 's',
679                animationDelay = jQuery(this).attr('data-animation-delay');
680            var style = 'opacity:1;-webkit-animation-delay:'+animationDelay+'s;-webkit-animation-duration:'+animationDuration+'; -moz-animation-delay:'+animationDelay+'s;-moz-animation-duration:'+animationDuration+'; animation-delay:'+animationDelay+'s;';
681            var container_style = 'opacity:1;-webkit-transition-delay: '+(animationDelay)+'s; -moz-transition-delay: '+(animationDelay)+'s; transition-delay: '+(animationDelay)+'s;';
682            if (isAppear(jQuery(this))) {
683                jQuery(this).attr( 'style', container_style );
684                jQuery.each( animation_blocks, function(index,value){
685                    jQuery(this).attr('style', style);
686                    jQuery(this).addClass('animated').addClass(animationName);
687                });
688            }
689        }
690    });
691}
692
693function isAppear(id) {
694    var window_scroll = jQuery(window).scrollTop();
695    var window_height = jQuery(window).height();
696
697    if (jQuery(id).hasClass('stm_viewport')) {
698        var start_effect = jQuery(id).data('viewport_position');
699    }
700
701    if (typeof(start_effect) === 'undefined' || start_effect == '') {
702        var percentage = 2;
703    }else {
704        var percentage = 100 - start_effect;
705    }
706    var element_top = jQuery(id).offset().top;
707    var position = element_top - window_scroll;
708
709    var cut = window_height - (window_height * (percentage / 100));
710    if (position <= cut) {
711        return true;
712    }else {
713        return false;
714    }
715}
716
717function demosItemTemplate(state) {
718    if (!state.id) { return state.text; }
719    var $state = jQuery(
720        '<span class="'+ state.element.value +'"> ' + state.text + '</span>'
721    );
722    return $state;
723}
724
725function l18W() {
726    var $ = jQuery;
727    if($('body').hasClass('site_layout_18')) {
728        var contentW = $('#fullpage').outerWidth();
729        var contentArea = $('.content-area').outerWidth();
730        var fullWleft = contentW/2;
731
732        var marginArea = (contentW - contentArea) / 2;
733        //$('.stm_bg_right').css('width', contentW + 'px');
734        $('.stm_fullwidth_left').css({
735            'width' : fullWleft + 'px'
736        });
737
738        $('.stm_fullwidth_content').css({
739            'width' : contentW + 'px',
740            'margin-right' : '-' + marginArea + 'px'
741        })
742
743    }
744}
745
746if (jQuery('body.home').length) {
747	var app = document.getElementById('myTypewriter');
748
749	var typewriter = new Typewriter(app, {
750		loop: true
751	});
752	
753	typewriter.typeString('Commercial Litigation')
754    .pauseFor(500)
755    .deleteAll()
756    .typeString('Property Law')
757    .pauseFor(500)
758	.deleteAll()
759	.typeString('Criminal Law')
760    .pauseFor(500)
761	.deleteAll()
762	.typeString('Family Law')
763    .pauseFor(500)
764    .start();
765}
766
767jQuery(window).ready(function(e){
768
769    // Remove the # from the hash
770    var loadTarget = location.hash.replace('#','');
771
772    if(loadTarget != ''){
773
774        var $loadTarget = jQuery('#' + loadTarget);
775        jQuery('html, body').stop().animate({
776                'scrollTop': $loadTarget.offset().top
777            }, 300, 'swing', function() {
778
779            window.location.hash = '#' + loadTarget;
780        });
781
782    }
783});

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.