PageSourceSearch

https://www.everwellth.com/js/override.js?20261001043336

js everwellth.com collected 2026-09-30 20:33:53 UTC 42,380 bytes, 1,082 lines download raw bytes

1var menuWid=0;
2var midland_url= '';
3function changeMenu(){
4   menuWid=$(".MobileMenuDiv").width();
5   menuWid=parseInt(menuWid)*5;
6   $(".MobileMenuDiv").css({marginLeft:'-'+menuWid+'px'});
7}
8$(window).on('resize',function(){
9
10 if($(this).width() > 767){
11 	$('.mobile.SearchRow').css('display','none');
12 	$('.mobilePopWindow').css('display','none');
13 }
14 changeMenu();
15 
16});
17
18try{
19var hT = $('div.BannerSidebar').offset().top,     //div top position
20    hH = $('div.BannerSidebar').outerHeight(),    //div outer height
21    Mt = 15,                                      //15px floating banner top margin
22    Mb = 30;                                      //30px floating banner bottom margin
23    MainFlexDivHeight = $('#MainFlexDiv').outerHeight();
24    $("#MainFlexDiv .LeftDiv").css("min-height",MainFlexDivHeight+"px");
25}catch(e){}
26
27$(window).scroll(function() {
28  var wH = $(window).height(),                    //window height
29    wS = $(this).scrollTop(),                     //current scrolling position 
30    fT = $('footer').offset().top,                //footer top position
31    headH = $('.WebMenu.WebMenu2').outerHeight(); //header height
32
33    // 1137.078125                600             942                 1084                1866.078125         56
34    // hT,                        hH,             wH,                 wS,                     fT,           headH
35    // sidebar top position, sidebar height, window height, window scorll position, footer top position, header height
36    // console.log(hT,hH,wH,wS,fT,headH);
37    // console.log("1st "+(wS + headH + hH)+" "+ (fT - (Mt+Mb)));
38    // console.log("2nd "+(wS)+" "+((hT - headH - Mt)));
39    if (wS + headH + hH > fT - (Mt+Mb)){  
40      var diff = wH - (fT - wS);
41      $('div.BannerSidebar').addClass('fixed').css('bottom',diff+"px").css('top','auto');
42    } else if (wS > (hT - headH - Mt)){  
43      $('div.BannerSidebar').addClass('fixed').css('bottom','auto').css('top',(headH+Mt)+"px");
44    } else {
45      $('div.BannerSidebar').removeClass('fixed');
46    }
47});
48
49$(window).click(function() {
50    $(".PRMenu .MobileDisplay .SelectDiv .ListDiv,#displayTime .ListDiv,#Events .JoinBtn .PopupDiv").hide();
51});
52
53$(function (){
54	
55   $('.mobile.SearchRowicon.icon-search2').click(function(){
56   		$('.mobile.SearchRow').css('display','flex');
57   });
58   $('.icon-close').click(function(){
59  	 $('.mobile.SearchRow').css('display','none');
60   });
61  // Member Login Page
62  $("div.User01 .tab").click(function(){
63    var name = $(this).data("name");
64    $("div.User01 .tab").removeClass("Now");
65    $(this).addClass("Now");
66    
67    $("div.User01 form").hide();
68    $("div.User01 form[name="+name+"]").show();
69  });
70
71  // Event Page
72  $(".add_calendar").click(function(){
73    $(".show_calendar").toggle();
74  });
75
76  $("#Events .JoinBtn").click(function(e){
77    e.stopPropagation();
78    e.preventDefault();
79    $(this).find(".PopupDiv").show();
80  })
81
82  $("#event_enquiry_form").submit(function(e){
83    $(this).find(".error").hide();
84    var fail = false;
85
86    if($(this).find("input[name='name']").val() == ''){
87      $(this).find(".error[data-name='name']").show();
88      fail = true;
89    }
90
91    if($(this).find("input[name='phone']").val() == ''){
92      $(this).find(".error[data-name='phone']").show();
93      fail = true;
94    }
95
96    if($(this).find("input[name='email']").val() == ''){
97      $(this).find(".error[data-name='email']").show();
98      fail = true;
99    }
100
101    if($(this).find("textarea[name='enquiry']").val() == ''){
102      $(this).find(".error[data-name='enquiry']").show();
103      fail = true;
104    }
105
106    if(fail){
107      e.preventDefault();
108    }
109  })
110
111  $(".niceselect").niceSelect();
112  $(".timepicker").timepicker({
113    minHour : 8,
114    // dynamic: true,
115    change: function(time) {
116      // the input field
117      var element = $(this), text;
118      var sibling = $("input.timepicker[data-pair='"+element.data("pair")+"']").not(element);
119
120      var from = $("input.timepicker[data-pair='"+element.data("pair")+"'][data-pos='from']");  //just alias
121      var to = $("input.timepicker[data-pair='"+element.data("pair")+"'][data-pos='to']");  //just alias
122
123      var timepicker = sibling.timepicker();
124      var placeholder = $("div.DisplayTxt[data-pair='"+element.data("pair")+"']");
125
126      var string = '';
127      if(from.val() != '' || to.val() != ''){
128        string += (from.val() != '')? from.val() : "Any";
129        string += " - ";
130        string += (to.val() != '')? to.val() : "Any";
131        placeholder.text(string);
132      }else{
133        placeholder.text('Any Times');
134      }
135
136      if(time === false){ time = null; }
137
138      // text = 'Selected time is: ' + timepicker.format(time);
139      if(element.data('pos') == 'from'){
140        timepicker.options.minTime = time;
141      }else{
142        timepicker.options.maxTime = time;
143      }
144    }
145    // interval: 15 ,
146  });
147
148  $(".timepicker").trigger("change");
149
150  $("#displayTime").click(function(e){
151    e.stopPropagation();
152    $("#displayTime .ListDiv").show();
153  });
154
155  $(".ui-timepicker-container").click(function(e){
156    e.stopPropagation();
157  });
158
159  // Read more function
160  var is_end = $('#ReadMoreEvent').data("is_end");
161  var event_get_from = $("#ReadMoreEvent").data("get_from");
162  $("#ReadMoreEvent").click(function(e){
163      e.preventDefault();
164      var limit = $(this).data("limit");
165      var api = $(this).data("api"); 
166      
167      var param = window.location.search;
168	  if(is_end == 'true'){
169		  $.ajax({url: "/api/events/"+api+"/"+limit+"/"+event_get_from+"/"+is_end+param, success: function(result){
170			if(!$.trim($(result).html())){
171			  $("#ReadMoreEvent").remove();
172			}else{
173			  var last = $( ".BoxDiv.emptyBox" ).first();
174			  $(result).insertBefore(last);
175			}
176		  }});
177		   event_get_from += limit;
178	  }else{
179	  	$.ajax({url: "/api/events/checkLimit/"+limit+"/"+event_get_from, success: function(isReachLimit){
180			if(isReachLimit == 'true'){
181				is_end = isReachLimit;
182				 $.ajax({url: "/api/events/"+api+"/"+limit+"/"+event_get_from+"/"+is_end+param, success: function(result){
183					if(!$.trim($(result).html())){
184					  $("#ReadMoreEvent").remove();
185					}else{
186					  var last = $( ".BoxDiv.emptyBox" ).first();
187					  $(result).insertBefore(last);
188					}
189				
190		  		}});
191			  event_get_from = limit;
192			  
193			}else{
194			  $.ajax({url: "/api/events/"+api+"/"+limit+"/"+event_get_from+"/"+is_end+param, success: function(result){
195					if(!$.trim($(result).html())){
196					  $("#ReadMoreEvent").remove();
197					}else{
198					  var last = $( ".BoxDiv.emptyBox" ).first();
199					  $(result).insertBefore(last);
200					}
201				
202		  		}});
203			}
204			 event_get_from += limit;
205		  }});
206	  	 
207	  }
208      
209     
210  })
211	
212  // Event Search 
213  $("a.search_switch").click(function(e){
214    e.preventDefault();
215    $(".NorSearch,.AdvSearch").toggle();
216    if( $(this).text() == "Simple Search"){
217        $(this).text("Advanced Search");
218    }else{
219        $(this).text("Simple Search");
220    }
221  });
222  
223   // Read more function
224  var school_get_from = $("#ReadMoreSchool").data("get_from");
225  $("#ReadMoreSchool").click(function(e){
226      e.preventDefault();
227      var limit = $(this).data("limit");
228      var api = $(this).data("api");
229      var param = window.location.search;
230 	 
231      $.ajax({url: "/api/educations/"+api+"/"+limit+"/"+school_get_from+param, success: function(result){
232        if(!$.trim($(result).html())){
233          $("#ReadMoreSchool").remove();
234        }else{
235          school_get_from = school_get_from+limit;
236          var target = $(".school-content");
237          $(result).appendTo(target);
238        }
239      }});
240      school_get_from += limit;
241  })
242
243    //product review
244    // $(".PRMenu .WebDisplay .Lv2 a").click(function(e){
245    //   var category = $(this).text();
246    //   e.preventDefault();
247
248    //   $(".PRMenu .WebDisplay .Lv2 a").removeClass("Now");
249    //   $(this).addClass("Now");
250
251    //   $( "#product_list div.show_post" ).empty();
252
253    //   var id = $(this).data('sub');
254    //   var pos = 0;
255
256    //   $.get( "/products/get/"+id, function( data ) {
257    //     $.each(data, function( index, value ) {
258    //       $( "#product_list div.show_post").eq(pos).html( "<img src=\"https://s3-ap-southeast-1.amazonaws.com/champimom/files/img/"+value.Product.image+"\"/><div><h3>"+value.Product.slug+"</h3><h2>"+category+"</h2><div class='line'></div></div>" );
259    //       pos++;
260    //     })
261    //   },'json');
262    // });
263
264
265    // $(".PRMenu .WebDisplay .Lv1 .category").click(function(e){
266    //   e.preventDefault();
267
268    //   $(".PRMenu .WebDisplay .Lv1 .category").removeClass("Now");
269    //   $(this).addClass("Now");
270
271    //   var id = $(this).data('sub');
272    //   $(".PRMenu .WebDisplay .Lv2").hide();
273    //   $(".PRMenu .WebDisplay .Lv2.parent_"+id).show();
274    //   $(".PRMenu .WebDisplay .Lv2.parent_"+id+" a:first-child").trigger('click');
275    // });
276
277    // $(".PRMenu .WebDisplay .Lv1 .category:first-child").trigger('click');
278
279
280    //product preview for mobile
281    // $(".PRMenu .MobileDisplay .SelectDiv").click(function(e){
282    //   e.stopPropagation();
283    //   $(".PRMenu .MobileDisplay .SelectDiv.subcategory .ListDiv").hide();
284    //   $(this).find(".ListDiv:not(.disabled)").show();
285    // });
286
287    // $(".PRMenu .MobileDisplay .SelectDiv.category .ListDiv ul li").click(function(e){
288    //   e.stopPropagation();
289    //   var id = $(this).attr("value");
290    //   var name = $(this).text();
291    //   var parent = $(this).parents(".SelectDiv");
292
293    //   parent.find(".DisplayTxt").text(name);
294    //   $(this).parents(".ListDiv").hide();
295
296    //   $(".PRMenu .MobileDisplay .SelectDiv.subcategory").removeClass("disabled").css("opacity",1);
297    //   $(".PRMenu .MobileDisplay .SelectDiv.subcategory .DisplayTxt").text("-");
298    //   $(".PRMenu .MobileDisplay .SelectDiv.subcategory .ListDiv").addClass('disabled');
299    //   $(".PRMenu .MobileDisplay .SelectDiv.subcategory .ListDiv[data-sub="+id+"]").removeClass('disabled');
300    // });
301
302    // $(".PRMenu .MobileDisplay .SelectDiv.subcategory .ListDiv ul li").click(function(e){
303    //   e.stopPropagation();
304    //   var id = $(this).attr("value");
305    //   var category = $(this).text();
306    //   var parent = $(this).parents(".SelectDiv");
307
308    //   parent.find(".DisplayTxt").text(category);
309    //   $(this).parents(".ListDiv").hide();
310
311    //   $( "#product_list div.show_post" ).empty();
312    //   var pos = 0;
313    //   $.get( "/products/get/"+id, function( data ) {
314    //     $.each(data, function( index, value ) {
315    //       $( "#product_list div.show_post").eq(pos).html( "<img src=\"https://s3-ap-southeast-1.amazonaws.com/champimom/files/img/"+value.Product.image+"\"/><div><h3>"+value.Product.slug+"</h3><h2>"+category+"</h2><div class='line'></div></div>" );
316    //       pos++;
317    //     })
318    //   },'json');
319
320    // });
321
322
323
324
325    // hommepage swiper
326    var swiper_speed = $("#swiper_speed").val()*1000;
327    
328    if(window.matchMedia('(min-width: 1000px)').matches){ $(".slide_index_2,.slide_index_3").remove(); }
329
330    var mySwiper = new Swiper ('#hightlight', {
331      spaceBetween: 30,
332      centeredSlides: true,
333      autoplay: {
334        delay: swiper_speed,
335        disableOnInteraction: false,
336      },
337      navigation: {
338        nextEl: '.swiper-button-next',
339        prevEl: '.swiper-button-prev',
340      },
341      pagination: {
342        el: '.swiper-pagination',
343      },
344      speed: 1000,
345      loop: true
346    });
347  /*  //interview
348 	var galleryThumbs = new Swiper('.gallery-thumbs', {
349      spaceBetween: 10,
350      slidesPerView: 10,
351      freeMode: true,
352      watchSlidesVisibility: true,
353      watchSlidesProgress: true,
354    });
355    var galleryTop = new Swiper('.gallery-top', {
356      spaceBetween: 30,
357      centeredSlides: true,
358      navigation: {
359        nextEl: '.swiper-button-next.album-next',
360        prevEl: '.swiper-button-prev.album-pre',
361      },
362      thumbs: {
363        swiper: galleryThumbs
364      },
365      on: {
366		init: function () {
367		  console.log('swiper initialized');
368		    $('#myModal').hide();
369            $('#myModal').css('opacity',1);
370		},
371	  },
372    });
373    $('.prev-thumb').click(function(e){
374   		 var index = $(this).data("index");
375   		 galleryTop.slideTo(index,100,false);
376   		 galleryThumbs.slideTo(index,100,false);
377	 	 openModal();
378    });
379    function openModal() {
380	
381		$('#myModal').show();
382	}
383	$('#myModal .close').click(function(e){
384   		closeModal();
385    });
386	function closeModal() {
387		$('#myModal').hide();
388	}*/
389
390	
391    $("a.readall").click(function(e){
392      e.preventDefault();
393      $(this).remove();
394      $(".artContent.preview,.TagDiv.preview,.ShareBar.preview,.ReadMore.preview").removeClass("preview");
395    })
396
397    new ClipboardJS('.share_copy_url');
398
399    //share copy url
400    $(".share_copy_url").click(function(e){
401      e.preventDefault();
402      var copy = $(this).find(".Copied");
403      copy.show();
404      setTimeout(function() { copy.hide() }, 3000);
405    })
406
407    // subscribe form
408    $("#footer_search").submit(function(e){
409      e.preventDefault();
410      var ele = $("#EmailSub");
411      ele.show();
412      $("body").css("overflow","hidden");
413
414      var url = $(this).attr("action");
415      $.post(url, $(this).serialize(), function(result){ ele.find(".Overlary_S1 .BorderDiv h1").text(result); });
416    });
417
418    // enquiry form
419    $("#enquiryForm").submit(function(e){
420      e.preventDefault();
421      var ele = $("#EmailSub");
422      ele.find(".Overlary_S1 .BorderDiv h1").text('Your enquiry is sending...please wait...'); 
423      ele.show();
424      $("body").css("overflow","hidden");
425
426      var url = $(this).attr("action");
427      $.post(url, $(this).serialize(), function(result){ ele.find(".Overlary_S1 .BorderDiv h1").text(result); });
428    });
429
430    //TC & PP
431    $(".open_overlary").click(function(e){
432      e.preventDefault();
433      var ele = $("#"+$(this).data("overlary"));
434      ele.show();
435      $("body").css("overflow","hidden");
436    });
437
438    $(".Overlary_close").click(function(e){
439      e.preventDefault();
440      $(".Overlary_body").hide(); 
441      $("body").css("overflow","visible");
442    })
443
444    // Read more function
445    var get_from = $("#ReadMore").data("get_from");
446    $("#ReadMore").click(function(e){
447        e.preventDefault();
448        var limit = $(this).data("limit");
449        var api = $(this).data("api");
450        var param = '';
451		var on_home_page = ($(this).data('on_home') == true)? true : false;
452		if( window.location.search!='' ){
453			param = `?search=${getQueryVariable('search')}`;
454		}else if( $(this).data('category_id') == '' ){
455			param = `?tag_name=${$(this).data('tag_name')}`;
456		}else{
457			param = "?category_id="+$(this).data('category_id')
458		}
459
460		$.ajax({url: "/api/posts/"+api+"/"+limit+"/"+get_from+"/"+on_home_page+param, success: function(result){
461            if(!$.trim($(result).html())){
462              $("#ReadMore").remove();
463			  $(".NewArticleDiv.Other").append('已到最底');
464            }else{
465              $(result).appendTo(".NewArticleDiv.Other");
466            }
467        }});
468        get_from += limit;
469    })
470
471    // link in <a> link
472    $(".gotocategory").click(function(e){
473      e.preventDefault();
474      window.location.href = $(this).data("href");
475    });
476
477    changeMenu();
478    $(".icon-navicon").click(function(){
479        $(".MobileMenuDiv").show().css('display', 'flex').animate({marginLeft:'0px'},1000);
480        $("body").css("overflow","hidden");
481    }); 
482    $(".MobileMenuDiv .icon-close").click(function(){
483       $(".MobileMenuDiv").animate({marginLeft:'-'+menuWid+'px'},1000,'swing',function(){
484        $(".MobileMenuDiv").hide();   
485        $("body").css("overflow","visible");
486       });
487    });
488
489  $(window).scroll( 
490    function() {
491      $BodyST=($(document).scrollTop());
492      $BodyW=($(window).width());
493      if ($BodyST>250){ 
494        $('div.MobileMenuBar').css("position", 'fixed'); 
495        $('div.ccMobileMenuBar').css("position", 'fixed'); 
496      }
497      else { 
498         $('div.MobileMenuBar').css("position",'relative');
499         $('div.ccMobileMenuBar').css("position",'relative');
500      }
501      if (($BodyST>400)&($BodyW>999)){
502         $('div.WebMenu2').css("display", 'flex'); }
503          else { $('div.WebMenu2').css("display",'none'); }
504    }
505  );
506
507  $(".WebMenu .Menu li").each(function(){
508     $(this).mouseenter(function(e){
509        $(this).find('a').addClass('now');
510          e.stopPropagation();
511     }).mouseleave(function(e){
512        $(this).find('a').removeClass('now');
513          e.stopPropagation();
514     });
515  });
516
517  $(".WebMenu .child").mouseenter(
518    function(e){	
519      var child = $(this).data("child");
520      $("#"+child).css("display", "flex")
521    .hide().stop()
522    .fadeIn();
523    e.stopPropagation();
524    }).mouseleave(function(e){
525      var child = $(this).data("child");
526      $("#"+child).stop().fadeOut(200);
527        e.stopPropagation();
528  });
529
530    // $(".WebMenu .SubMenuDiv").each(function(){
531    //     $(this).hover(function(){
532    //        if(timer!='')clearTimeout(timer);
533    //     },function(){
534    //        var self=this;
535    //        timer=setTimeout(function(){
536     //          $(self).slideUp();
537     //     },1500);
538    //     });
539    // });
540    $(".MenuItems li div.icon-chevron-right").each(function(){
541// 20240322, TAM, Reverse sidebar menu navigation to mouse-click from mouse-hover.
542        $(this).click(function(event){
543        // $(this).mouseenter(function(event){
544// end 20240322, TAM, Reverse sidebar menu navigation to mouse-click from mouse-hover.
545           event.stopPropagation();
546           var index= $(this).parent().index();
547           console.log(index);
548           $(".MenuItems .child,.MenuItems .parent,.MobileMenuDiv .Title span").hide();
549           $(".MobileMenuDiv .FltCln").eq(index).show();
550           $(".MenuItems .child").eq(index).show();
551        });
552    });
553
554    $(".FltCln").each(function(){
555// 20240322, TAM, Reverse sidebar menu navigation to mouse-click from mouse-hover.
556      $(this).click(function(event){
557      // $(this).mouseenter(function(event){
558// end 20240322, TAM, Reverse sidebar menu navigation to mouse-click from mouse-hover.
559		event.stopPropagation();
560		var index=$(this).index();
561		console.log(index);
562		$(".MenuItems .parent,.MobileMenuDiv .Title span").show();
563		$(".MenuItems .child,.MobileMenuDiv .FltCln").hide();
564         
565      });
566    });
567    //submenu next more article
568    
569    $(".next_news_posts").each(function(){
570      	var cat_id = $(this).data("category_id");
571        var limit = $(this).data("limit");
572		var param = "?category_id="+cat_id;
573    	$(this).click(function(event){
574        	 event.stopPropagation();
575        	 var get_from = $(this).data("get_from");
576        	 get_from+= limit;
577        	 $(this).data("get_from",get_from);
578        	$(".prev_news_posts[data-category_id='" + cat_id + "']").data("get_from",get_from);
579			 $.ajax({url: "/api/posts/next_post/"+limit+"/"+ get_from +param, success: function(result){
580			 if(typeof result['totals'] != "undefined" && typeof result['posts'] != "undefined"){
581				 if(result['posts'].length>0){
582				 	var posts=  result['posts'];
583					
584					var html= '';
585					posts.forEach(function(item, index) {
586						html+="<div class='GlobalArticle2'>"
587							 +"<a href='/"+item['Post']['slug']+"'" 
588							 +"onClick=\"gtag('event', 'play', {'event_action': 'Click','event_category': 'Posts','event_label':" + item['Post']['title'] +",'value': 1 });\""
589							 +" >";
590						if(typeof item['Post']['logo'] != "undefined"){
591							html+= '<div class="Photo" style="background-image:url('+item['Post']['logo']+');"></div>';
592						}else{
593							html+= '<div class="Photo" style="background-image:url('+item['Post']['media']+');"></div>';
594						}
595						
596						html+= '<h2>'+item['Post']['title']+'</h2></a></div>';
597		
598					});
599					
600					$('#menu_cat_'+cat_id).html(html);
601					if(get_from >= limit){
602						var pre = $(".prev_news_posts[data-category_id='" + cat_id + "']"); 
603						pre.removeClass('Null');
604					}
605					if(get_from + limit >= result['totals'] ){
606						var next = $(".next_news_posts[data-category_id='" + cat_id + "']");
607							next.addClass('Null');
608					}
609				 }
610			 }
611
612			}});
613      });
614    });
615     $(".float_next_news_posts").each(function(){
616      	var cat_id = $(this).data("category_id");
617        var limit = $(this).data("limit");
618		var param = "?category_id="+cat_id;
619    	$(this).click(function(event){
620        	 event.stopPropagation();
621        	 var get_from = $(this).data("get_from");
622        	 get_from+= limit;
623        	 $(this).data("get_from",get_from);
624        	$(".float_prev_news_posts[data-category_id='" + cat_id + "']").data("get_from",get_from);
625			 $.ajax({url: "/api/posts/next_post/"+limit+"/"+ get_from +param, success: function(result){
626			 if(typeof result['totals'] != "undefined" && typeof result['posts'] != "undefined"){
627				 if(result['posts'].length>0){
628				 	var posts=  result['posts'];
629					
630					var html= '';
631					posts.forEach(function(item, index) {
632						html+="<div class='GlobalArticle2'>"
633							 +"<a href='/"+item['Post']['slug']+"'" 
634							 +"onClick=\"gtag('event', 'play', {'event_action': 'Click','event_category': 'Posts','event_label':" + item['Post']['title'] +",'value': 1 });\""
635							 +" >";
636						if(typeof item['Post']['logo'] != "undefined"){
637							html+= '<div class="Photo" style="background-image:url('+item['Post']['logo']+');"></div>';
638						}else{
639							html+= '<div class="Photo" style="background-image:url('+item['Post']['media']+');"></div>';
640						}
641						
642						html+= '<h2>'+item['Post']['title']+'</h2></a></div>';
643		
644					});
645					
646					$('#float_menu_cat_'+cat_id).html(html);
647					if(get_from >= limit){
648						var pre = $(".float_prev_news_posts[data-category_id='" + cat_id + "']"); 
649						pre.removeClass('Null');
650					}
651					if(get_from + limit >= result['totals'] ){
652						var next = $(".float_next_news_posts[data-category_id='" + cat_id + "']");
653							next.addClass('Null');
654					}
655				 }
656			 }
657
658			}});
659      });
660    });
661    
662     $(".prev_news_posts").each(function(){
663      	var cat_id = $(this).data("category_id");
664        var limit = $(this).data("limit");
665        
666		var param = "?category_id="+cat_id;
667		
668    	$(this).click(function(event){
669    		var get_from = $(this).data("get_from");
670    		get_from-= limit;
671        	 $(this).data("get_from",get_from);
672        	 $(".next_news_posts[data-category_id='" + cat_id + "']").data("get_from",get_from);
673        	 event.stopPropagation();	
674			 $.ajax({url: "/api/posts/next_post/"+limit+"/"+get_from +param, success: function(result){
675				if(typeof result['totals'] != "undefined" && typeof result['posts'] != "undefined"){
676				
677					if(result['posts'].length>0){
678						
679						var posts=  result['posts']
680				
681						var html= '';
682				
683						posts.forEach(function(item, index) {
684									html+="<div class='GlobalArticle2'>"
685										 +"<a href='/"+item['Post']['slug']+"'" 
686										 +"onClick=\"gtag('event', 'play', {'event_action': 'Click','event_category': 'Posts','event_label':" + item['Post']['title'] +",'value': 1 });\""
687										 +" >";
688									if(typeof item['Post']['logo'] != "undefined"){
689										html+= '<div class="Photo" style="background-image:url('+item['Post']['logo']+');"></div>';
690									}else{
691										html+= '<div class="Photo" style="background-image:url('+item['Post']['media']+');"></div>';
692									}
693								
694									html+= '<h2>'+item['Post']['title']+'</h2></a></div>';
695				
696						});
697						$('#menu_cat_'+cat_id).html(html);
698						if(get_from + limit <=result['totals'] ){
699							var next = $(".next_news_posts[data-category_id='" + cat_id + "']");
700								next.removeClass('Null');
701						}
702						if(get_from - limit <= limit ){
703							var prev = $(".prev_news_posts[data-category_id='" + cat_id + "']");
704								prev.addClass('Null');
705						}
706					}
707				}
708			}});
709			
710      });
711    });
712    
713    
714     $(".flaot_prev_news_posts").each(function(){
715      	var cat_id = $(this).data("category_id");
716        var limit = $(this).data("limit");
717        
718		var param = "?category_id="+cat_id;
719		
720    	$(this).click(function(event){
721    		var get_from = $(this).data("get_from");
722    		get_from-= limit;
723        	 $(this).data("get_from",get_from);
724        	 $(".float_next_news_posts[data-category_id='" + cat_id + "']").data("get_from",get_from);
725        	 event.stopPropagation();	
726			 $.ajax({url: "/api/posts/next_post/"+limit+"/"+get_from +param, success: function(result){
727				if(typeof result['totals'] != "undefined" && typeof result['posts'] != "undefined"){
728				
729					if(result['posts'].length>0){
730						
731						var posts=  result['posts']
732				
733						var html= '';
734				
735						posts.forEach(function(item, index) {
736									html+="<div class='GlobalArticle2'>"
737										 +"<a href='/"+item['Post']['slug']+"'" 
738										 +"onClick=\"gtag('event', 'play', {'event_action': 'Click','event_category': 'Posts','event_label':" + item['Post']['title'] +",'value': 1 });\""
739										 +" >";
740									if(typeof item['Post']['logo'] != "undefined"){
741										html+= '<div class="Photo" style="background-image:url('+item['Post']['logo']+');"></div>';
742									}else{
743										html+= '<div class="Photo" style="background-image:url('+item['Post']['media']+');"></div>';
744									}
745								
746									html+= '<h2>'+item['Post']['title']+'</h2></a></div>';
747				
748						});
749						$('#float_menu_cat_'+cat_id).html(html);
750						if(get_from + limit <=result['totals'] ){
751							var next = $(".float_next_news_posts[data-category_id='" + cat_id + "']");
752								next.removeClass('Null');
753						}
754						if(get_from - limit <= limit ){
755							var prev = $(".float_prev_news_posts[data-category_id='" + cat_id + "']");
756								prev.addClass('Null');
757						}
758					}
759				}
760			}});
761			
762      });
763    });
764   
765    showFieldForPregancing();
766    showKidInfoForm();
767    showKidInfoDetails();
768   //for user login
769   
770  
771   $("input[name='data[User][is_pregnancing]']").change(function() {
772   		showFieldForPregancing();
773	});
774
775	
776	$("input[name='data[User][has_child]']").change(function() {
777   		showKidInfoForm();
778	});
779	
780	$("input[name='data[User][no_of_kids]']").change(function() {
781   		showKidInfoDetails();
782	});
783	
784	if($('input.datetimepicker').length >0){
785	 $('input.datetimepicker').datepicker({dateFormat: 'yy-mm-dd'});
786	 }
787	 
788	 $('#register').on("submit", function(){
789	   if($("input[name='data[User][is_pregnancing]']:checked").val()==undefined
790	  || $("input[name='data[User][has_child]']:checked").val()==undefined
791	  ){
792	  	 if($("input[name='data[User][is_pregnancing]']:checked").val()==undefined){
793	  	 	   	$('.is_pregnancing_ques .text-danger.status').show();
794	  	 }else{
795	  	 	$('.is_pregnancing_ques .text-danger.status').hide();
796	  	 }
797	  	if( $("input[name='data[User][has_child]']:checked").val()==undefined){
798	  		   	$('.has_child_ques .text-danger.status').show();
799	  	}else{
800	  	 	$('.has_child_ques .text-danger.status').hide();
801	  	 }
802		 return false;
803	    	//$('.text-danger.error_msg').show();
804	    	/*var new_position = $('.error_msg').offset().top;
805
806    		$('html, body').stop().animate({ scrollTop: new_position }, 500);
807*/
808
809	   }else{
810	   		$('.text-danger.error_msg').hide();
811	   		$('.text-danger.status').hide();
812	   		return true;
813	   }
814  
815 })
816});
817
818function showFieldForPregancing(){
819	//console.log($("input[name='data[User][is_pregnancing]']:checked").val());
820	if($("input[name='data[User][is_pregnancing]']:checked").val()== '1'){
821		$('tr.is_pregnancing').show();
822		$('[name="data[User][due_date]"]').prop('required',true);
823		/*$('tr.is_pregnancing').find('input').each(function(){
824			$(this).prop('required',true);
825		});*/
826		$('.custom-file-input').each(function(){
827			
828			$(this).change(function(e){
829				if(typeof(e.target.files[0].name)!=undefined){
830					 var fileName = e.target.files[0].name;
831					 $(this).parent().find(".custom-file-label").html(fileName);
832					if  (( e.target.files[0].size / 1024 / 1024).toFixed(2) > 4) {
833				
834								$(".prag_proof_error_msg").html(
835								'檔案過大,請重新上載! ');
836								$('.Btn').prop('disabled', true);
837					
838				
839						}else{
840								$('.Btn').prop('disabled', false);
841								$(".prag_proof_error_msg").html('');
842						}
843					if(fileName!=''){
844						$(".file-name").html(fileName);
845						$('.file-container').show();
846						$('.btn-delete').click(function(){
847							$('.Btn').prop('disabled', false);
848							$(".prag_proof_error_msg").html('');
849							$(e.target).val('');
850							$(e.target).parent().find(".custom-file-label").html('選擇檔案');
851							$('.file-container').hide();
852						});
853					}
854				}else{
855					$(this).parent().find(".custom-file-label").html('選擇檔案');
856					$('.file-container').hide();
857				}
858
859			});
860		});
861	}else{
862		$('tr.is_pregnancing').hide();
863		$('[name="data[User][due_date]"]').prop('required',false);
864		/*$('tr.is_pregnancing').find('input').each(function(){
865			$(this).prop('required',false);
866		});*/
867	}
868}
869function showKidInfoForm(){
870	if($("input[name='data[User][has_child]']:checked").val()=='1'){
871		$(".has_child").show();
872	}else{
873		$(".has_child").hide();
874		$(".kids_info_section").hide();
875		$('input[name="data[User][no_of_kids]"]').prop("checked", false); 
876	}
877	
878}
879function showKidInfoDetails(){
880	if($("input[name='data[User][no_of_kids]']:checked").val()!=null){
881		$(".kids_info_section").show();
882			$('#kids_info').html('');
883			
884			for(var i =0;i< $("input[name='data[User][no_of_kids]']:checked").val(); i++){
885				$('#kids_info').append('<span class="kid_info_'+i+'">'+
886							'<label>第'+(i+1)+'名⼦女年齡</label><br>'+
887							'<label class="container"><input type="radio" name="data[Child]['+i+'][age]" value="0"> 0-1æ­² <span class="radiobtn"></span></label>'+
888							'<label class="container"><input type="radio" name="data[Child]['+i+'][age]" value="1"> 1-3æ­² <span class="radiobtn"></span></label>'+	
889							'<label class="container"><input type="radio" name="data[Child]['+i+'][age]" value="2"> 3-6æ­² <span class="radiobtn"></span></label>	'+
890							'<label class="container"><input type="radio" name="data[Child]['+i+'][age]" value="3"> 6歲以上 <span class="radiobtn"></span></label>'+	
891							 '<br>'+
892							'<label>第'+(i+1)+'名⼦女性別</label><br>'+
893							'<label class="container"><input type="radio" name="data[Child]['+i+'][gender]" value="M"> 男  <span class="radiobtn"></span></label>	'+
894							'<label class="container"><input type="radio" name="data[Child]['+i+'][gender]" value="F"> 女  <span class="radiobtn"></span></label>	<br><br>
894'+
895						'</span>');
896			}
897			
898	}else{
899		$('#kids_info').html('');
900		$(".kids_info_section").hide();
901	}
902}
903
904function prefillChild(obj,index){
905	
906		if(obj.hasOwnProperty("age")){
907			$('input[name="data[Child]['+index+'][age]"][value="'+obj["age"]+'"]').prop("checked", true); 
908		}
909		if(obj.hasOwnProperty("gender")){
910			$('input[name="data[Child]['+index+'][gender]"][value="'+obj["gender"]+'"]').prop("checked", true); 
911		}
912		if(obj.hasOwnProperty("id")){
913			
914			$('.kid_info_'+index).append('<input type="hidden" name="data[Child]['+index+'][id]" value="'+obj["id"]+'">');
915		}
916}
917
918function toBookmark(event,event_id){
919		console.log(event);
920		event.stopPropagation();
921		$.ajax({url: "/api/users/bookmark/"+event_id, success: function(result){
922				
923				if(result== 'false'){
924					$('#ask_login').show();
925					//
926				}else if(result == '"removed"'){
927					
928					$('#event_'+event_id+'.btn_bookmark').removeClass('done');
929				}else{
930					$('#event_'+event_id+'.btn_bookmark').addClass('done');
931				}
932			}
933			,error: function(result){
934			//	window.location.href = "/users/login";
935			}});
936}
937
938$("input[name='ratingRadio']").change(function(e) {
939	e.stopPropagation();
940	$.ajax({url: "/api/users/event_rating/"+event_id+"/"+this.value, success: function(result){
941		
942		if(result== 'false'){
943			$('#ask_login').show();
944		}else if(result == 'true'){
945				
946			$('#st'+this.value).prop("checked", true);
947		}else{
948			console.log('fail');
949		}
950	}
951	,error: function(result){
952	//	window.location.href = "/users/login";
953	}
954	});
955   			
956});
957function redirectToWithCurrent(){
958	window.location.href = "/users/login?returnUrl="+window.location.href;
959}
960function redirectTo(event,href){
961	event.preventDefault();
962	window.location.href = href;
963}
964function clickToMidlandMore(school_net){
965	var searchCriteria = [];
966	searchCriteria['14,16'] = "44a90d11";
967	searchCriteria['31,32'] = "d4f17350";
968	searchCriteria['43,45'] = "366fca15";
969	searchCriteria['40'] = "b83fff9b";
970	searchCriteria['34,35,41'] = "a53491b";
971	searchCriteria['62'] = "319e6bdb";
972	searchCriteria['70,71'] = "3f5fb132";
973	searchCriteria['46,48'] = "e7020b7d";
974	searchCriteria['72,73,74'] = "7de6c6bd";
975	searchCriteria['84'] = "229af013";
976	searchCriteria['11'] = "97a75dff";
977	searchCriteria['12'] = "2c4998fc";
978	searchCriteria['64,65,66'] = "2d9422fe";
979	searchCriteria['80,81,83'] = "9be21af5";
980	searchCriteria['88,89,91'] = "fd804756";
981	searchCriteria['96,97,98,99'] = "7a15cf33";
982	searchCriteria['18'] = "ebc4faf6";
983	searchCriteria['95'] = "c0073bf3";
984	searchCriteria['11,12,34,41'] = "f15e9852";
985
986
987	midland_url = 'https://www.midland.com.hk';
988	if(school_net!=''){
989		midland_url ='https://www.midland.com.hk/zh-hk/list/buy/搜尋-H-'+searchCriteria[school_net];
990	}
991
992	if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|ipad|iris|kindle|Android|Silk|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(navigator.userAgent) 
993		|| /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|
993sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(navigator.userAgent.substr(0,4))) { 
994	
995		midland_url = midland_url+'?utm_source=ChampimomMobile&utm_medium=ClickToMore&utm_campaign=Champimom_promotion_2021&utm_content=schoolnet';
996        	trackingMidland(midland_url,'mobile');
997	} else {
998		midland_url = midland_url+'?utm_source=Champimomweb&utm_medium=ClickToMore&utm_campaign=Champimom_promotion_2021&utm_content=schoolnet';
999        	trackingMidland(midland_url,'web');
1000	}
1001	window.open(midland_url, '_blank');
1002}
1003function redirectToMidlandApp(isApp){
1004	if(isApp){
1005		$.ajax({
1006  			type: "POST",
1007 			 url: "/api/educations/midland_tracking", 
1008 			 data: { url: 'https://midland.onelink.me/huvY/champimomfloatinglogo', platform: 'mobile' },
1009 			 success: function(result){
1010				console.log(result);
1011				
1012			}
1013			,error: function(result){
1014				console.log(result);
1015			//	window.location.href = "/users/login";
1016			}
1017		}).then(function(html) {
1018			window.location.href= 'https://midland.onelink.me/huvY/champimomfloatinglogo';
1019		});
1020	//	trackingMidland('https://midland.onelink.me/huvY/champimomfloatinglogo','mobile');
1021	//	window.location.href= 'https://midland.onelink.me/huvY/champimomfloatinglogo';
1022    	}else{
1023		if (midland_url == '') {
1024			midland_url = 'https://www.midland.com.hk/zh-hk/promo/new-app-launch?pid=Champimom_Floating_Logo&af_click_lookback=7d&utm_content=schoolnet&utm_source=Champimomweb&shortlink=champimomfloatinglogo&utm_medium=Alwaysonfloatinglogo&utm_campaign=Champimom_promotion_2021&deep_link_value=https://www.midland.com.hk/zh-hk/list/buy/%E6%90%9C%E5%B0%8B-H-f15e9852&c=Champimom_2021';
1025		}
1026        	trackingMidland(midland_url,'mobile');
1027    		window.open( midland_url, '_blank');
1028    	}
1029}
1030function closeBlackBg(){
1031	$('.mobilePopWindow').hide();
1032}
1033
1034function floatingicon(url){
1035	// device detection
1036	if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|ipad|iris|kindle|Android|Silk|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(navigator.userAgent) 
1037		|| /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(navigator.userAgent.
1037substr(0,4))) { 
1038	
1039        	$('.mobilePopWindow').show();
1040    }else{
1041			url = url + '?utm_source=Champimomweb&utm_medium=Alwaysonfloatinglogo&utm_campaign=Champimom_promotion_2021&utm_content=schoolnet';
1042	 		trackingMidland(url,'web');
1043	 		window.open(url, '_blank');
1044    }
1045}
1046
1047function clickToMidland(url){
1048	// device detection
1049	if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|ipad|iris|kindle|Android|Silk|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(navigator.userAgent) 
1050		|| /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(navigator.userAgent.
1050substr(0,4))) { 
1051	
1052		midland_url = url+'?utm_source=ChampimomMobile&utm_medium=Alwaysonfloatinglogo&utm_campaign=Champimom_promotion_2021&utm_content=schoolnet';
1053        	$('.mobilePopWindow').show();
1054    }else{
1055	
1056		if(url == ''){
1057			trackingMidland('https://www.midland.com.hk/zh-hk/list/buy/%E6%90%9C%E5%B0%8B-H-e8f54829?utm_source=Champimomweb&utm_medium=Alwaysonfloatinglogo&utm_campaign=Champimom_promotion_2021&utm_content=schoolnet','web');
1058			window.open('https://www.midland.com.hk/zh-hk/list/buy/%E6%90%9C%E5%B0%8B-H-e8f54829?utm_source=Champimomweb&utm_medium=Alwaysonfloatinglogo&utm_campaign=Champimom_promotion_2021&utm_content=schoolnet', '_blank');
1059			
1060		}else{
1061			url = url + '?utm_source=Champimomweb&utm_medium=Alwaysonfloatinglogo&utm_campaign=Champimom_promotion_2021&utm_content=schoolnet';
1062	 		trackingMidland(url,'web');
1063	 		window.open(url, '_blank');
1064	 	}
1065    }
1066}
1067function trackingMidland(url,platform){
1068		
1069		$.ajax({
1070  			type: "POST",
1071 			 url: "/api/educations/midland_tracking", 
1072 			 data: { url: url, platform: platform },
1073 			 success: function(result){
1074				console.log(result);
1075				
1076			}
1077			,error: function(result){
1078				console.log(result);
1079			//	window.location.href = "/users/login";
1080			}
1081		});
1082}

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.