PageSourceSearch

https://www.crunchmediaworks.com/js/custom.js

js crunchmediaworks.com collected 2026-09-28 06:00:11 UTC 25,047 bytes, 614 lines download raw bytes

1var accordion_arr = [
2  {card_id: 'cardOne', header_id: 'headingOne', header_title: 'Digital Entertainment', show_card: true, collapse_id: 'collapseOne', card_body: 'Engage your viewers with HD, 4K and even 8K content without breaking the bank. You can  now improve user experience while simultaneously reducing cost.', img_1_src: 'images/custom/digital-communication-logos.png'},
3  {card_id: 'cardTwo', header_id: 'headingTwo', header_title: 'Social Networking', show_card: false, collapse_id: 'collapseTwo', card_body: 'Make lightning fast uploads a key differentiator of your service. Your users will thank you for it and so will your cloud.', img_1_src: 'images/custom/social-networking-logos.png'},
4  {card_id: 'cardThree', header_id: 'headingThree', header_title: 'Video Communications', show_card: false, collapse_id: 'collapseThree', card_body: 'Make it possible for your users to have a smooth video calling experience. Pixelation is cool on Minecraft, not real life.', img_1_src: 'images/custom/vdo-communication-logos.png'},
5  {card_id: 'cardFour', header_id: 'headingFour', header_title: 'E-commerce', show_card: false, collapse_id: 'collapseFour', card_body: 'Tons of digital media powering your online sales? Let your audience access these at the speed of how fast their thumbs can scroll.', img_1_src: 'images/custom/e-comm-logos.png'},
6  {card_id: 'cardFive', header_id: 'headingFive', header_title: 'Gaming', show_card: false, collapse_id: 'collapseFive', card_body: 'Stellar quality graphics, super fast streams, and zero lags, all delivered to your gamers at scale. Crunch can keep up with adrenaline.', img_1_src: 'images/custom/gaming-logos.png'},
7  {card_id: 'cardSix', header_id: 'headingSix', header_title: 'Live Events', show_card: false, collapse_id: 'collapseSix', card_body: 'No more blurry balls racing across the playing field (or into car windshields), and play-by-play clarity on exactly what’s going on, while it’s going on. Keeping up just got so much easier!', img_1_src: 'images/custom/try-logos.png'},
8  {card_id: 'cardSeven', header_id: 'headingSeven', header_title: 'Digital Health', show_card: false, collapse_id: 'collapseSeven', card_body: 'Step into the post pandemic norm of in-video visits that are often more accessible than in-person appointments, without any loss in detail, or definition.', img_1_src: 'images/custom/health-logos.png'},
9  {card_id: 'cardEight', header_id: 'headingEight', header_title: 'Education', show_card: false, collapse_id: 'collapseEight', card_body: 'Learning can be challenging enough without a less than perfect method of delivery. Equip your audience with high quality content delivered flawlessly, both live and recorded.', img_1_src: 'images/custom/education-logos.png'}
10];
11let imageURL = "https://marketing.crunchmediaworks.com/";
12
13$( document ).ready(function() {
14
15  let cards = [...document.querySelectorAll(".card")];
16  cards.forEach(card => {
17    card.addEventListener("click", function() {
18
19      cards.forEach(c => c.classList.remove("show"));
20      this.classList.add("show");
21      handleAccordianClicks();
22
23    })
24  });
25
26  // var fileName = location.href.split("/").slice(-1);
27  // if(fileName == 'index.html'){
28  //   // setDataSrc();
29  // }
30
31
32});//emd of $( document ).ready
33
34/*
35function setDataSrc(){
36
37  for(var i = 1; i <= 26; i++){
38    if(document.getElementById('img_'+i).src != '' || document.getElementById('img_'+i).src != null){
39      var src = document.getElementById('img_'+i).src;
40      var src1 = src.split('images/')
41      // document.getElementById('img_'+i).src = imageURL + 'images/' + src1[1];
42      document.getElementById('img_'+i).setAttribute('data-src',imageURL + 'images/' + src1[1])
43    }
44  }
45
46  //set accordian_img_1
47  if(document.getElementById('accordion_img_1').src != '' || document.getElementById('accordion_img_1').src != null){
48    var src = document.getElementById('accordion_img_1').src;
49    var src1 = src.split('images/');
50    document.getElementById('accordion_img_1').setAttribute('data-src',imageURL + 'images/' + src1[1])
51  }
52
53  for(var i = 1; i <=2; i++){
54    for(var j = 1; j<= 4; j++){
55      if(document.getElementById('video_group_'+i+'_sample_'+j+'_video_play_btn').src != '' || document.getElementById('video_group_'+i+'_sample_'+j+'_video_play_btn').src != null){
56        var src = document.getElementById('video_group_'+i+'_sample_'+j+'_video_play_btn').src;
57        var src1 = src.split('images/');
58        document.getElementById('video_group_'+i+'_sample_'+j+'_video_play_btn').setAttribute('data-src',imageURL + 'images/' + src1[1])
59      }
60    }
61  }
62
63  for(var i = 3; i <=3; i++){
64    for(var j = 1; j<= 2; j++){
65      if(document.getElementById('video_group_'+i+'_sample_'+j+'_video_play_btn').src != '' || document.getElementById('video_group_'+i+'_sample_'+j+'_video_play_btn').src != null){
66        var src = document.getElementById('video_group_'+i+'_sample_'+j+'_video_play_btn').src;
67        var src1 = src.split('images/');
68        document.getElementById('video_group_'+i+'_sample_'+j+'_video_play_btn').setAttribute('data-src',imageURL + 'images/' + src1[1])
69      }
70    }
71  }
72}//end of setDataSrc()
73*/
74
75function handleAccordianClicks() {
76
77  for(var i=0; i<accordion_arr.length; i++) {
78
79    var has_show_class_for_card = $("#"+accordion_arr[i].card_id).hasClass("show") ? true : false ;
80    var has_show_class_for_collapse = $("#"+accordion_arr[i].collapse_id).hasClass("show") ? true : false ;
81    //console.log(accordion_arr[i].card_id, has_show_class_for_card, accordion_arr[i].collapse_id, has_show_class_for_collapse);
82
83    if(has_show_class_for_card == true && has_show_class_for_collapse == false) {
84       $("#"+accordion_arr[i].card_id).removeClass("show")
85    }//end of if(has_show_class_for_card == true && has_show_class_for_collapse == false)
86
87  }//end of for(var i=0; i<accordion_arr.length; i++)
88
89  var accordion_img_1_to_show = '';
90  for(var i=0; i<accordion_arr.length; i++) {
91    if($("#"+accordion_arr[i].card_id).hasClass("show") && $("#"+accordion_arr[i].collapse_id).hasClass("show")) {
92      accordion_img_1_to_show = accordion_arr[i].img_1_src;
93      break;
94    }//end of if($("#"+accordion_arr[i].card_id).hasClass("show") && $("#"+accordion_arr[i].collapse_id).hasClass("show"))
95  }//end of for(var i=0; i<accordion_arr.length; i++)
96
97  if(accordion_img_1_to_show != '') {
98    document.getElementById("accordion_img_1").src = imageURL+ accordion_img_1_to_show;
99  }//end of if(accordion_img_1_to_show != '')
100
101}//end of function handleAccordianClicks()
102
103// Swiper starts
104var galleryThumbs_1 = new Swiper('#gallery-thumbs-1', {
105    spaceBetween: 10,
106    slidesPerView: 3,
107    freeMode: true,
108    watchSlidesVisibility: true,
109    watchSlidesProgress: true,
110});
111var galleryTop_1 = new Swiper('#gallery-top-1', {
112    spaceBetween: 10,
113    navigation: {
114        nextEl: '.swiper-button-next',
115        prevEl: '.swiper-button-prev',
116    },
117    thumbs: {
118        swiper: galleryThumbs_1
119    },
120    paginationClickable: false,
121    touchMoveStopPropagation: false,
122    simulateTouch: false,
123    allowSwipeToNext: true,
124    allowSwipeToPrev: true,
125    allowPageScroll: "auto ",
126    nextButton: '.swiper-button-next',
127    prevButton: '.swiper-button-prev',
128    touchRatio: 0,
129    slideToClickedSlide: true
130});
131
132var galleryThumbs_1_mobile = new Swiper('#gallery-thumbs-1-mobile', {
133    spaceBetween: 10,
134    slidesPerView: 3,
135    freeMode: true,
136    watchSlidesVisibility: true,
137    watchSlidesProgress: true,
138});
139var galleryTop_1_mobile = new Swiper('#gallery-top-1-mobile', {
140    spaceBetween: 10,
141    navigation: {
142        nextEl: '.swiper-button-next',
143        prevEl: '.swiper-button-prev',
144    },
145    thumbs: {
146        swiper: galleryThumbs_1_mobile
147    },
148    paginationClickable: false,
149    touchMoveStopPropagation: false,
150    simulateTouch: false,
151    allowSwipeToNext: true,
152    allowSwipeToPrev: true,
153    allowPageScroll: "auto ",
154    nextButton: '.swiper-button-next',
155    prevButton: '.swiper-button-prev',
156    touchRatio: 0,
157    slideToClickedSlide: true
158});
159
160var galleryThumbs_2 = new Swiper('#gallery-thumbs-2', {
161    spaceBetween: 10,
162    slidesPerView: 3,
163    freeMode: true,
164    watchSlidesVisibility: true,
165    watchSlidesProgress: true,
166});
167var galleryTop_2 = new Swiper('#gallery-top-2', {
168    spaceBetween: 10,
169    navigation: {
170        nextEl: '.swiper-button-next',
171        prevEl: '.swiper-button-prev',
172    },
173    thumbs: {
174        swiper: galleryThumbs_2
175    },
176    paginationClickable: false,
177    touchMoveStopPropagation: false,
178    simulateTouch: false,
179    allowSwipeToNext: true,
180    allowSwipeToPrev: true,
181    allowPageScroll: "auto ",
182    nextButton: '.swiper-button-next',
183    prevButton: '.swiper-button-prev',
184    touchRatio: 0,
185    slideToClickedSlide: true
186});
187
188var galleryThumbs_2_mobile = new Swiper('#gallery-thumbs-2-mobile', {
189    spaceBetween: 10,
190    slidesPerView: 3,
191    freeMode: true,
192    watchSlidesVisibility: true,
193    watchSlidesProgress: true,
194});
195var galleryTop_2_mobile = new Swiper('#gallery-top-2-mobile', {
196    spaceBetween: 10,
197    navigation: {
198        nextEl: '.swiper-button-next',
199        prevEl: '.swiper-button-prev',
200    },
201    thumbs: {
202        swiper: galleryThumbs_2_mobile
203    },
204    paginationClickable: false,
205    touchMoveStopPropagation: false,
206    simulateTouch: false,
207    allowSwipeToNext: true,
208    allowSwipeToPrev: true,
209    allowPageScroll: "auto ",
210    nextButton: '.swiper-button-next',
211    prevButton: '.swiper-button-prev',
212    touchRatio: 0,
213    slideToClickedSlide: true
214});
215
216var galleryThumbs_3 = new Swiper('#gallery-thumbs-3', {
217    spaceBetween: 10,
218    slidesPerView: 3,
219    freeMode: true,
220    watchSlidesVisibility: true,
221    watchSlidesProgress: true,
222});
223var galleryTop_3 = new Swiper('#gallery-top-3', {
224    spaceBetween: 10,
225    navigation: {
226        nextEl: '.swiper-button-next',
227        prevEl: '.swiper-button-prev',
228    },
229    thumbs: {
230        swiper: galleryThumbs_3
231    },
232    paginationClickable: false,
233    touchMoveStopPropagation: false,
234    simulateTouch: false,
235    allowSwipeToNext: true,
236    allowSwipeToPrev: true,
237    allowPageScroll: "auto ",
238    nextButton: '.swiper-button-next',
239    prevButton: '.swiper-button-prev',
240    touchRatio: 0,
241    slideToClickedSlide: true
242});
243
244var galleryThumbs_3_mobile = new Swiper('#gallery-thumbs-3-mobile', {
245    spaceBetween: 10,
246    slidesPerView: 3,
247    freeMode: true,
248    watchSlidesVisibility: true,
249    watchSlidesProgress: true,
250});
251var galleryTop_3_mobile = new Swiper('#gallery-top-3-mobile', {
252    spaceBetween: 10,
253    navigation: {
254        nextEl: '.swiper-button-next',
255        prevEl: '.swiper-button-prev',
256    },
257    thumbs: {
258        swiper: galleryThumbs_3_mobile
259    },
260    paginationClickable: false,
261    touchMoveStopPropagation: false,
262    simulateTouch: false,
263    allowSwipeToNext: true,
264    allowSwipeToPrev: true,
265    allowPageScroll: "auto ",
266    nextButton: '.swiper-button-next',
267    prevButton: '.swiper-button-prev',
268    touchRatio: 0,
269    slideToClickedSlide: true
270});
271// Swiper ends
272
273// Menu close when click outside starts
274$("body").click(function (event) {
275    var navigation = $(event.target).parents(".navbar").length;
276    if(!navigation) {
277        $(".navbar .navbar-collapse").collapse("hide");
278    }
279});
280// Menu close when click outside ends
281
282
283/** video handling (start) **/
284
285var video_group_1_arr = [
286  {video_tag_id: 'video_group_1_sample_1_video', sub_id_1:'video_group_1', sub_id_2: 'sample_1', is_playing: false, video_url: 'videos/crunch/breakthrough-left-1.mp4', poster_url: 'images/custom/breakthrough-left-1.png', title: '270p vs 1080p', is_mobile_video_url_assigned: false},
287  {video_tag_id: 'video_group_1_sample_2_video', sub_id_1:'video_group_1', sub_id_2: 'sample_2', is_playing: false, video_url: 'videos/crunch/breakthrough-left-2.mp4', poster_url: 'images/custom/breakthrough-left-2.png', title: '270p vs 1080p', is_mobile_video_url_assigned: false},
288  {video_tag_id: 'video_group_1_sample_3_video', sub_id_1:'video_group_1', sub_id_2: 'sample_3', is_playing: false, video_url: 'videos/crunch/breakthrough-left-3.mp4', poster_url: 'images/custom/breakthrough-left-3.png', title: '270p vs 1080p', is_mobile_video_url_assigned: false},
289  {video_tag_id: 'video_group_1_sample_4_video', sub_id_1:'video_group_1', sub_id_2: 'sample_4', is_playing: false, video_url: 'videos/crunch/breakthrough-left-4.mp4', poster_url: 'images/custom/breakthrough-left-4.png', title: '270p vs 1080p', is_mobile_video_url_assigned: false}
290];
291
292var video_group_2_arr = [
293  {video_tag_id: 'video_group_2_sample_1_video', sub_id_1:'video_group_2', sub_id_2: 'sample_1', is_playing: false, video_url: 'videos/crunch/breakthrough-right-1.mp4', poster_url: 'images/custom/breakthrough-right-1.png', title: 'Nvidia vs Crunch', is_mobile_video_url_assigned: false},
294  {video_tag_id: 'video_group_2_sample_2_video', sub_id_1:'video_group_2', sub_id_2: 'sample_2', is_playing: false, video_url: 'videos/crunch/breakthrough-right-2.mp4', poster_url: 'images/custom/breakthrough-right-2.png', title: 'Nvidia vs Crunch', is_mobile_video_url_assigned: false},
295  {video_tag_id: 'video_group_2_sample_3_video', sub_id_1:'video_group_2', sub_id_2: 'sample_3', is_playing: false, video_url: 'videos/crunch/breakthrough-right-3.mp4', poster_url: 'images/custom/breakthrough-right-3.png', title: 'Nvidia vs Crunch', is_mobile_video_url_assigned: false},
296  {video_tag_id: 'video_group_2_sample_4_video', sub_id_1:'video_group_2', sub_id_2: 'sample_4', is_playing: false, video_url: 'videos/crunch/breakthrough-right-4.mp4', poster_url: 'images/custom/breakthrough-right-4.png', title: 'Nvidia vs Crunch', is_mobile_video_url_assigned: false}
297];
298
299var video_group_3_arr = [
300  {video_tag_id: 'video_group_3_sample_1_video', sub_id_1:'video_group_3', sub_id_2: 'sample_1', is_playing: false, video_url: 'videos/whatsapp-crunch.mp4', poster_url: 'images/custom/whatsapp-crunch.png', title: ['WhatsApp bit rate: 1.7Mbps','Crunch bit rate: 0.95Mbps'], is_mobile_video_url_assigned: false},
301  {video_tag_id: 'video_group_3_sample_2_video', sub_id_1:'video_group_3', sub_id_2: 'sample_2', is_playing: false, video_url: 'videos/google-crunch.mp4', poster_url: 'images/custom/google-crunch.png', title: ['Google Photos bit rate: 7.3Mbps','Crunch bit rate: 3.65Mbps'], is_mobile_video_url_assigned: false}
302];
303
304function playButtonClicked(id1, id2, event_type) {
305
306  var video_group_arr = [];
307
308  switch (id1) {
309
310    case 'video_group_1':
311      video_group_arr = video_group_1_arr;
312    break;
313
314    case 'video_group_2':
315      video_group_arr = video_group_2_arr;
316    break;
317
318    case 'video_group_3':
319      video_group_arr = video_group_3_arr;
320    break;
321
322  }//end of switch (event_type)
323
324  var video_tag_id_to_play = id1 + "_" + id2 + "_video";
325
326  for(var i=0; i<video_group_arr.length; i++) {
327
328    console.log(video_group_arr[i].video_tag_id)
329    if(video_tag_id_to_play != video_group_arr[i].video_tag_id) {
330      document.getElementById(video_group_arr[i].video_tag_id).pause();
331      //document.getElementById(video_group_arr[i].video_tag_id).controls = 0;
332      document.getElementById(video_group_arr[i].video_tag_id+"_play_btn").style.display = "block";
333      video_group_arr[i].is_playing = false;
334    }//end of if(video_tag_id_to_play != video_group_arr[i].video_tag_id)
335  }//end of for(var i=0; i<video_group_arr.length; i++)
336
337
338  for(var i=0; i<video_group_arr.length; i++) {
339    if(video_tag_id_to_play == video_group_arr[i].video_tag_id) {
340      video_group_arr[i].is_playing = true;
341      if(video_group_arr[i].is_mobile_video_url_assigned == false) {
342        $("#div_"+video_tag_id_to_play).html('<video class="common-video-style" poster="'+video_group_arr[i].poster_url+'" width="100%" height="100%" id="'+video_tag_id_to_play+'" onpause="pauseButtonClicked(\''+id1+'\', \''+id2+'\', \'manually\')" onclick="videoTagClicked(\''+id1+'\', \''+id2+'\',\'manually\')" muted> <source src="'+video_group_arr[i].video_url+'" type="video/mp4"> </video>');
343        video_group_arr[i].is_mobile_video_url_assigned = true;
344      }
345    }//end of if(video_tag_id_to_play == video_group_arr[i].video_tag_id)
346  }//end of for(var i=0; i<video_group_arr.length; i++)
347  document.getElementById(video_tag_id_to_play+"_play_btn").style.display = "none";
348  document.getElementById(video_tag_id_to_play).play();
349  //document.getElementById(video_tag_id_to_play).controls = 1;
350
351
352  switch (id1) {
353
354    case 'video_group_1':
355      video_group_1_arr = video_group_arr;
356    break;
357
358    case 'video_group_2':
359      video_group_2_arr = video_group_arr;
360    break;
361
362    case 'video_group_3':
363      video_group_3_arr = video_group_arr;
364    break;
365
366  }//end of switch (event_type)
367
368}//emd of function playButtonClicked(id1, id2, event_type)
369
370function navigationTabClicked(id1, id2, event_type) {
371  console.log(id1, id2, event_type);
372  pauseAllPlayingVideos(id1, id2, event_type);
373  //playButtonClicked(id1, id2, 'programmatically');
374}//emd of function navigationTabClicked(id1, id2, event_type)
375
376function pauseButtonClicked(id1, id2, event_type) {
377  console.log("pause button clicked ", id1, id2, event_type);
378  var video_tag_id_to_handle = id1 + "_" + id2 + "_video";
379  //document.getElementById(video_tag_id_to_handle).controls = 0;
380  document.getElementById(video_tag_id_to_handle+"_play_btn").style.display = "block";
381  for(var i=0; i<video_group_1_arr.length; i++) {
382    if(video_tag_id_to_handle == video_group_1_arr[i].video_tag_id) {
383      video_group_1_arr[i].is_playing = false;
384    }//end of if(video_tag_id_to_handle == video_group_1_arr[i].video_tag_id)
385  }//end of for(var i=0; i<video_group_1_arr.length; i++)
386
387}//end of function pauseButtonClicked(id1, id2, event_type)
388
389function pauseAllPlayingVideos(id1, id2, event_type) {
390
391  var video_group_arr = [];
392
393  switch (id1) {
394
395    case 'video_group_1':
396      video_group_arr = video_group_1_arr;
397    break;
398
399    case 'video_group_2':
400      video_group_arr = video_group_2_arr;
401    break;
402
403    case 'video_group_3':
404      video_group_arr = video_group_3_arr;
405    break;
406
407  }//end of switch (event_type)
408
409  for(var i=0; i<video_group_arr.length; i++) {
410      document.getElementById(video_group_arr[i].video_tag_id).pause();
411      //document.getElementById(video_group_arr[i].video_tag_id).controls = 0;
412      document.getElementById(video_group_arr[i].video_tag_id+"_play_btn").style.display = "block";
413      video_group_arr[i].is_playing = false;
414  }//end of for(var i=0; i<video_group_arr.length; i++)
415
416  switch (id1) {
417
418    case 'video_group_1':
419      video_group_1_arr = video_group_arr;
420    break;
421
422    case 'video_group_2':
423      video_group_2_arr = video_group_arr;
424    break;
425
426    case 'video_group_3':
427      video_group_3_arr = video_group_arr;
428    break;
429
430  }//end of switch (event_type)
431
432}//end of function pauseAllPlayingVideos(id1, id2, event_type)
433
434function videoTagClicked(id1, id2, event_type) {
435  console.log("video tag clicked ", id1, id2, event_type);
436  var video_tag_id_to_handle = id1 + "_" + id2 + "_video";
437
438  var is_playing_status = false;
439
440  var video_group_arr = [];
441
442  switch (id1) {
443
444    case 'video_group_1':
445      video_group_arr = video_group_1_arr;
446    break;
447
448    case 'video_group_2':
449      video_group_arr = video_group_2_arr;
450    break;
451
452    case 'video_group_3':
453      video_group_arr = video_group_3_arr;
454    break;
455
456  }//end of switch (event_type)
457
458  for(var i=0; i<video_group_arr.length; i++) {
459    if(video_tag_id_to_handle == video_group_arr[i].video_tag_id) {
460      is_playing_status = video_group_arr[i].is_playing;
461    }//end of if(video_tag_id_to_handle == video_group_arr[i].video_tag_id)
462  }
462//end of for(var i=0; i<video_group_arr.length; i++)
463
464  switch (id1) {
465
466    case 'video_group_1':
467      video_group_1_arr = video_group_arr;
468    break;
469
470    case 'video_group_2':
471      video_group_2_arr = video_group_arr;
472    break;
473
474    case 'video_group_3':
475      video_group_3_arr = video_group_arr;
476    break;
477
478  }//end of switch (event_type)
479
480  if(is_playing_status == true) {
481    console.log("Video is playing");
482    document.getElementById(video_tag_id_to_handle).pause();
483    pauseButtonClicked(id1, id2, 'programmatically');
484  } else {
485    console.log("Video is not playing");
486  }
487
488}//end of function videoTagClicked(id1, id2, event_type)
489
490/** video handling (end) **/
491
492/*
493function jobHeaderClicked(id) {
494
495setTimeout(function(){
496
497document.getElementById("accordion1_down_arrow").style.display = "block";
498document.getElementById("accordion1_up_arrow").style.display = "none";
499document.getElementById("accordion2_down_arrow").style.display = "block";
500document.getElementById("accordion2_up_arrow").style.display = "none";
501document.getElementById("accordion3_down_arrow").style.display = "block";
502document.getElementById("accordion3_up_arrow").style.display = "none";
503document.getElementById("accordion4_down_arrow").style.display = "block";
504document.getElementById("accordion4_up_arrow").style.display = "none";
505
506if(document.getElementById("careersAccordion" + id).className == 'collapse show') {
507document.getElementById("accordion"+id+"_down_arrow").style.display = "none";
508document.getElementById("accordion"+id+"_up_arrow").style.display = "block";
509} else {
510document.getElementById("accordion"+id+"_down_arrow").style.display = "block";
511document.getElementById("accordion"+id+"_up_arrow").style.display = "none";
512}
513
514}, 400);
515
516}//end of function jobHeaderClicked()
517*/
518
519function playVideoInModel(id1, pos){
520  console.log('playVideoInModel'+pos)
521
522  var video_group_arr = [];
523
524  switch (id1) {
525
526      case 'video_group_1':
527          video_group_arr = video_group_1_arr;
528          break;
529
530      case 'video_group_2':
531          video_group_arr = video_group_2_arr;
532          break;
533
534      case 'video_group_3':
535          video_group_arr = video_group_3_arr;
536          break;
537
538  } //end of switch (event_type)
539
540  let video_html = '';
541  video_html += `<video class="common-video-style" poster="${video_group_arr[pos].poster_url}" width="100%" height="100%" muted autoplay playsinline loop>
542    <source src="${video_group_arr[pos].video_url}" type="video/mp4">
543  </video>`
544  if(id1 === 'video_group_3'){
545    video_html +=`<span class="opacity-title col-6 left-opacity-title text-center">${video_group_arr[pos].title[0]}</span>
546    <span class="opacity-title col-6 right-opacity-title text-center">${video_group_arr[pos].title[1]}</span>`
547  }else{
548    video_html +=`<span class="opacity-title both-side-radius">${video_group_arr[pos].title}</span>`
549  }
550  document.getElementById('video_content').innerHTML = video_html;
551
552  $("#videoModal").modal();
553}
554
555function closeModal(){
556
557  $('#videoModal').modal('hide');
558  document.getElementById('video_content').innerHTML = '';
559}
560
561function OpenBookADemoModal(){
562  document.getElementById('name').value = '';
563  document.getElementById('email').value = '';
564  document.getElementById('business_name').value = '';
565  document.getElementById('phone_number').value = '';
566  document.getElementById('show_name_error').innerHTML = '';
567  document.getElementById('show_email_error').innerHTML = '';
568  document.getElementById('BookADemoForm').style.display = 'block';
569  document.getElementById('BookADemoFormFooter').style.display = 'block';
570  document.getElementById('BookADemoThankYou').style.display = 'none';
571  $('#PartnersSolutionModal').modal('show');
572}
573
574function SubmitBookDemoDetails(){
575  let is_valid = validateFormDetails();
576  if(is_valid){
577    document.getElementById('BookADemoForm').style.display = 'none';
578    document.getElementById('BookADemoFormFooter').style.display = 'none';
579    document.getElementById('BookADemoThankYou').style.display = 'block';
580  }
581}
582
583function validateFormDetails(){
584  let name = document.getElementById('name').value;
585  let email = document.getElementById('email').value;
586  let business_name = document.getElementById('business_name').value;
587  let phone_number = document.getElementById('phone_number').value;
588  let valid = true;
589  if(name.trim() == '' || (typeof name == 'undefined')){
590    valid = false;
591    document.getElementById('show_name_error').innerHTML = 'This field is required.'
592  }else{
593    document.getElementById('show_name_error').innerHTML = '';
594  }
595  if(email.trim() == '' || (typeof email == 'undefined')){
596    valid = false;
597    document.getElementById('show_email_error').innerHTML = 'This field is required.'
598  }else if(!isValidEmail(email)){
599    valid = false;
600    document.getElementById('show_email_error').innerHTML = 'Please enter a valid email address.'
601  }else{
602    document.getElementById('show_email_error').innerHTML = '';
603  }
604  return valid;
605}
606
607function isValidEmail(email) {
608  const RegExp = /^((([a-z]|[0-9]|!|#|$|%|&|'|\*|\+|\-|\/|=|\?|\^|_|`|\{|\||\}|~)+(\.([a-z]|[0-9]|!|#|$|%|&|'|\*|\+|\-|\/|=|\?|\^|_|`|\{|\||\}|~)+)*)@((((([a-z]|[0-9])([a-z]|[0-9]|\-){0,61}([a-z]|[0-9])\.))*([a-z]|[0-9])([a-z]|[0-9]|\-){0,61}([a-z]|[0-9])\.)[\w]{2,4}|(((([0-9]){1,3}\.){3}([0-9]){1,3}))|(\[((([0-9]){1,3}\.){3}([0-9]){1,3})\])))$/;
609  if (RegExp.test(email)) {
610    return true;
611  } else {
612    return false;
613  }
614}// end of isValidEmail(email)

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.