PageSourceSearch

https://ifgtbenvis.in/sites/all/themes/mygov/js/framework97ec.js?smy0bz

js ifgtbenvis.in collected 2026-10-08 13:48:04 UTC 145,460 bytes, 4,416 lines download raw bytes

1
2/*
3 1. Tabs
4 2. flexslider
5 */
6// Verhoeff algorithm validator
7String.prototype.verhoeffCheck = (function () {
8	var d = [[0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
9	[1, 2, 3, 4, 0, 6, 7, 8, 9, 5], [2, 3, 4, 0, 1, 7, 8, 9, 5, 6],
10	[3, 4, 0, 1, 2, 8, 9, 5, 6, 7], [4, 0, 1, 2, 3, 9, 5, 6, 7, 8],
11	[5, 9, 8, 7, 6, 0, 4, 3, 2, 1], [6, 5, 9, 8, 7, 1, 0, 4, 3, 2],
12	[7, 6, 5, 9, 8, 2, 1, 0, 4, 3], [8, 7, 6, 5, 9, 3, 2, 1, 0, 4],
13	[9, 8, 7, 6, 5, 4, 3, 2, 1, 0]];
14	var p = [[0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
15	[1, 5, 7, 6, 2, 8, 3, 0, 9, 4], [5, 8, 0, 3, 7, 9, 6, 1, 4, 2],
16	[8, 9, 1, 6, 0, 4, 3, 5, 2, 7], [9, 4, 5, 3, 1, 2, 6, 8, 7, 0],
17	[4, 2, 8, 6, 5, 7, 3, 9, 0, 1], [2, 7, 9, 3, 8, 0, 6, 4, 1, 5],
18	[7, 0, 4, 6, 9, 1, 3, 2, 5, 8]];
19	var j = [0, 4, 3, 2, 1, 5, 6, 7, 8, 9];
20
21	return function () {
22		var c = 0;
23		this.replace(/\D+/g, "").split("").reverse().join("").replace(/[\d]/g,
24			function (u, i, o) {
25				c = d[c][p[i & 7][parseInt(u, 10)]];
26			});
27		return (c === 0);
28	};
29})();
30
31
32jQuery(document).ready(function () {
33	var isFirefox = typeof InstallTrigger !== 'undefined';
34    if(isFirefox){
35        jQuery('#search_by_voice').hide();
36    }
37	jQuery('.tab-block-content:first-child').show();
38	jQuery('.tab-link a').click(function(e){
39		e.preventDefault();
40		jQuery('.tab-link').removeClass('active');
41		jQuery(this).parent('.tab-link').addClass('active');
42		var targetBtn = jQuery(this).attr('rel');
43		jQuery('.tab-block-content').hide();
44		jQuery('.'+targetBtn).show();
45
46		var targetPoint = jQuery('#involved-block');
47		
48		jQuery('html, body').animate({
49			scrollTop: jQuery(targetPoint).offset().top - jQuery('.top_wrapper').height() +5
50		})
51		if(jQuery(window).width() < 959){
52          jQuery(".get-involved-links").scrollCenter(".active", 300);
53		}
54	 })
55
56	 jQuery.fn.scrollCenter = function(elem, speed) {
57
58		// this = #timepicker
59		// elem = .active
60	  
61		var active = jQuery(this).find(elem); // find the active element
62		//var activeWidth = active.width(); // get active width
63		var activeWidth = active.width() / 2; // get active width center
64	  
65		//alert(activeWidth)
66	  
67		//var pos = jQuery('#timepicker .active').position().left; //get left position of active li
68		// var pos = jQuery(elem).position().left; //get left position of active li
69		//var pos = jQuery(this).find(elem).position().left; //get left position of active li
70		var pos = active.position().left + activeWidth; //get left position of active li + center position
71		var elpos = jQuery(this).scrollLeft(); // get current scroll position
72		var elW = jQuery(this).width(); //get div width
73		//var divwidth = jQuery(elem).width(); //get div width
74		pos = pos + elpos - elW / 2; // for center position if you want adjust then change this
75	  
76		jQuery(this).animate({
77		  scrollLeft: pos
78		}, speed == undefined ? 1000 : speed);
79		return this;
80	  };
81	 
82	
83	
84	// gigw keyboard show detail
85	jQuery(".comment_toggle_wrapper a").on('keyup', function(e) { 
86		var keyCode = e.keyCode || e.which; 
87
88		if (keyCode == 9) { 
89		  jQuery(this).trigger('click');
90		} 
91	  });
92	if(jQuery( "body" ).hasClass( "vaccination_tblock" )){
93		vaccineCounter();
94	}
95
96  // gigw keyboard show detail
97	jQuery("#see_details .expand").on('keyup', function(e) { 
98		var keyCode = e.keyCode || e.which; 
99
100		if (keyCode == 9) { 
101		  jQuery(this).trigger('click');
102		} 
103	  });
104	//keyboard group change						
105	  jQuery("#group_switch_btn").on('keyup', function(e) { 
106		var keyCode = e.keyCode || e.which; 
107
108		if (keyCode == 9) { 
109		  jQuery(this).trigger('click');
110		} 
111	  });
112
113	  //gigw keyboard Close group list//
114	  jQuery('#groups_list li:last-child').keydown(function(e) {
115		var code = e.keyCode || e.which;
116	
117		if (code === 9) {  
118			jQuery("#group_switch_btn").trigger('click');
119		}
120	   });
121
122	 // gigw keyboard show meghamnu and accessibility btn//
123	 jQuery(".res_menu").on('keyup', function(e) { 
124		var keyCode = e.keyCode || e.which; 
125
126		if (keyCode == 9) { 
127		  jQuery( ".flyout-menu-wrapper" ).show().focus();
128		} 
129	  });
130  //gigw keyboard Close Megamenu//
131   jQuery('.mygov-apps-inner li:last-child').keydown(function(e) {
132	var code = e.keyCode || e.which;
133
134	if (code === 9) {  
135		jQuery('.flyout-menu-wrapper').hide();
136	}
137   });
138   jQuery('.c-accordian h3').on('keydown', function(e) { 
139	var keyCode = e.keyCode || e.which; 
140
141	if (keyCode == 9) { 
142		jQuery(this).trigger('click');
143		
144	} 
145  });
146	//   jQuery('.ac_title2 a.plus_icon,.ac_title1 a.plus_icon').on('keydown', function(e) { 
147	// 	var keyCode = e.keyCode || e.which; 
148
149	// 	if (keyCode == 9) { 
150	// 		jQuery(this).trigger('click');
151			
152	// 	} 
153	//   }); 
154
155	// Toogle Lang list Btns
156	jQuery('.wpLan').click(function(){
157		jQuery('.mygov-lang-menu').slideToggle();
158	})
159
160    jQuery(".lang-switcher-block").on('keydown', '.wpLan', function(e) { 
161		var keyCode1 = e.keyCode || e.which; 
162
163		if (keyCode1 == 9) { 
164		  jQuery( ".mygov-lang-menu" ).show().focus();
165		} 
166	  });
167
168	    //hide language list on keyboard focusout//
169		jQuery('.language-switcher-locale-url li:last a').keydown(function(e) {
170			var code1 = e.keyCode || e.which;
171		
172			if (code1 === 9) {  
173				jQuery('.mygov-lang-menu').hide();
174			}
175		   });
176
177		// close Accessibility btns outside click
178		jQuery(document).mouseup(function (e) {
179			var lang_box = jQuery('.lang-switcher-block');
180			if (!lang_box.is(e.target) && lang_box.has(e.target).length === 0) {
181				jQuery('.mygov-lang-menu').fadeOut();
182			}
183		});
184
185	  jQuery(".user_accessibility").on('keydown', '.access_icon', function(e) { 
186		var keyCode1 = e.keyCode || e.which; 
187
188		if (keyCode1 == 9) { 
189		  jQuery( ".access-type" ).show().focus();
190		} 
191	  });
192
193	
194	  
195	  //hide accessibility btn on keyboard focusout//
196	  jQuery('.tool-item:last a').keydown(function(e) {
197	var code1 = e.keyCode || e.which;
198
199	if (code1 === 9) {  
200		jQuery('.access-type').hide();
201	}
202   });
203
204	 
205  //Show  Notificationlist on keyboard focus//
206   jQuery(".header-push-notification").on('keydown', '> a', function(e) { 
207		var keyCode1 = e.keyCode || e.which; 
208
209		if (keyCode1 == 9) { 
210		  jQuery('.header-push-notification').addClass('show');
211		  jQuery(".notification-container").show().focus();
212		} 
213	  });
214	  
215 //hide  Notificationlist on keyboard focusout//
216   jQuery('.push_notification_list li:last-child a').keydown(function(e) {
217	var code2 = e.keyCode || e.which;
218
219	if (code2 === 9) {  
220		 jQuery('.header-push-notification').removeClass('show');
221		  jQuery(".notification-container").hide();
222	}
223   });
224
225
226   //hide  Search on keyboard focusout//
227   jQuery('#search_link_btn').keydown(function(e) {
228	var code2 = e.keyCode || e.which;
229
230	if (code2 === 9) {  
231		jQuery( ".search_mygov_box" ).removeClass('active_search');
232		jQuery( "body" ).removeClass('search-open');
233	}
234   });
235   
236    jQuery(".search_mygov_box").on('keyup', '.search_toggle', function(e) { 
237		var keyCode = e.keyCode || e.which; 
238
239		if (keyCode == 9) { 
240		  jQuery( ".search_mygov_box" ).addClass('active_search');
241		  jQuery("#search_title").focus();
242		  jQuery('body').addClass('search-open');
243		} 
244	  });
245//show  Login on focus //
246	  jQuery(".login-reg-block").on('keyup', '.login-reg-icon', function(e) { 
247		let keyCode = e.keyCode || e.which; 
248
249		if (keyCode == 9) { 
250		  jQuery( ".login-reg-block" ).addClass('open');
251		} 
252	});
253//hide  Login on click outside //
254	jQuery(document).click(function (e) {
255		if (!jQuery(e.target).hasClass(".login-reg-icon") && jQuery(e.target).parents(".login-reg-block").length === 0) {
256			jQuery('.login-reg-block').removeClass('open');
257		}
258	});
259
260	//hide  Login on keyboard focusout//
261	jQuery('.ac-register').keydown(function(e) {
262		let code2 = e.keyCode || e.which;
263	
264		if (code2 === 9) {  
265			jQuery('.login-reg-block').removeClass('open');
266		}
267	   });
268
269
270	//show  Header share on focus //
271	jQuery(".site_share").on('keyup', '.share_icon', function(e) { 
272		let keyCode = e.keyCode || e.which; 
273
274		if (keyCode == 9) { 
275		  jQuery( ".site_share" ).addClass('open');
276		} 
277	});
278   //hide  Header share on click outside //
279	jQuery(document).click(function (e) {
280		if (!jQuery(e.target).hasClass(".site_share") && jQuery(e.target).parents(".site_share").length === 0) {
281			jQuery('.site_share').removeClass('open');
282		}
283	});
284
285	//hide  Header share on keyboard focusout//
286	jQuery('.share-list .social-area:last a').keydown(function(e) {
287		let code2 = e.keyCode || e.which;
288	
289		if (code2 === 9) {  
290			jQuery('.site_share').removeClass('open');
291		}
292	   });
293	  
294	//show latest Notification at covid page by keyboard
295	  jQuery(".notification-btn").on('keydown', function(e) { 
296		var keyCode = e.keyCode || e.which; 
297
298		if (keyCode == 9) { 
299		  jQuery('.ln-block').show().focus();
300		} 
301	  });
302	  
303	  //Hide latest Notification at covid page by keyboard
304   jQuery('.ln-block > a').keydown(function(e) {
305	var code = e.keyCode || e.which;
306
307	if (code === 9) {  
308		 jQuery('.ln-block').hide();
309	}
310   });
311   
312   //show social share at covid page by keyboard
313	  jQuery(".share_corona_page .share-icon").on('keydown', function(e) { 
314		var keyCode = e.keyCode || e.which; 
315
316		if (keyCode == 9) { 
317		  jQuery('.share_corona_page .mshare-list').show().focus();
318		} 
319	  });
320	  
321 //Hide social share at covid page by keyboard
322   jQuery('.mshare-list .fb-icon').keydown(function(e) {
323	var code = e.keyCode || e.which;
324
325	if (code === 9) {  
326		 jQuery('.share_corona_page .mshare-list').hide();
327	}
328   });
329   //show Sticky Menu at covid page by keyboard
330	  jQuery(".sticky-menu-btn").on('keydown', function(e) { 
331		var keyCode = e.keyCode || e.which; 
332
333		if (keyCode == 9) { 
334		  jQuery('.covid-menus').addClass('extend').focus();
335		} 
336	  });
337	  
338  //Hide Sticky Menu at covid page by keyboard
339   jQuery('.covid-menus li:last-child a').keydown(function(e) {
340	var code = e.keyCode || e.which;
341
342	if (code === 9) {  
343		 jQuery('.covid-menus').removeClass('extend');
344	}
345   });
346  //show Activities in this group by keyboard
347  jQuery(".group_stats > a").on('keydown', function(e) { 
348	var keyCode = e.keyCode || e.which; 
349
350	if (keyCode == 9) { 
351		jQuery(this).parents('.group_stats').find('.group_info_wrap').show().focus();
352		jQuery(this).parents('.group_stats').addClass('show');
353	} 
354  });
355  //Hide Activities in this group by keyboard
356  jQuery('.group_info_wrap .view-status:last-child a').keydown(function(e) {
357	var code = e.keyCode || e.which;
358
359	if (code === 9) {  
360		jQuery(this).parents('.group_stats').find('.group_info_wrap').hide();
361		jQuery(this).parents('.group_stats').removeClass('show');
362	}
363   });
364	//    jQuery('.group_stats > a').off("click").on('click', function (event) {
365	// 	event.preventDefault();
366	// 	jQuery(this).parents('.group_stats').find('.group_info_wrap').slideToggle();
367	// 	jQuery(this).parents('.group_stats').toggleClass('show');
368	// })
369   
370
371   // close Accessibility btns outside click
372	jQuery(document).mouseup(function (e) {
373		var access_box = jQuery('.user_accessibility');
374		if (!access_box.is(e.target) && access_box.has(e.target).length === 0) {
375			jQuery('.access-type').fadeOut();
376			
377		}
378	});
379
380	
381	jQuery(".share_btn").on('keyup', function(e) { 
382		var keyCode = e.keyCode || e.which; 
383
384		if (keyCode == 9) { 
385			jQuery(this).next(".share_links").show();
386		} 
387	  }); 
388
389
390 // Toogle Accessibility Btns
391	jQuery('.access_icon').click(function(){
392		jQuery('.access-type').toggle()
393		jQuery('.user_accessibility').toggleClass('expand');
394	})
395	jQuery('.close-accessbility').click(function(){
396		jQuery('.access_icon').trigger('click');
397	})	
398	if (jQuery('.update_block').length > 0) {
399		jQuery('#content').removeClass('container').addClass('covid');
400		jQuery('#page-title').wrap('<div class="container" />')
401	}
402	
403	if (jQuery('.comment-top .comment_toggle_wrapper').length < 1) {
404		jQuery('.comment-top').hide();
405	}
406	jQuery('#sector_select').selectric({
407		inheritOriginalWidth: true
408	});
409	jQuery('.sort_by_link_wrapper').selectric();
410  //campaign page main tab  and inner common tabbing
411
412 jQuery('.info-tab a').not(".outerlink").click(function(e){
413	e.preventDefault();
414	jQuery('.ctab').hide();
415	jQuery('.info-tab a').removeClass('active');
416	jQuery(this).addClass('active');
417	var targetBtn = jQuery(this).attr('href');
418	jQuery('.info_block').hide()
419	jQuery(targetBtn).show();
420 })
421 jQuery( ".info-tab li:nth-child(2) a" ).click(function(e){
422
423	if(!jQuery("#info-2 div").hasClass("state-covid-advisory")){
424		
425		state_advisory();
426		/*
427		var curUrl = window.location.href;
428		var curUrlArray = curUrl.split("/");
429		if(curUrlArray[3] == 'hi'){
430			var gatData = "/hi/vaccine-state-advisory";
431		}else{
432			var gatData = "/vaccine-state-advisory";
433		}
434    jQuery("#info-2 img.loader").show();
435		jQuery.ajax({
436        type: 'GET',
437        url: gatData,
438        dataType: 'text',
439        success: function(response) { 
440           jQuery(".stade_advisory").html(response);
441           jQuery("#info-2 img.loader").hide();           
442        },
443        error: function() {
444        	jQuery("#info-2 img.loader").hide();
445        },
446        complete: function() {
447        	jQuery("#info-2 img.loader").hide();
448        }
449    });*/
450	}
451	
452	
453});
454jQuery("#edit-submit-covid-states-advisory2" ).click(function(e){
455		//var gatData = "/vaccine-state-advisory?title="+jQuery("#edit-title").val()+"&states="+jQuery("#edit-field-advisory-states-value").val()+"&category="+jQuery("#edit-field-advisory-category-tid").val();
456		/*var gatData = "https://api.mygov.in/covid-advisory/?api_key=57076294a5e2ab7fe000000112c9e964291444e07dc276e0bca2e54b";
457		alert("ok");
458		jQuery(".stade_advisory").html('');
459    jQuery("img.loader").show();
460		jQuery.ajax({
461        type: 'GET',
462        url: gatData,
463        dataType: 'text',
464        success: function(response) { 
465           jQuery(".stade_advisory").html(response);
466           jQuery("img.loader").hide();
467        },
468        error: function() {
469        	jQuery("img.loader").hide();
470        },
471        complete: function() {
472        	jQuery("img.loader").hide();
473        }
474    });
475	*/
476	state_advisory();
477	
478	
479});
480
481
482//Language switcher popup
483jQuery('.language-link').click(function(e) {
484	if(jQuery(this).attr("lang")== "hi"){
485 	 return confirm("You Are Redirecting to MyGov Hindi Language Portal.");
486	}
487	if(jQuery(this).attr("lang")== "en"){
488 	return confirm("आप MyGov अंग्रेजी भाषा पोर्टल पर रीडायरेक्ट कर रहे हैं।");
489	}
490})
491
492//Advisary page
493if(jQuery('.advisory-tab').length > 0){
494	jQuery('.advisory-tab .tabs li:first a').addClass('active');
495jQuery('.advisory-tab .tabs li:first a').click(function(e){
496	e.preventDefault();
497	jQuery(this).addClass('active');
498	jQuery('.advisory-tab .tabs li:last a').removeClass('active');
499	jQuery('.advisory-list .tab2').hide();
500	jQuery('.advisory-list .tab1').show();
501})
502jQuery('.advisory-tab .tabs li:last a').click(function(e){
503	e.preventDefault();
504	jQuery(this).addClass('active');
505	jQuery('.advisory-tab .tabs li:first a').removeClass('active');
506	jQuery('.advisory-list .tab1').hide();
507	jQuery('.advisory-list .tab2').show();
508})
509}
510
511jQuery('.tool-name i').click(function(){
512	jQuery(this).parent('.tool-name').next('.tool-item').toggle();
513	jQuery(this).parent('.tool-name').toggleClass('collapse');
514})
515
516// Footer activity list for mobile
517if(jQuery(window).width() < 768){
518	jQuery('.ft-label').click(function(){
519		jQuery(this).next('.block-menu').slideToggle();
520		jQuery(this).toggleClass('open');
521	})
522	jQuery('.mygov-app').click(function(){
523		jQuery(this).next('.footer-mygov-app-wrapper').slideToggle();
524		jQuery(this).toggleClass('open');
525    })
526
527	//hide  navigation menu of home page on click outside //
528	jQuery(document).click(function (e) {
529		if (!jQuery(e.target).hasClass(".menu-items li a") && jQuery(e.target).parents(".circular-menu").length === 0 && jQuery('#circular-menu').is(":checked")) {
530			jQuery('.circular-menu__icon').trigger('click');
531		}
532	});
533}
534// Tab at covid page notification section
535jQuery(function() {	
536
537	jQuery('.ctab a').click(function () {
538		
539	$this = jQuery(this);
540     
541	  var $target = jQuery(this).attr('href');
542	    $this.parent().siblings().removeClass('active');
543	    $this.parent().addClass('active')
544		dropdownText = $this.text();
545		$this.parents('.info_header').find('.dropdown-text').text(dropdownText);
546		$this.parents('.info_block').find('.tab-content').hide();
547		jQuery($target).show();
548		
549		$this.parents('.ctab').hide();
550	
551		return false;
552	});
553	jQuery('.ctab li:first-child a').trigger('click');
554	
555	jQuery('.dropdown-text').click(function(){
556	  	jQuery(this).parents('.info_header').find('.ctab').slideToggle();
557	})
558	
559	jQuery('.mobile_language').text(jQuery('li span.actv').text());
560	jQuery('.mobile_language').click(function(){
561	  	jQuery('#lang').slideToggle();
562	})
563})
564
565//covid-19 Compaign page infographics slider for each tab
566
567	jQuery('.islider').each(function(){
568	  //jQuery(this).addClass('owl-carousel');
569	 var owl = jQuery(this).owlCarousel({
570		  loop:false,
571		  dots:false,
572		  nav:true,
573		  margin:15,
574		  responsiveClass:true,
575		  navText : ["Previous","Next"],
576		  responsive:{
577			0:{
578				items: 1
579			},
580			569:{
581				items:2
582			},
583			768:{
584				items:3
585			}
586		 }
587		  
588	  });
589	  owl.on('changed.owl.carousel', function(event) { 
590		jQuery('.view-all-items').parents('.owl-item').addClass('btn_wrap');
591	})
592
593	})
594
595	jQuery('.view-social-block,.menu-items li a').click(function(e){
596		e.preventDefault();
597	
598		var target1 = this.hash;
599		var pos1 = jQuery(target1).offset().top;
600		jQuery('html, body').animate({
601			scrollTop: pos1 - jQuery('.top_wrapper').height() +5
602		})
603		
604	})
605	
606	/*Covid menu click page scroll*/
607	
608	 if(jQuery('.covid-menus').length > 0 ){
609	jQuery('.covid_menu_list a').not('.out').click(function(e){
610		e.preventDefault();
611		var trigger = jQuery(this);
612		//jQuery('.covid_menu_list a').removeClass('active');
613		//trigger.addClass('active');
614		
615		var target = this.hash;
616		var pos = jQuery(target).offset().top;
617		jQuery('html, body').animate({
618			scrollTop: pos - jQuery('.top_wrapper').height() +5
619		});	
620		//jQuery('.covid_menu_list').hide();
621		
622	})
623	// covid dashboard block link click page scroll at target block
624	jQuery('.state_btn,.state_link').click(function(e){
625		e.preventDefault();
626		var trigger = jQuery(this);
627		var target = this.hash;
628		var pos = jQuery(target).offset().top;
629		jQuery('html, body').animate({
630			scrollTop: pos - jQuery('.top_wrapper').height() +5
631		});	
632		
633	})
634
635
636 /* jQuery(document).on("scroll", function(event){
637	  jQuery('.covid_menu_list a').each(function() {
638		// console.log('555')
639	  event.preventDefault();
640      var currLink = jQuery(this);
641	 
642      var scrollPos = jQuery(document).scrollTop();
643      var refElement = jQuery(currLink.attr("href"));
644	 // console.log(refElement);
645        if (refElement.offset().top - jQuery('.top_wrapper').height() <= scrollPos) {
646            jQuery('.covid_menu_list a').removeClass("active");
647            currLink.addClass("active");
648         } else {
649            currLink.removeClass("active");
650          }
651      });
652	  
653	  });*/
654}
655
656 if(jQuery('.ncc_wrapper').length > 0 ){
657	jQuery('.readmore-btn a').click(function(e){
658		e.preventDefault();
659		var trigger = jQuery(this);
660		var target = this.hash;
661		var pos = jQuery(target).offset().top;
662		jQuery('html, body').animate({
663			scrollTop: pos - jQuery('.top_wrapper').height() +5
664		});	
665		
666		
667	})
668 }
669	
670	
671	
672	
673	
674jQuery('.showon').show()
675jQuery('.infographics_links a').not(".t_video").click(function(e){
676	e.preventDefault();
677	
678	jQuery('.infographics_links a').removeClass('active');
679	jQuery(this).addClass('active');
680	var targetBtn = jQuery(this).attr('href');
681	jQuery('.infog_area').hide()
682	jQuery(targetBtn).show();
683})
684if(jQuery('.gallery-link').length > 0 ){
685jQuery('.gallery-link a').click(function(e){
686	e.preventDefault();
687	
688	jQuery('.gallery-link a').removeClass('active');
689	jQuery(this).addClass('active');
690	var targetBtn = jQuery(this).attr('href');
691	jQuery('.gallery-area').hide()
692	jQuery(targetBtn).show();
693})
694}
695
696  //covid-19 Compaign page contact slider for mobile
697	 jQuery('.social_list').owlCarousel({
698      loop:true,
699	  dots:true,
700	  nav:true,
701      margin:15,
702      responsiveClass:true,
703	  dotsData: true,
704	  navText : ["Previous","Next"],
705      responsive:{
706          0:{
707              items: 1
708          },
709		  569:{
710              items: 2
711          },
712		  768:{
713		     items:3
714	      },
715		   1023:{
716		     items:4
717	      },
718		  1200:{
719		     items:5
720	      }
721		 }
722	  });
723	
724	
725	
726	if(jQuery('.camp-slider').length > 0){
727		jQuery('.camp-slider').owlCarousel({
728		  loop:true,
729		  autoplay:true,
730		  dots:false,
731		  nav:true,
732		  margin:0,
733		  responsiveClass:true,
734		  responsive:{
735			  0:{
736				  items: 1
737			  }
738			 }
739		  });
740	  }  
741	  
742	  //Arch Compaign page slider
743	if (jQuery('.arc-slider').length > 0) {  
744	 jQuery('.arc-slider').owlCarousel({
745		  loop:false,
746		  dots:false,
747		  nav:true,
748		  margin:100,
749		  responsiveClass:true,
750		 responsive:{
751          0:{
752              items: 1,
753			   margin:0
754          },
755		  569:{
756		     items:2,
757			  margin:15
758			 
759	      },
760		  768:{
761		     items:3,
762			 margin:30
763	      },
764		  1024:{
765		     margin:100
766	      }
767		 }
768		  
769	  });
770	  
771	}
772	
773	if(jQuery('.mslider').length > 0){
774  jQuery('.mslider').owlCarousel({
775		  loop:false,
776		  dots:false,
777		  nav:true,
778		  margin:15,
779		  responsiveClass:true,
780		  navText : ["Previous","Next"],
781		  responsive:{
782          0:{
783              items: 1,
784			  slideBy: 1
785          },
786		  569:{
787		     items:2,
788			 slideBy: 2
789	      },
790		  768:{
791		     items:3,
792			 slideBy: 3
793	      }
794		 }
795		  
796	  })
797}
798	
799	 // Podcast section slider for covid page
800     if(jQuery('.podcast-slider').length > 0){
801		  jQuery('.podcast-slider').owlCarousel({
802		  loop:true,
803		   dots:true,
804		  margin:10,
805		  dotsData: true,
806		  responsiveClass:true,
807		  responsive:{
808			  0:{
809				  items: 1
810			  }
811		  }
812	  });
813	 }
814	  
815	 
816	
817	//covid page slider for mobile
818	 if(jQuery(window).width() < 768){
819	 jQuery('.help_slider,.card-columns').owlCarousel({
820      loop:true,
821	  dots:true,
822      margin:10,
823      responsiveClass:true,
824      responsive:{
825          0:{
826              items: 1
827          },
828	  500:{
829		     items:2
830	      }
831		  }
832	  });
833	  
834	 jQuery('.arogya_bhav').owlCarousel({
835      loop:true,
836	  dots:true,
837      margin:10,
838      responsiveClass:true,
839      responsive:{
840          0:{
841              items: 1
842          },
843	  500:{
844		     items:2
845	      }
846		 }
847	  });
848	  
849	  jQuery('.event-block').each(function(){
850		  jQuery(this).owlCarousel({
851		  loop:true,
852		   dots:true,
853		  margin:10,
854		  responsiveClass:true,
855		  responsive:{
856			  0:{
857				  items: 1
858			  },
859			  567:{
860				  items: 2
861			  }
862		  }
863	  });
864	  
865	  })
866	  
867	 	  
868	}
869	
870	// if(jQuery('#block-views-media-block-1 .view-media').length > 0){
871	// 	jQuery('#block-views-media-block-1 .view-media .view-content').addClass('owl-carousel');
872	// 	jQuery('#block-views-media-block-1 .view-media .view-content').owlCarousel({
873	// 	  loop:false,
874	// 	  autoplay:false,
875	// 	  dots:false,
876	// 	  nav:true,
877	// 	  margin:0,
878	// 	  responsiveClass:true,
879	// 	  responsive:{
880	// 		  0:{
881	// 			  items: 1
882	// 		  }
883	// 		 }
884	// 	  });
885	//   }  
886
887 // slider for state-wise corona data
888 if (jQuery('.statewise_title').length > 0) {
889	jQuery('.ac_title1').click(function(){
890	   jQuery(this).toggleClass('on');
891	   jQuery('.ac-block1').slideToggle('fast');	
892		
893	 })
894		 
895	jQuery('.latest_notify > a').click(function(){
896	   jQuery('.ln-block').toggle();	
897	 })
898	// close covid lATEST NOTIFICATION on click outside
899	jQuery(document).mouseup(function (e) {
900		var ntl = jQuery('.latest_notify')
901		if (!ntl.is(e.target) && ntl.has(e.target).length === 0) {
902			jQuery(".ln-block").fadeOut();
903			
904		}
905	});
906	
907	if(jQuery(window).width()< 600	){
908		if(jQuery('.covid-data_hi').length){
909			jQuery('.covid-data_hi th').not(':first').each(function () {
910			 jQuery(this).text(jQuery(this).text().substring(0, 3))
911		  })
912		  jQuery('.covid-data_hi th:first').each(function () {
913			 jQuery(this).text(jQuery(this).text().substring(0, 5))
914		  })	
915		}
916		else{
917		  jQuery('#state-covid-data th').not(':first').each(function () {
918			 jQuery(this).text(jQuery(this).text().substring(0, 1))
919		  })
920	   }
921	  
922   }
923	  
924	  
925 	 }
926
927 	 // slide Toogle for state-wise vaccine data
928 	if (jQuery('.statewise_vaccine').length > 0) {
929		jQuery('.statewise_vaccine').click(function(){
930		   jQuery(this).toggleClass('on');
931		   jQuery('.state_vaccine_record').slideToggle('fast');	
932			
933		 })
934
935 	}
936	 // slide Toogle for vaccine centers 
937 	if (jQuery('.center-api-list').length > 0) {
938		jQuery('.center-api-list > a').click(function(){
939		   jQuery('.center-api-list').toggleClass('on');
940		   jQuery('.vaccination_centers_list').slideToggle('fast');	
941			
942		 })
943
944 	}
945	//Explore FAQs PDF in language
946	if (jQuery('.faq-pdf').length > 0) {
947		jQuery('.faq-pdf').click(function(){
948		   jQuery('.vac-faq-list').slideToggle('fast');	
949			
950		 })
951
952 	}
953	
954	// get cowin certificate status 
955	if (jQuery('.get_cert-status').length > 0) {
956		jQuery('.get_cert-status').click(function(e){
957			e.preventDefault();
958		   jQuery('.vaccine-status-block').slideToggle('fast');	
959			
960		 })
961
962 	}
963
964// Notificaion and advisary block slider wrap items 10 for desktop and 2 for mobile	
965	
966	jQuery('.tslider').each(function(){
967	var $pArr = jQuery(this).find('.stg_item');
968	var pArrLen = $pArr.length;
969  if(jQuery(window).width() > 767){
970    var pPerDiv = 10;
971	for (var i = 0;i < pArrLen;i+=pPerDiv){
972		$pArr.filter(':eq('+i+'),:lt('+(i+pPerDiv)+'):gt('+i+')').wrapAll('<div class="state_book" />');
973	}
974	jQuery(this).addClass('owl-carousel');
975	  jQuery(this).owlCarousel({
976		  loop:false,
977		  nav:true,
978		  margin:10,
979		  responsiveClass:true,
980		  responsive:{
981			  0:{
982				  items: 1
983			  }
984		  }
985		  
986	  });
987  }
988  else{
989    var pPerDiv = 2;
990	for (var i = 0;i < pArrLen;i+=pPerDiv){
991		$pArr.filter(':eq('+i+'),:lt('+(i+pPerDiv)+'):gt('+i+')').wrapAll('<div class="state_book" />');
992	}
993	jQuery(this).addClass('owl-carousel');
994	  jQuery(this).owlCarousel({
995		  loop:false,
996		  nav:true,
997		  margin:10,
998		  responsiveClass:true,
999		  responsive:{
1000			  0:{
1001				  items: 1
1002			  }
1003		  }
1004		  
1005	  });	  
1006	  }
1007	})
1008
1009	
1010
1011	// Tabs ====
1012	jQuery('#tabs div.tab-content').hide();
1013	jQuery('#tabs div.tab-content:first').show();
1014	jQuery('#tabs ul li:first').addClass('active');
1015
1016	jQuery('#tabs ul li a').click(function () {
1017		jQuery('#tabs ul li').removeClass('active');
1018		jQuery(this).parent().addClass('active');
1019		var currentTab = jQuery(this).attr('href');
1020		jQuery('#tabs div.tab-content').hide();
1021		jQuery(currentTab).show();
1022		return false;
1023	});
1024// covid page myths model
1025	jQuery('.fact_btn').click(function(e){
1026		e.stopPropagation();
1027		jQuery('.overlay').show();
1028		 jQuery('#myth_model').fadeIn();
1029		
1030	})
1031	jQuery('.closePop').click(function(){
1032		jQuery('.overlay').hide();
1033		 jQuery('#myth_model').fadeOut();
1034	})
1035	//hide it when clicking anywhere else except the popup
1036	jQuery(document).click(function(event) {
1037	  //if you click on anything except the modal itself or the "open modal" link, close the modal
1038	  if (!jQuery(event.target).closest("#myth_model,.fact_btn,.popup-form-wrapper").length) {
1039		jQuery('.overlay,#myth_model,.popup-form-wrapper').hide();
1040	  }
1041	});
1042	 jQuery(document).keydown(function(event) { 
1043	  if (event.keyCode == 27) { 
1044		jQuery('.overlay,#myth_model,.popup-form-wrapper').hide();
1045	  }
1046	})
1047	
1048	//Home page user profile popup
1049	jQuery(document).click(function(event) {
1050	  //if you click on anything except the modal itself or the "open modal" link, close the modal
1051	  if (!jQuery(event.target).closest(".popup-form-wrapper").length) {
1052		jQuery('.popup-form-wrapper').hide();
1053	  }
1054	});
1055	jQuery('.close-popup,.close-btn').click(function(e){
1056		e.preventDefault();
1057		 jQuery('.popup-form-wrapper').fadeOut();
1058	})
1059
1060	//covid resource pop-up display
1061	/*jQuery('.covid-res-btn-en').click(function(){
1062		alert('This link will take you to an external web site.');
1063	})
1064	jQuery('.covid-res-btn-hi').click(function(){
1065		alert('यह लिंक आपको एक बाहरी वेबसाइट पर ले जाएगा');
1066	})*/
1067
1068
1069
1070    
1071
1072// scroll on click text
1073
1074	jQuery('.h-prev').click(function(event) {
1075			  event.preventDefault();
1076			  jQuery('.info-tab').animate({
1077				scrollLeft: "-=200px"
1078			  }, function(){
1079                // createCookie('scrollPos', $('#slide-wrap').scrollLeft());
1080                scrollArrowShow();
1081         });
1082	});
1083	
1084	 jQuery('.h-next').click(function(event) {
1085		  event.preventDefault();
1086		  jQuery('.info-tab').animate({
1087		   scrollLeft: "+=200px"
1088		  }, function(){
1089                // createCookie('scrollPos', $('#slide-wrap').scrollLeft());
1090                scrollArrowShow();
1091         });
1092	});
1093	 function scrollArrowShow() {
1094      	var $elem = jQuery('.info-tab');
1095		  var newScrollLeft = $elem.scrollLeft(),
1096			  width = $elem.width(),
1097			  scrollWidth = $elem.get(0).scrollWidth;
1098		  var offset = 0;
1099		  if (scrollWidth - newScrollLeft - width === offset) {
1100			  jQuery('.h-next').css({visibility: 'hidden'});
1101		  }else{
1102            jQuery('.h-next').css({visibility: 'visible'});
1103          }
1104		  if (newScrollLeft === 0) {
1105			jQuery('.h-prev').css({visibility: 'hidden'});
1106        }else{
1107            jQuery('.h-prev').css({visibility: 'visible'});
1108        
1109		  }
1110    }
1111
1112	// Toggle Megha Menu **********
1113
1114	jQuery(".res_menu").click(function (e) {
1115		e.preventDefault();
1116		jQuery(this).toggleClass('open_meghamenu');
1117		jQuery('.mygov-menu').slideToggle();
1118	})
1119
1120	// close Megha Menu  outside click
1121	// jQuery(document).mouseup(function (e) {
1122	// 	var menuwrap = jQuery('.menu-wrapper');
1123	// 	if (!menuwrap.is(e.target) && menuwrap.has(e.target).length === 0) {
1124	// 		jQuery('.mygov-menu').fadeOut();
1125	// 		jQuery('.res_menu').removeClass('open_meghamenu');
1126	// 	}
1127	// });
1128
1129	jQuery(".nav-menu-close").click(function (e) {
1130		jQuery('.flyout-menu-wrapper').slideUp();
1131		jQuery(".res_menu").removeClass('open_meghamenu');
1132	})
1133	
1134	// Toggle covid 19 Menu **********
1135
1136	jQuery(".covid-menus .sticky-menu-btn").click(function (e) {
1137		e.preventDefault();
1138		jQuery('.covid-menus').toggleClass('extend');
1139		//jQuery('.covid_menu_list').slideToggle();
1140	})
1141	
1142	
1143	jQuery(".close_menus").click(function (e) {
1144		e.preventDefault();
1145		jQuery('.covid-menus').removeClass('extend');
1146	})
1147
1148	// close Megha Menu  outside click
1149	jQuery(document).mouseup(function (e) {
1150		var menuwrap1 = jQuery('.covid-menus');
1151		if (!menuwrap1.is(e.target) && menuwrap1.has(e.target).length === 0) {
1152			jQuery('.covid-menus').removeClass('extend');
1153		}
1154	});
1155
1156	
1157	
1158	// Toggle  Socialhub Megha Menu **********
1159
1160	// jQuery(".header-social-block > a").click(function (e) {
1161	// 	e.preventDefault();
1162	// 	jQuery(this).toggleClass('open_socialmenu');
1163	// 	jQuery('.shub-menu-wrapper').slideToggle();
1164	// })
1165
1166	// close Socialhub Megha Menu  outside click
1167	// jQuery(document).mouseup(function (e) {
1168	// 	var menuwrapn = jQuery('.header-social-block');
1169	// 	if (!menuwrapn.is(e.target) && menuwrapn.has(e.target).length === 0) {
1170	// 		jQuery('.shub-menu-wrapper').fadeOut();
1171	// 		jQuery('.header-social-block a').removeClass('open_socialmenu');
1172	// 	}
1173	// });
1174
1175	// jQuery(".nav-smenu-close").click(function (e) {
1176	// 	jQuery('.shub-menu-wrapper').slideUp();
1177	// 	jQuery(".header-social-block a").removeClass('open_socialmenu');
1178	// })
1179
1180
1181
1182
1183	// Toggle mygov states
1184	jQuery(".region-header .mygov-states").click(function () {
1185		jQuery(this).toggleClass('show-state');
1186		jQuery(this).siblings('.mygov-states-inner').slideToggle();
1187		jQuery(this).parents('.lang-box').find('.mygov-apps').removeClass('show-applist');
1188	})
1189
1190
1191	// close mygov states on click outside
1192	jQuery(document).mouseup(function (e) {
1193		var states = jQuery('#block-common-utils-mygov-sites')
1194		if (!states.is(e.target) && states.has(e.target).length === 0) {
1195			jQuery(".region-header .mygov-states-inner").fadeOut();
1196			jQuery('.region-header .mygov-states').removeClass('show-state');
1197
1198		}
1199	});
1200
1201	// Toggle mygov App list
1202	jQuery(".mygov-apps").click(function () {
1203		jQuery(this).toggleClass('show-applist');
1204		jQuery(this).siblings('.mygov-apps-inner').slideToggle();
1205		jQuery(this).parents('.lang-box').find('.mygov-states').removeClass('show-state');
1206	})
1207
1208	// close mygov App list on click outside
1209	jQuery(document).mouseup(function (e) {
1210		var states = jQuery('#block-common-utils-mygov-apps')
1211		if (!states.is(e.target) && states.has(e.target).length === 0) {
1212			jQuery(".region-header .mygov-apps-inner").fadeOut();
1213			jQuery('.region-header .mygov-apps').removeClass('show-applist');
1214		}
1215	});
1216
1217
1218	//Search Toggle
1219	jQuery('.search_toggle').click(function () {
1220		jQuery('body').toggleClass('search-open');
1221		jQuery('.search_mygov_box').toggleClass('active_search');
1222		jQuery('.region-header .mygov-states').removeClass('show-state');
1223		jQuery('.region-header .mygov-apps').removeClass('show-applist');
1224		// jQuery('.the_box #search_title').focus();
1225	})
1226
1227	//Home Popup
1228	var date = new Date();
1229	var minutes = 1440;
1230	date.setTime(date.getTime() + (minutes * 60 * 1000));
1231
1232	if (jQuery('#profile-popup-form').length > 0) {
1233		jQuery('.badge-wrap').hide();
1234		jQuery.cookie('msg', 'str', { expires: date });
1235	}
1236
1237	jQuery('.badge-popup-close').click(function () {
1238		jQuery('.badge-wrap').hide();
1239		jQuery.cookie('msg', 'str', { expires: date });
1240	})
1241
1242	var getPop = jQuery('.badge-wrap');
1243	if (getPop.length > 0) { //console.log('gotit');
1244		if (jQuery.cookie('msg') == null) {
1245			jQuery('.badge-wrap').show();
1246			jQuery.cookie('msg', 'str', { expires: date });
1247		}
1248		else {
1249			jQuery('.badge-wrap').hide();
1250		}
1251	}
1252
1253// 	if (jQuery('.dark_bg').length > 0) { 
1254// 	if (jQuery.cookie('msg1') == null) {
1255// 		jQuery('.dark_bg').show();
1256// 		jQuery.cookie('msg1', 'str', { expires: date });
1257// 	}
1258// 	else {
1259// 		jQuery('.dark_bg').hide();
1260// 	}
1261//   }
1262
1263// 	jQuery('.dark_bg').click(function () {
1264// 		jQuery('.dark_bg').hide();
1265// 		jQuery.cookie('msg1', 'str', { expires: date });
1266// 	})
1267
1268	jQuery(document).click(function (e) {
1269		if (!jQuery(e.target).hasClass("search_toggle") && jQuery(e.target).parents(".header-search-block").length === 0) {
1270			//jQuery(".the_box").hide();
1271			jQuery('.search_mygov_box').removeClass('active_search');
1272			jQuery('body').removeClass('search-open');
1273		}
1274	});
1275
1276	// Notification toggle
1277
1278	jQuery('.header-push-notification a').click(function () {
1279		jQuery('.notification-container').slideToggle();
1280		jQuery('.header-push-notification').toggleClass('show');
1281	})
1282
1283	jQuery(document).mouseup(function (e) {
1284		var notifyBlock = jQuery(".header-push-notification");
1285		if (!notifyBlock.is(e.target) && notifyBlock.has(e.target).length === 0) {
1286			jQuery(".notification-container").fadeOut();
1287			jQuery('.header-push-notification').removeClass('show');
1288		}
1289	});
1290
1291
1292	// close Notification in logged status
1293
1294	jQuery(document).mouseup(function (e) {
1295		var container = jQuery(".header-push-notification");
1296		if (!container.is(e.target) && container.has(e.target).length === 0) {
1297			jQuery("#ogpl-alert-notify-list").fadeOut();
1298		}
1299	});
1300
1301	//Close login menu
1302	jQuery(document).mouseup(function (e) {
1303		var menubox = jQuery('.section-header-wrapper .user-profile-pic');
1304		var logout_box = jQuery('.logged-in .notification_user');
1305		if (!menubox.is(e.target) && menubox.has(e.target).length === 0 && !logout_box.is(e.target) && logout_box.has(e.target).length === 0) {
1306			jQuery(".notification_user").fadeOut();
1307		}
1308	});
1309
1310	//Fixed header on scroll
1311
1312	jQuery(window).scroll(function () {
1313		var headerH = jQuery('.top_wrapper').height();
1314		if (jQuery('.top_wrapper').css('display') != 'none') {
1315			if (jQuery(this).scrollTop() > jQuery('.top_wrapper').height() - 20) {
1316				jQuery('.top_wrapper').addClass("sticky");
1317				jQuery('body').css('paddingTop', headerH);
1318
1319			} else {
1320				jQuery('.top_wrapper').removeClass("sticky");
1321				jQuery('body').css('paddingTop', '0');
1322
1323			}
1324		}
1325		if (jQuery('.circular-menu').length) {
1326			if(jQuery(this).scrollTop() > 500 && jQuery(this).scrollTop() < jQuery('#group-section').offset().top ) {
1327				jQuery('.circular-menu').fadeIn();
1328			} else {
1329				jQuery('.circular-menu').stop(true).fadeOut();
1330			}
1331		}
1332		
1333		
1334	});
1335
1336	//Pariksha pe charcha
1337
1338	jQuery('.acc_survey_header').click(function () {
1339		jQuery(this).toggleClass('expend');
1340		jQuery(this).next('.acc_survey_block').slideToggle('fast');
1341	})
1342
1343	// Ticker js
1344	if (jQuery('.view-ticker-block').length) {
1345		window.jsConveyor1 = jQuery('.view-ticker-block').jConveyorTicker({ reverse_elm: true,start_paused: false });
1346		//jQuery('.view-ticker-block').jConveyorTicker({ reverse_elm: true,start_paused: true,force_loop: true });
1347		   
1348		
1349		var ticker_btn ='<button class="play_ticker" style="display:none" onclick="jsConveyor1.playAnim();">Play</button><button class="pause_ticker" onClick="jsConveyor1.pauseAnim();">Pause</button>'
1350		jQuery('#block-views-ticker-block-block .content').append(ticker_btn);
1351		jQuery('.play_ticker').on('click', function(){
1352			//jsConveyor1.playAnim(); 
1353			jQuery(this).hide();
1354			jQuery('.pause_ticker').show();
1355		})
1356		jQuery('.pause_ticker').on('click', function(){
1357			//jsConveyor1.pauseAnim();   // Pause the ticker's scrolling
1358			jQuery(this).hide();
1359			jQuery('.play_ticker').show();
1360		})
1361		
1362	
1363	}
1364	
1365	// Ticker js for covid-19 page
1366	/*if (jQuery('.marquee').length) {
1367		jQuery('.marquee').jConveyorTicker({ reverse_elm: true });
1368	}*/
1369	// stricky menu display after scroll
1370 if(jQuery('.main-activities-status').length > 0){
1371	var str_offset = jQuery('.main-activities-status').offset().top;
1372	jQuery(window).scroll(function () {
1373		if (jQuery(window).scrollTop() > str_offset) {
1374
1375			jQuery('body').addClass('stricky_menu');
1376		}
1377		else {
1378			jQuery('body').removeClass('stricky_menu');
1379
1380		}
1381	})
1382}
1383
1384
1385	// tricker jquery
1386
1387	//var mqr =jQuery('.view-id-ticker_block').hover(function(){
1388	//    jQuery('.view-id-ticker_block').addClass('pause_ticker');	
1389	//},
1390	//function(){
1391	//	jQuery('.view-id-ticker_block').removeClass('pause_ticker');
1392	//});
1393
1394
1395
1396	// skip content
1397
1398	jQuery('.skip_content').click(function (evn) {
1399		evn.preventDefault();
1400		var target = this.hash;
1401		var pos = jQuery(target).offset().top;
1402		jQuery('html, body').animate({
1403			scrollTop: pos - jQuery('.top_wrapper').height()
1404		});
1405	});
1406
1407
1408
1409	jQuery("#group_switch_btn").click(function () {
1410		jQuery("#groups_list").slideToggle();
1411		jQuery(".group_name_selected").toggleClass('active');
1412		jQuery("#group_switch_btn").toggleClass('up');
1413	});
1414
1415	jQuery('.block-do-discuss-filter .views-exposed-form #edit-title-wrapper label, .block-do-discuss-filter .views-exposed-form #edit-field-hashtags-tid-wrapper label').click(function () {
1416		jQuery('.block-do-discuss-filter .views-exposed-form #edit-title-wrapper .views-widget input[type="text"], .block-do-discuss-filter .views-exposed-form #edit-field-hashtags-tid-wrapper .views-widget input[type="text"]').toggle();
1417	});
1418	jQuery('.search_area .search_toggle').click(function () {
1419		jQuery('.search_box').toggle();
1420	});
1421
1422
1423
1424
1425
1426	var collectOnMe = document.querySelectorAll('.collectonme'),
1427		buttons = document.getElementsByTagName("input");
1428
1429	for (var i = 0; i < collectOnMe.length; i++) {
1430		collectOnMe[i].style.display = "none";
1431	}
1432
1433	
1434	
1435	//default options
1436	//var testContainer = document.querySelector('.site-wrapper'),
1437	//				testContainerIsSnowing = true;
1438	//
1439	//		snowFall.snow(testContainer,{round : true, minSize: 3, maxSize:5});
1440	//
1441	//		testContainer.addEventListener('click', function(e){
1442	//				testContainerIsSnowing = !testContainerIsSnowing;
1443	//
1444	//				if(!testContainerIsSnowing){
1445	//						snowFall.snow(testContainer, "clear");
1446	//				}else{
1447	//						snowFall.snow(testContainer);
1448	//				}
1449	//		})
1450
1451
1452	jQuery(document).keydown(function (event) {
1453		if (event.keyCode == 27) {
1454			jQuery('#web_notification').hide();
1455			jQuery('.badge-wrap').hide();
1456			jQuery.cookie('msg', 'str', { expires: date });
1457
1458		}
1459	})
1460
1461	jQuery('.notification-close,#web_notification').click(function () {
1462		jQuery('#web_notification').fadeOut();
1463	})
1464
1465	if (jQuery('#block-mygov-gratification-top-user').length) {
1466		// jQuery('#block-mygov-gratification-top-user .content').owlCarousel();
1467		jQuery('#block-mygov-gratification-top-user .content').addClass('owl-carousel');
1468		jQuery("#block-mygov-gratification-top-user .content").owlCarousel({
1469		loop: true,
1470		autoplay: true,
1471		items: 1,
1472		nav: false,
1473		autoplayHoverPause: true,
1474	});
1475	}
1476
1477
1478	// view result btn
1479	if (jQuery('.result-url').length) {
1480		jQuery('.closed_task').addClass('new_btn');
1481	}
1482	
1483	// covid -19 state wise status change in link
1484	if(jQuery('.field-name-field-district-reporting').length ){
1485	 var linkText = jQuery('.field-name-field-district-reporting .field-item').text();
1486     jQuery('.field-name-field-district-reporting .field-item').html('<a target="_blank" href="'+linkText+'">'+linkText+'</a>');
1487	}
1488	
1489	if(jQuery('.node-corona-data .field-name-field-whatsapp-chatbot-url').length ){
1490	jQuery('.field-name-field-whatsapp-chatbot-url,.field-name-field-fb-chatbot-url,.field-name-field-e-pass-url,.field-name-field-fb-url,.field-name-field-whatsapp-chatbot').each(function () {
1491	 var linkText = jQuery(this).find('.field-item').text();
1492     jQuery(this).find('.field-item').html('<a target="_blank" href="'+linkText+'">'+linkText+'</a>');
1493	})
1494	}
1495	
1496   
1497   
1498   // Animating number on covid page
1499   
1500    // if (jQuery('.icount').length) { 
1501	// 	jQuery('.icount').counterUp({
1502	// 		delay: 10,
1503	// 		time: 1000
1504	// 	});
1505	// }
1506  
1507 
1508if(jQuery('#state-covid-data').length){
1509var oTable;
1510var oSettings;
1511 oTable=jQuery('#state-covid-data').DataTable( {
1512	  pageLength: 6,
1513	  "order": [[ $('td.now').index(), "desc" ]],
1514	  //"order": [[ 1, "desc" ]],
1515        "info":false,
1516        "pagingType": "full_numbers",
1517         responsive: true,
1518	
1519	});
1520	
1521    oSettings = oTable.settings();
1522	
1523	jQuery("#btn-load-more").on('click',function(){
1524	   oSettings[0]._iDisplayLength = oSettings[0].fnRecordsTotal();
1525	   oTable.draw(); 
1526	    jQuery(this).hide();
1527	});
1528	
1529}
1530	//var visible = false;
1531//    var tableContainer = jQuery(oTable.table().container());
1532//      jQuery('.statewise_title').click(function(){
1533//		   jQuery(this).toggleClass('on');
1534//		   jQuery('.state_record').toggle('fast',function(){
1535//			     tableContainer.css( 'display', visible ? 'none' : 'block' );
1536//           oTable.fixedHeader.adjust();
1537// 
1538//             visible = ! visible;
1539//			});
1540//		 
1541//			
1542//		 })
1543
1544
1545// weblink for trevelling list
1546 jQuery('.getpass').click(function(e){
1547	 e.preventDefault();
1548	jQuery('.helpno_list').hide();
1549    jQuery('.weblink_list').toggle(); 
1550 })
1551 
1552 jQuery('.helplines-block').click(function(e){
1553	 e.preventDefault();
1554	jQuery('.weblink_list').hide();
1555    jQuery('.helpno_list').toggle(); 
1556 })
1557 
1558  jQuery('.close_list').click(function(){
1559    jQuery(this).parents('.card_list').hide(); 
1560 })
1561
1562 // weblink for helpline list
1563 jQuery('.helplines-block,.close_helplines').click(function(e){
1564	 e.preventDefault();
1565    jQuery('.weblink_helplines').slideToggle(); 
1566 })
1567 
1568 
1569 //Accordian jquery
1570 if(jQuery('.c-accordian').length){
1571	jQuery('.c-accordian h3').click(function() {
1572		//REMOVE THE ON CLASS FROM ALL BUTTONS
1573		jQuery('.c-accordian h3').removeClass('on');
1574		  
1575		//NO MATTER WHAT WE CLOSE ALL OPEN SLIDES
1576	 	jQuery('.c-accordian >
1576 .content-body').slideUp('normal');
1577   
1578		//IF THE NEXT SLIDE WASN'T OPEN THEN OPEN IT
1579		if(jQuery(this).next().is(':hidden') == true) {
1580			
1581			//ADD THE ON CLASS TO THE BUTTON
1582			jQuery(this).addClass('on');
1583			  
1584			//OPEN THE SLIDE
1585			jQuery(this).next().slideDown('normal');
1586		 }
1587		  
1588	 });
1589	 jQuery('.content-body').hide();
1590	//jQuery('.content-body:first-of-type').show();
1591	//jQuery('.show').show();
1592	//jQuery('.c-accordian h3:first-child').addClass('on');
1593  }
1594  if(jQuery('.block-republic-day').length){
1595  	var curRdUrl = window.location.href;
1596	  curRdUrlArray = curRdUrl.split("?r=");
1597	  if(curRdUrlArray[1] == 'www'){
1598			 jQuery('.step_1').hide();
1599			 jQuery('.block-republic-day').show();
1600				
1601			  jQuery('html, body').animate({
1602				scrollTop: jQuery('.block-republic-day').offset().top - jQuery('.top_wrapper').height() 
1603			 });	
1604	  }
1605    jQuery('.rg_btn').click(function(et) {
1606    	if(window.location.origin == 'https://www.mygov.in'){
1607    		var curLanUrl = '';
1608    		if(jQuery("body").hasClass("i18n-hi")){
1609    			curLanUrl = '/hi';
1610    		}	
1611    		window.location.href = "https://secure.mygov.in"+curLanUrl+"/rd2024?r=www";
1612    	}else{
1613    		et.preventDefault();
1614			 jQuery('.step_1').hide();
1615			 jQuery('.block-republic-day').show();
1616				
1617			  jQuery('html, body').animate({
1618				scrollTop: jQuery('.block-republic-day').offset().top - jQuery('.top_wrapper').height() 
1619			 });	
1620    	}     
1621
1622		})
1623
1624		jQuery('.block-republic-day .close').on('click',function(){
1625		 jQuery('.block-republic-day').hide();
1626		 jQuery('.step_1').show();
1627		})
1628  }
1629  
1630  jQuery('#quicktabs-container-wall_of_fame > .quicktabs-tabpage').each(function() {
1631    jQuery(this).prepend(" <div class='display_changer'><span class='grid-view'>grid</span> <span class='normal-view active'>Default</span></div>");
1632   
1633  })
1634  
1635  jQuery('.grid-view').on('click', function(){
1636	jQuery(this).parents('.quicktabs-tabpage').addClass('grid-block');
1637	jQuery(this).parent('.display_changer').find('span').removeClass('active');
1638	jQuery(this).addClass('active');
1639
1640  })
1641  jQuery('.normal-view').on('click', function(){
1642	jQuery(this).parents('.quicktabs-tabpage').removeClass('grid-block');
1643	jQuery(this).parent('.display_changer').find('span').removeClass('active');
1644	jQuery(this).addClass('active');
1645  })
1646  
1647
1648});
1649
1650// assume only one video is playing at a time
1651var videoPlaying = null;
1652
1653const onPlay = function() {
1654  if (videoPlaying && videoPlaying != this) {
1655    videoPlaying.pause()
1656  }
1657  videoPlaying = this
1658}
1659
1660// init event handler
1661const videos = document.getElementsByTagName("video")
1662for (let i = 0; i < videos.length; i++) {
1663  videos[i].addEventListener("play", onPlay)
1664} 
1665
1666
1667
1668
1669(function (jQuery) {
1670	jQuery(window).on("load", function () {
1671		jQuery(".scroll-wrap").mCustomScrollbar();
1672		if (jQuery(".update_block").length > 0) {
1673			var target = window.location.hash;
1674			if(target.length){
1675				var pos = jQuery(target).offset().top;
1676				var siteHeadH =jQuery('.top_wrapper').height();
1677				jQuery('html, body').animate({
1678					scrollTop: pos - 140
1679				});
1680				//jQuery(target).trigger('click'); 
1681			}		
1682		}
1683
1684		// podcast load at home page on click 
1685	if(jQuery('.podcast-content').length > 0){
1686
1687		jQuery('.podcast-content .play-podcast').each(function () {
1688			jQuery(".podcast-content .views-field-field-mp3-file").html('<audio controls autoplay style="display:none;"><source  src="" type="audio/mpeg"></audio>');
1689			var clicked = true; 
1690			jQuery(this).on('click',function(e){
1691				e.preventDefault();
1692			 if(clicked){
1693				clicked = false;
1694				const audUrl =jQuery(this).attr('rel');
1695				 jQuery(this).parents('.views-row').find('source').attr('src', audUrl);
1696				 jQuery(this).parents('.views-row').find('audio').load().show();
1697			  }
1698			 let audioUrl = jQuery(this).parents('.views-row').find('audio')[0];
1699			  if (audioUrl.paused) { 
1700				  audioUrl.play();
1701				  jQuery('.podcast-content .views-field-nid a').text("Play").removeClass('pause');
1702			      jQuery(this).text("Pause").addClass('pause');
1703			    } else {
1704				   audioUrl.pause();
1705				  jQuery(this).text("Play").removeClass('pause');
1706			    } 
1707			})
1708			
1709			
1710			
1711		})
1712    }
1713		if(jQuery('.podcast-slider').length > 0){
1714				// podcast at covid load on click 
1715		jQuery('.play-podcast ').each(function () {
1716			jQuery("#podcast .audio").html('<audio controls autoplay style="display:none;"><source  src="" type="audio/mpeg"></audio>');
1717			 jQuery(this).click(function(){
1718			  jQuery(this).hide();
1719			  var audUrl =jQuery(this).attr('rel');
1720			 // console.log(audUrl);
1721			  jQuery(this).parents('.event-items').find('source').attr('src', audUrl);
1722			  jQuery(this).parents('.event-items').find('audio').load().show();
1723			})
1724			
1725			
1726			
1727		})
1728		
1729		var vidDefer = document.getElementsByTagName('iframe');
1730			for (var i=0; i<vidDefer.length; i++) {
1731			if(vidDefer[i].getAttribute('data-src')) {
1732			vidDefer[i].setAttribute('src',vidDefer[i].getAttribute('data-src'));
1733		 } 
1734		} 
1735	
1736		//jQuery('.pause-podcast ').each(function () {
1737//			 jQuery(this).click(function(){
1738//			   jQuery(this).sibling().find('audio').pause()
1739//			})
1740//		})
1741		}
1742		if(jQuery(".selectric-input").length > 0){
1743			jQuery(".selectric-input").wrap("<label class='element-invisible' aria-hidden='true'>Hidden Label</label>");
1744		 }
1745		jQuery('.podcast-top-view .view-podcast .owl-dots .owl-dot').each(function(){
1746			jQuery(this).text(jQuery(this).index()+1);
1747		}); 
1748	});
1749})(jQuery);
1750
1751jQuery(".mygov_survey iframe").on('load', function () {
1752	//var cm = jQuery('.mygov_survey iframe').contents().find("body").height();
1753	jQuery('.mygov_survey iframe').height(800);
1754
1755	if (jQuery(this).contents().find('.group-name').text() == 'Awareness And Usage of MyGov') {
1756		jQuery(this).height(jQuery(this).contents().find("body").outerHeight() + 1600);
1757		//window.scrollTo(500, 500);
1758
1759	}
1760	else {
1761		//alert(jQuery(this).height( jQuery(this).contents().find("body").outerHeight()));
1762
1763		jQuery(this).height(jQuery(this).contents().find("body").outerHeight() + 500);
1764	}
1765	if (jQuery(this).contents().find('#bootstrap-alert-box-modal').length > 0) {
1766		window.scrollTo(500, 500);
1767	}
1768	if (jQuery(this).contents().find(".reloadlink").length > 0) {
1769		this.contentWindow.location.reload(true);
1770		//location.reload();
1771	}
1772	if (jQuery(this).contents().find('#tokenmessage>span:has(a)').length == 0 && jQuery(this).contents().find("#tokenmessage>span").length > 0) {
1773		location.reload();
1774	}
1775});
1776
1777
1778/*******************************************************************************
1779 * 2. Tabs for login page==================================================
1780 ******************************************************************************/
1781
1782jQuery(document).ready(function () {
1783	//add for change duplicate id
1784 	jQuery(".tab2 #edit-submit-covid-states-advisory").attr("id","edit-submit-covid-states-advisory4");
1785	if (jQuery(window).width() < 300) {
1786		jQuery("body.page-user-login #block-pwdless-login-pwdless-login-block").hide();
1787		jQuery("body.page-user-login #block-system-main").hide();
1788		jQuery("body.page-user-login #block-system-main").before('<div id="tabs"><ul class="tabs"><li class="tab-link1"><a href="#block-system-main">Log In With Password</a></li><li class="tab-link2"><a href="#block-pwdless-login-pwdless-login-block">Log In With OTP</a></li></ul></div>');
1789		jQuery('body.page-user-login ul.tabs li.tab-link1 a').click(function () {
1790			jQuery("body.page-user-login #block-system-main").show();
1791			jQuery("body.page-user-login #block-pwdless-login-pwdless-login-block").hide();
1792		})
1793		jQuery('body.page-user-login ul.tabs li.tab-link2 a').click(function () {
1794			jQuery("body.page-user-login #block-pwdless-login-pwdless-login-block").show();
1795			jQuery("body.page-user-login #block-system-main").hide();
1796		})
1797
1798	}
1799});
1800
1801
1802
1803
1804/*******************************************************************************
1805 * Comment Load More ==================================================
1806 ******************************************************************************/
1807(function ($) {
1808	Drupal.behaviors.commentLoadMore = {
1809		attach: function (context, settings) {
1810			// Stem star and card page
1811			jQuery('.awardi-info .card-btn').on('click',function () {
1812				jQuery(this).parents('.views-row').addClass('showCard');
1813		
1814			})
1815			jQuery('.card-close').on('click',function () {
1816				jQuery(this).parents('.views-row').removeClass('showCard');
1817		
1818			})
1819
1820			jQuery('.podcast_img').on('click', function () {
1821				var audio = jQuery(this).parent('.do_box').find('.audio audio')[0];
1822				if (audio.paused) {
1823				audio.play();
1824				}
1825				else{audio.pause();}
1826			 
1827			})
1828
1829			$('#comment-load-more', context).click(
1830				function () {
1831					var base = $(this).attr('id');
1832					var url = $(this).attr('href');
1833
1834					var element_settings = {
1835						url: url,
1836						event: 'loadMore',
1837					};
1838
1839					Drupal.ajax[base] = new Drupal.ajax(base, this,
1840						element_settings);
1841
1842					$(this).trigger('loadMore');
1843					return false;
1844				});
1845
1846
1847
1848			jQuery('.group_stats > a').off("click").on('click', function (event) {
1849				// event.preventDefault();
1850				jQuery(this).parents('.group_stats').find('.group_info_wrap').slideToggle();
1851				jQuery(this).parents('.group_stats').toggleClass('show');
1852			})
1853
1854		}
1855	};
1856}(jQuery));
1857
1858
1859/*******************************************************************************
1860 * User Profile Page Task Toggle
1861 * ==================================================
1862 ******************************************************************************/
1863
1864/**
1865 * Behaviors for collapsible menu.
1866 */
1867//(function($) {
1868//    /**
1869//     * Adds toggle link.
1870//     * Toggles menu on small resolutions.
1871//     * Restores menu on window width increasing.
1872//     */
1873//    Drupal.behaviors.pageTaskToggle = {
1874//        attach: function (context, settings) {
1875jQuery(document).ready(function () {
1876	jQuery('.section-header-wrapper .user-profile-pic img').click(function (e) { 
1877		e.stopPropagation();
1878		jQuery('#notification_user_menu').toggle('fast');
1879	});
1880	jQuery('#block-views-my-details-block-1').css("cursor",
1881		"pointer");
1882
1883	jQuery('#block-views-groupissue-block-2').css('display',
1884		'none');
1885
1886	jQuery('#task_tab').css('cursor', 'pointer');
1887	jQuery('#groupissue_tab').css('cursor', 'pointer');
1888
1889	jQuery('#edit-timezone').addClass('collapsed');
1890	jQuery('#edit-heartbeat').addClass('collapsed');
1891
1892
1893	jQuery('.home-slider-text a').attr('target', '_blank');
1894
1895	jQuery('#edit-field-gi-comment-file legend').css('display',
1896		'none');
1897	jQuery('#edit-field-comment-file label').css('display',
1898		'none');
1899
1900	jQuery('.page-groups #block-system-main').addClass('grid');
1901	var youtubePlaceholde = Drupal.t('Put youtube Video ID. e.g flWwMxGilAY');
1902	var hashtagPlaceholde = Drupal.t('Search by Hashtag');
1903	var searchPlaceholde = Drupal.t('Search by Title');
1904	var sharePlaceholde = Drupal.t('Share Your Views...');
1905	var submitPlaceholde = Drupal.t('Submit Your Task...');
1906
1907	jQuery('#edit-field-video input').attr('placeholder', youtubePlaceholde);
1908	jQuery('.page-node #edit_search').attr('placeholder', hashtagPlaceholde);
1909	jQuery('.page-home #edit_search').attr('placeholder', searchPlaceholde);
1910	jQuery('.page-groups #edit_search').attr('placeholder', searchPlaceholde);
1911	jQuery('.node-type-group-issue #edit-comment-body textarea').attr('placeholder', sharePlaceholde);
1912	jQuery('.node-type-task #edit-comment-body textarea').attr('placeholder', submitPlaceholde);
1913
1914	//Image map of front page slider...
1915	jQuery('.view-homepage-slider .view-content .flexslider .slides ').find('li').each(function () {
1916		var map_name = jQuery(this).find('.views-field.views-field-field-banner-image .field-content map').attr("name");
1917		if (map_name != undefined) {
1918			jQuery(this).find('.views-field.views-field-field-banner-image .field-content img').attr("usemap", "#" + map_name);
1919		}
1920
1921	});
1922
1923	// jQuery('#flexslider-1').flexslider({
1924	// 	direction: "vertical",
1925	// 	animation: 'slide',
1926	// });
1927	
1928	
1929
1930	jQuery('#sms-user-settings-reset-form #edit-number label')
1931		.html('Your Mobile Number');
1932
1933	jQuery("#edit-field-user-picture-und-0-ajax-wrapper .description")
1934		.text(jQuery("#edit-field-user-picture-und-0-ajax-wrapper .description").text().substring(29));
1935	var moreText = Drupal.t('more');
1936
1937	jQuery("#block-views-view-comments-block-8 .view-content").append("<a id='more-link'>" + moreText + "</a>");
1938	jQuery("#more-link").click(function () {
1939		jQuery("#featured_tab").click();
1940		jQuery('html, body').animate({
1941			scrollTop: jQuery("#block-system-main").offset().top
1942		}, 2000);
1943	});
1944
1945	// Podcast page slider
1946	jQuery('.podcast-top-view .view-content').addClass('owl-carousel');
1947	jQuery('.podcast-top-view .view-content').owlCarousel({
1948		loop:false,
1949		nav:true,
1950		margin:15,
1951		responsiveClass:true,
1952		dots:true,
1953        //		dotsData: true,
1954		responsive:{
1955			0:{
1956				items: 1
1957			},
1958			480:{
1959				items: 2
1960			},
1961			768:{
1962				items: 3
1963			}
1964		}
1965		
1966	});	
1967	
1968	// Podcast at home page slider
1969  if (jQuery('.podcast-content').length > 0) {
1970	jQuery('.podcast-content .view-content').addClass('owl-carousel');
1971	jQuery('.podcast-content .view-content').owlCarousel({
1972		loop:false,
1973		nav:true,
1974		margin:15,
1975		responsiveClass:true,
1976		dots:true,
1977		responsive:{
1978			0:{
1979				items: 1
1980			},
1981			480:{
1982				items: 2
1983			},
1984			768:{
1985				items: 3
1986			}
1987		}
1988		
1989	});
1990}
1991
1992if (jQuery('.view-trending-social-media').length > 0) {
1993	jQuery('.view-trending-social-media .view-content').addClass('owl-carousel');
1994	jQuery('.view-trending-social-media .view-content').owlCarousel({
1995		loop:true,
1996		dots:true,
1997		nav:true,
1998		margin:15,
1999		responsiveClass:true,
2000	   responsive:{
2001		0:{
2002			items: 1
2003		},
2004		569:{
2005		   items:2
2006		},
2007		768:{
2008		   items:3
2009		}
2010	   }
2011	  });
2012}
2013
2014//Infocus slider 
2015if(jQuery('.infocus-listing').length > 0){
2016	jQuery('.infocus-listing .view-content').addClass('owl-carousel');
2017	jQuery('.infocus-listing .view-content').owlCarousel({
2018		loop:false,
2019		dots:true,
2020		nav:true,
2021		margin:15,
2022		responsiveClass:true,
2023	   responsive:{
2024		0:{
2025			items: 1
2026		},
2027		569:{
2028		   items:2
2029		},
2030		768:{
2031		   items:3
2032		}
2033	   }
2034	  });
2035  }
2036
2037   //quizes slider
2038 if(jQuery('.mygovquiz').length > 0){
2039	jQuery('.mygovquiz').addClass('owl-carousel');
2040	jQuery('.mygovquiz').owlCarousel({
2041		loop:false,
2042		dots:true,
2043		nav:true,
2044		// dotsData: true,
2045		margin:15,
2046		responsiveClass:true,
2047		navText : ["Previous","Next"],
2048	   responsive:{
2049		0:{
2050			items: 1
2051		},
2052		569:{
2053		   items:2
2054		},
2055		768:{
2056		   items:3
2057		}
2058	   }
2059	  });
2060  }
2061// home page soical gub slider 
2062if(jQuery('.mygov_social_list').length > 0){
2063	if(jQuery(window).width() < 768){
2064	jQuery('.mygov_social_list').addClass('owl-carousel');
2065	jQuery('.mygov_social_list').owlCarousel({
2066		autoplay:true,
2067        autoplayTimeout:3000,
2068		autoplayHoverPause:true,
2069		loop:true,
2070		dots:true,
2071		nav:false,
2072		margin:15,
2073		items: 2,
2074		responsive:{
2075			0:{
2076				items: 2
2077			},
2078			420:{
2079			   items:3
2080			},
2081			569:{
2082				items:4
2083			 }
2084		   }
2085	  });
2086	}
2087  }
2088
2089
2090  // home page States  slider in mobile
2091if(jQuery('.siteStats').length > 0){
2092	if(jQuery(window).width() < 767){
2093	jQuery('.siteStats').addClass('owl-carousel');
2094	jQuery('.siteStats').owlCarousel({
2095		autoplay:true,
2096        autoplayTimeout:3000,
2097		autoplayHoverPause:true,
2098		loop:true,
2099		dots:true,
2100		nav:false,
2101		margin:15,
2102		items: 1,
2103		responsive:{
2104			0:{
2105				items: 1
2106			},
2107			569:{
2108				items:2
2109			 }
2110		   }
2111	  });
2112	}
2113  }
2114
2115
2116  //Home Page Main slider
2117  if(jQuery('.view-homepage-slider').length > 0){
2118	jQuery('.view-homepage-slider .view-content').addClass('owl-carousel');
2119	var homeSlider = jQuery(".view-homepage-slider .view-content");
2120	homeSlider.owlCarousel({
2121	loop: true,
2122	autoplay: true,
2123	items: 1,
2124	nav: false,
2125	autoplayHoverPause: true,
2126	animateOut: 'slideOutUp',
2127	animateIn: 'slideInUp',
2128	autoHeight: true,
2129	touchDrag  : false,
2130	mouseDrag  : false,
2131  });
2132  var pl_btn ="<a href='javascript:void(0)' class='play' title='Play Slider' style='display:none'>Play</a><a href='javascript:void(0)' title='Pause Slider' class='stop'>Pause</a>"
2133  homeSlider.append(pl_btn);
2134	jQuery('.play').on('click',function(){
2135		homeSlider.trigger('play.owl.autoplay');
2136		jQuery(this).hide();
2137		jQuery('.stop').show();
2138	})
2139	jQuery('.stop').on('click',function(){
2140		homeSlider.trigger('stop.owl.autoplay');
2141		jQuery(this).hide();
2142		jQuery('.play').show();
2143	})
2144	homeSlider.on('resize.owl.carousel resized.owl.carousel ',
2145		function(e) {
2146			jQuery('.play').hide();
2147			jQuery('.stop').show();
2148		});
2149 }
2150
2151  //inner Page sidebar slider
2152  if(jQuery('.not-front .view-whats-new').length > 0){
2153	jQuery('.view-whats-new .view-content').addClass('owl-carousel');
2154	jQuery(".view-whats-new .view-content").owlCarousel({
2155	loop: true,
2156	autoplay: true,
2157	items: 1,
2158	nav: false,
2159	autoplayHoverPause: true,
2160  });
2161 }
2162
2163
2164  // home page Group slider 
2165 if(jQuery('.group_info').length > 0){
2166	if(jQuery(window).width() < 768){
2167	jQuery('.group_info').addClass('owl-carousel');
2168	jQuery('.group_info').owlCarousel({
2169		autoplay:true,
2170        autoplayTimeout:3000,
2171		autoplayHoverPause:true,
2172		loop:true,
2173		dots:true,
2174		nav:false,
2175		margin:0,
2176		items: 1,
2177		responsive:{
2178			640:{
2179				items:2
2180			 }
2181		   }
2182	  });
2183	}
2184  }
2185
2186	jQuery('.podcast-top-view .views-field-field-podcast-image').click(function () {
2187		var audio = jQuery(this).parent('.views-row').find('.views-field-field-mp3-file audio')[0];
2188		if (audio.paused) {
2189		audio.play();
2190		}
2191		else{
2192			audio.pause();	
2193		}
2194	 
2195	})
2196	jQuery('.img-podcast').click(function () {
2197		var audio = jQuery(this).parent('.podcast-item').find('.mp3-podcast audio')[0];
2198		if (audio.paused) {
2199		audio.play();
2200		}
2201		else{
2202			audio.pause();	
2203		}
2204	 
2205	})
2206	
2207});
2208//  }
2209//    }
2210//})(jQuery);
2211
2212
2213/*******************************************************************************
2214 * My Submissions Ajax View ==================================================
2215 ******************************************************************************/
2216(function ($) {
2217
2218	$("#my_submissions").hide();
2219	$(".all_comments").show();
2220
2221	Drupal.behaviors.mygov_submission_show = {
2222		attach: function (context, settings) {
2223			jQuery(document).ajaxComplete(function () {
2224				jQuery('.comment-unpublished').parents('.ajax-comment-wrapper').addClass('unpublish_wrapper');
2225			})
2226			$('#reset_tab:not(.mygov-ajax-processed)', context).addClass('mygov-ajax-processed').click(function () {
2227				var nid = $("#task_nid").val();
2228				jQuery(".all_comments").prependTo("#post_list-wrapper-nid-" + nid);
2229				$(".all_comments").show();
2230				$("#my_submissions").hide();
2231				$("#talk_discussions").hide();
2232				$("#under_moderation").hide();
2233				$("#talk_ivrs").hide();
2234				$("#talk_featured").hide();
2235				if ($('.bottom_nav_wrapper').find('.links_wrapper').length > 0) {
2236					$(".links_wrapper").show();
2237					$(".comment_body_wrapper").hide();
2238				}
2239				else {
2240					$(".comment_body_wrapper").show();
2241				}
2242				if ($('.bottom_nav_wrapper').find('.talk_end').length > 0) {
2243					$(".comment_body_wrapper").hide();
2244				}
2245				if ($('.bottom_nav_wrapper').find('.not_started').length > 0) {
2246					$(".comment_body_wrapper").hide();
2247				}
2248				$("#reset_tab").addClass("active");
2249				$("#my_submissions_tab").removeClass("active");
2250				$("#moderate_tab").removeClass("active");
2251				$("#discussions_tab").removeClass("active");
2252				$("#ivrs_tab").removeClass("active");
2253				$("#featured_tab").removeClass("active");
2254			});
2255			$('#my_submissions_tab').click(function () {
2256				var nid = $("#task_nid").val();
2257				if (!$(this).hasClass('mygov-ajax-processed-once')) {
2258					var base = $(this).attr('id');
2259					var element_settings = {
2260						url: '/show-my-submissions/' + nid,
2261						event: 'submissions',
2262					};
2263
2264					Drupal.ajax[base] = new Drupal.ajax(base,
2265						this, element_settings);
2266					$(this).trigger('submissions');
2267					$(this).addClass('mygov-ajax-processed-once');
2268
2269				}
2270
2271				$(".links_wrapper").hide();
2272				$(".comment_body_wrapper").hide();
2273				$(".all_comments").hide();
2274				$("#talk_discussions").hide();
2275				$("#under_moderation").hide();
2276				$("#talk_ivrs").hide();
2277				$("#talk_featured").hide();
2278				jQuery("#my_submissions").prependTo("#post_list-wrapper-nid-" + nid);
2279				$("#my_submissions").show();
2280
2281				$("#reset_tab").removeClass("active");
2282				$("#moderate_tab").removeClass("active");
2283				$("#discussions_tab,#featured_tab").removeClass("active");
2284				$("#my_submissions_tab").addClass("active");
2285
2286				return false;
2287			});
2288
2289
2290
2291			$('#moderate_tab').click(function () {
2292				var nid = $("#task_nid").val();
2293				if (!$(this).hasClass('mygov-ajax-processed-once')) {
2294					var base = $(this).attr('id');
2295					var element_settings = {
2296						url: '/show-under-moderation/' + nid,
2297						event: 'under_moderation',
2298					};
2299
2300					Drupal.ajax[base] = new Drupal.ajax(base,
2301						this, element_settings);
2302					$(this).trigger('under_moderation');
2303					$(this).addClass('mygov-ajax-processed-once');
2304
2305				}
2306
2307				$(".all_comments").hide();
2308				$(".links_wrapper").hide();
2309				$(".comment_body_wrapper").hide();
2310				$(".all_comments").hide();
2311				$("#my_submissions").hide();
2312				$("#talk_ivrs").hide();
2313				$("#talk_featured").hide();
2314				$("#talk_discussions").hide();
2315				jQuery("#under_moderation").prependTo("#post_list-wrapper-nid-" + nid);
2316				$("#under_moderation").show();
2317
2318				$("#reset_tab").removeClass("active");
2319				$("#my_submissions_tab").removeClass("active");
2320				$("#discussions_tab").removeClass("active");
2321				$("#moderate_tab").addClass("active");
2322				return false;
2323			});
2324
2325			$('#discussions_tab').not('.mygov-ajax-processed').addClass(
2326				'mygov-ajax-processed').click(function () {
2327					var nid_val = $("#task_nid").val();
2328					if (!$(this).hasClass('mygov-ajax-processed-once')) {
2329						var base = $(this).attr('id');
2330						if ($("#discussion_nid").val()) {
2331							var nid = $("#discussion_nid").val();
2332						}
2333						else {
2334							var nid = null;
2335						}
2336
2337						var element_settings = {
2338							url: '/show-talk-discussions/' + nid,
2339							event: 'talk_discussion',
2340						};
2341
2342						Drupal.ajax[base] = new Drupal.ajax(base,
2343							this, element_settings);
2344						$(this).not(".active").trigger('talk_discussion');
2345						$(this).addClass('mygov-ajax-processed-once');
2346					}
2347					$(".links_wrapper").hide();
2348					$(".comment_body_wrapper").hide();
2349					$("#discussions_tab").addClass("active");
2350					$("#ivrs_tab").removeClass("active");
2351					$("#featured_tab").removeClass("active");
2352					$("#reset_tab").removeClass("active");
2353					$("#my_submissions_tab").removeClass("active");
2354
2355					$("#talk_ivrs").hide();
2356					$("#talk_featured").hide();
2357					$("#my_submissions").hide();
2358					$(".all_comments").hide();
2359					jQuery("#talk_discussions").prependTo("#post_list-wrapper-nid-" + nid_val);
2360					$("#talk_discussions").show();
2361					$("#under_moderation").hide();
2362					return false;
2363				});
2364
2365			//featured comment tab for talk
2366			$('#featured_tab').not('.mygov-ajax-processed').addClass(
2367				'mygov-ajax-processed').click(function () {
2368					var nid_val = $("#task_nid").val();
2369					if (!$(this).hasClass('mygov-ajax-processed-once')) {
2370						var base = $(this).attr('id');
2371						if ($("#discussion_nid").val()) {
2372							var nid = $("#discussion_nid").val();
2373						}
2374						else {
2375							var nid = null;
2376						}
2377						var element_settings = {
2378							url: '/show-featured-comments/' + nid,
2379							event: 'talk_featured',
2380						};
2381
2382						Drupal.ajax[base] = new Drupal.ajax(base,
2383							this, element_settings);
2384						$(this).not(".active").trigger('talk_featured');
2385						$(this).addClass(
2386							'mygov-ajax-processed-once');
2387
2388					}
2389					$(".links_wrapper").hide();
2390					$(".comment_body_wrapper").hide();
2391					$("#discussions_tab,#my_submissions_tab,#reset_tab").removeClass("active");
2392					$("#ivrs_tab").removeClass("active");
2393					$("#featured_tab").addClass("active");
2394
2395					$("#talk_discussions").hide();
2396					$("#under_moderation").hide();
2397					$("#talk_ivrs").hide();
2398					$("#my_submissions").hide();
2399					$(".all_comments").hide();
2400					jQuery("#talk_featured").prependTo("#post_list-wrapper-nid-" + nid_val);
2401					$("#talk_featured").show();
2402					return false;
2403				});
2404
2405			//ivrs comment tab for talk
2406			$('#ivrs_tab').not('.mygov-ajax-processed').addClass(
2407				'mygov-ajax-processed').click(function () {
2408					var nid_val = $("#task_nid").val();
2409					if (!$(this).hasClass('mygov-ajax-processed-once')) {
2410						var base = $(this).attr('id');
2411						if ($("#discussion_nid").val()) {
2412							var nid = $("#discussion_nid").val();
2413						}
2414						else {
2415							var nid = null;
2416						}
2417						var element_settings = {
2418							url: '/show-ivrs-comments/' + nid,
2419							event: 'ivrs_comments',
2420						};
2421
2422						Drupal.ajax[base] = new Drupal.ajax(base,
2423							this, element_settings);
2424						$(this).not(".active").trigger('ivrs_comments');
2425						$(this).addClass('mygov-ajax-processed-once');
2426
2427					}
2428					$(".links_wrapper").hide();
2429					$(".comment_body_wrapper").hide();
2430					$("#discussions_tab").removeClass("active");
2431					$("#featured_tab").removeClass("active");
2432					$("#ivrs_tab").addClass("active");
2433
2434					$("#talk_discussions").hide();
2435					$("#under_moderation").hide();
2436					$("#talk_featured").hide();
2437					$("#my_submissions").hide();
2438					$(".all_comments").hide();
2439					jQuery("#talk_ivrs").prependTo("#post_list-wrapper-nid-" + nid_val);
2440					$("#talk_ivrs").show();
2441					return false;
2442				});
2443		}
2444	};
2445
2446}(jQuery));
2447
2448/** Activity Page Icons Span Append **/
2449(function ($) {
2450	Drupal.behaviors.activity_page_icons = {
2451		attach: function (context, settings) {
2452
2453			// jQuery('.post').parents('div.views-row').prepend('<span class="activities_icon post_icon"></span>');
2454			// jQuery('.like').parents('div.views-row').prepend('<span class="activities_icon like_icon"></span>');
2455			// jQuery('.hour').parents('div.views-row').prepend('<span class="activities_icon hour_icon"></span>');
2456			// jQuery('.task').parents('div.views-row').prepend('<span class="activities_icon task_icon"></span>');
2457			// jQuery('.grp').parents('div.views-row').prepend('<span class="activities_icon grp_icon"></span>');
2458
2459		}
2460	}
2461
2462}(jQuery));
2463
2464/** Coment Box Show/Hide on Content Details Page **/
2465/*(function($) {
2466	Drupal.behaviors.comment_form_show = {
2467		attach : function(context, settings) {
2468
2469			jQuery('.submit_comment_button').click(function(){
2470			  jQuery('#comments form').toggle('slow');
2471			});
2472
2473		}
2474	}
2475
2476}(jQuery));*/
2477
2478
2479
2480/** Switch Group Text Change in Group select List on every page
2481(function($) {
2482	Drupal.behaviors.switch_group_select = {
2483		attach : function(context, settings) {
2484
2485		  jQuery('#edit-group option:selected').html('Select a Group');
2486                  jQuery('#edit-group-select option:selected').html('Select a Group');
2487
2488		}
2489	}
2490
2491}(jQuery));
2492**/
2493
2494
2495/** Poll Submission on selecting atleast one option from the form. **/
2496(function ($) {
2497	Drupal.behaviors.mygov_poll_form = {
2498		attach: function (context, settings) {
2499			jQuery('.vote-form input.form-submit').attr('disabled', true);
2500			jQuery('.poll_questions .field-items .field-item').each(function () {
2501				jQuery(this).find('.form-item-choice label:first').hide();
2502			});
2503			jQuery('.container').find('.vote-form').each(
2504				function () {
2505					var vote_submit = jQuery(this)
2506						.find('input.form-submit');
2507					jQuery(this).find('.choices input.form-radio')
2508						.click(
2509							function () {
2510								jQuery(vote_submit).attr(
2511									'disabled', false);
2512							});
2513				});
2514			jQuery(".node-poll h2 a").removeAttr("href");
2515			jQuery(".node-poll h2 a").css("cursor", "pointer");
2516		}
2517	};
2518
2519}(jQuery));
2520
2521/*
2522(function($, Drupal) {
2523	// put function into drupal commands:
2524	Drupal.ajax.prototype.commands.changeBrowserURL = function(ajax,
2525			response, status) {
2526		// response object as passed in our Ajax callback
2527		// do what you want in here
2528		window.history.pushState('', '', response.url);
2529	};
2530}(jQuery, Drupal));
2531*/
2532
2533
2534/** All Groups Page Sort order switch **/
2535(function ($) {
2536	Drupal.behaviors.groups_sort_by = {
2537		attach: function (context, settings) {
2538			$('#group_sort select').change(function () {
2539				var url = $(this).val(); // get selected value
2540				if (url) { // require a URL
2541					window.location = url; // redirect
2542				}
2543				return false;
2544			});
2545		}
2546	}
2547
2548}(jQuery));
2549
2550/** Comment Page Sort order switch **/
2551(function ($) {
2552	Drupal.behaviors.comment_sort_by = {
2553		attach: function (context, settings) {
2554			$('#comment_sort select').change(function () {
2555				if (jQuery('#comment_sort select option:selected').val() == 'recent') {
2556					jQuery("#edit-sort-order").change().val("DESC");
2557					jQuery("#latest_comment").hide();
2558					jQuery("#edit-submit-view-comments").click();
2559				}
2560				if (jQuery('#comment_sort select option:selected').val() == 'oldest') {
2561					jQuery("#edit-sort-order").change().val("ASC");
2562					jQuery("#latest_comment").hide();
2563					jQuery("#edit-submit-view-comments").click();
2564				}
2565				if (jQuery('#comment_sort select option:selected').val() == 'popular') {
2566					jQuery("#edit-sort-order").change().val("DESC");
2567					jQuery("#latest_comment").hide();
2568					jQuery("#edit-submit-view-comments").click();
2569				}
2570				if (jQuery('#comment_sort select option:selected').val() == 'shared') {
2571					jQuery("#edit-sort-order").change().val("ASC");
2572					jQuery("#latest_comment").hide();
2573					jQuery("#edit-submit-view-comments").click();
2574				}
2575			});
2576		}
2577	}
2578
2579}(jQuery));
2580
2581/** Set Filter Option to all page load of home page ( Do Discuss Filter Page ). **/
2582//jQuery(document).ready(function(){
2583//$("#edit-field-deadline-value-op").change().val("empty");
2584//$(".views-submit-button input").click();
2585//});
2586
2587/** Filter Operation of home page ( Do Discuss Filter Page ). **/
2588(function ($) {
2589	Drupal.behaviors.filters = {
2590		attach: function (context, settings) {
2591			var NoSubmission = Drupal.t('No Submissions found!!!');
2592			jQuery('#my_submissions .view-empty p').text(NoSubmission);
2593			$(window).on("load", function ()  {
2594				if ($('.block-do-discuss-filter .view-empty').length > 0) {
2595					// $("#edit-field-deadline-value-op").change().val("<");
2596					// $("#views-exposed-form-discussion-block-1 .views-operator #edit-field-group-issue-status-value-op").change().val("or");
2597					// $("#views-exposed-form-discussion-block-1 .views-widget #edit-field-group-issue-status-value").change().val("close");
2598					// $("#views-exposed-form-poll_list-block .views-widget #edit-active").change().val("0");
2599					// $(".views-submit-button input").click();
2600					// $("#close_filter").prop("checked", true);
2601					$("#close_filter").click();
2602				}
2603				else {
2604
2605					$("#open_filter").prop("checked", true);
2606					var sector = Drupal.t('All Sectors');
2607					var newest = Drupal.t('Newest First');
2608					$(".sector_filter .selectric-wrapper .selectric .label").change().val(sector);
2609					$("#sort_by .selectric-wrapper .selectric .label").change().val(newest);
2610					if ($('body.page-home-do').length > 0) {
2611						var openTask = Drupal.t('Open Tasks Under MyGov');
2612						if ($("#open_filter").prop("checked")) {
2613							$("#display_type_changer_wrapper h2").text(openTask);
2614						}
2615
2616					}
2617					if ($('body.page-home-discuss').length > 0) {
2618						var openDiscussion = Drupal.t('Open Discussions Under MyGov');
2619						if ($("#open_filter").prop("checked")) {
2620							$("#display_type_changer_wrapper h2").text(openDiscussion);
2621						}
2622
2623					}
2624					if ($('body.page-home-poll').length > 0) {
2625						var openPoll = Drupal.t('Open Polls/Survey Under MyGov');
2626						if ($("#open_filter").prop("checked")) {
2627							$("#display_type_changer_wrapper h2").text(openPoll);
2628						}
2629
2630					}
2631					if ($('body.page-home-talk').length > 0) {
2632						var openTalk = Drupal.t('Open Talks Under MyGov');
2633						if ($("#open_filter").prop("checked")) {
2634							$("#display_type_changer_wrapper h2").text(openTalk);
2635						}
2636
2637					}
2638				}
2639
2640
2641			});
2642
2643			$('.filter_value input').click(function () {
2644				//alert($(this).val());
2645				//if ($(this).attr('checked') !== undefined) {
2646				if ($(this).val() == 'all') {
2647					$("#edit-field-deadline-value-op").change().val("empty");
2648					$("#views-exposed-form-discussion-block-1 .views-operator #edit-field-group-issue-status-value-op").change().val("or");
2649					$("#views-exposed-form-discussion-block-1 .views-widget #edit-field-group-issue-status-value").change().val("All");
2650					$("#views-exposed-form-poll_list-block .views-widget #edit-active").change().val("All");
2651					$(".views-submit-button input").click();
2652				}
2653				if ($(this).val() == 'open') {
2654					$("#edit-field-deadline-value-op").change().val(">");
2655					$("#views-exposed-form-discussion-block-1 .views-operator #edit-field-group-issue-status-value-op").change().val("or");
2656					$("#views-exposed-form-discussion-block-1 .views-widget #edit-field-group-issue-status-value").change().val("open");
2657					$("#views-exposed-form-poll_list-block .views-widget #edit-active").change().val("1");
2658					$(".views-submit-button input").click();
2659				}
2660				if ($(this).val() == 'close') {
2661					$("#edit-field-deadline-value-op").change().val("<");
2662					$("#views-exposed-form-discussion-block-1 .views-operator #edit-field-group-issue-status-value-op").change().val("or");
2663					$("#views-exposed-form-discussion-block-1 .views-widget #edit-field-group-issue-status-value").change().val("close");
2664					$("#views-exposed-form-poll_list-block .views-widget #edit-active").change().val("
26640");
2665					$(".views-submit-button input").click();
2666				}
2667				//	}
2668				if ($('body.page-home-do').length > 0) {
2669					var allTasks = Drupal.t('All Tasks Under MyGov');
2670					var openTasks = Drupal.t('Open Tasks Under MyGov');
2671					var closedTasks = Drupal.t('Closed Tasks Under MyGov');
2672					if ($(this).val() == 'all') {
2673						$("#display_type_changer_wrapper h2").text(allTasks);
2674					}
2675					if ($(this).val() == 'open') {
2676						$("#display_type_changer_wrapper h2").text(openTasks);
2677					}
2678					if ($(this).val() == 'close') {
2679						$("#display_type_changer_wrapper h2").text(closedTasks);
2680					}
2681
2682				}
2683
2684				if ($('body.page-home-discuss').length > 0) {
2685					var allDiscussions = Drupal.t('All Discussions Under MyGov');
2686					var openDiscussions = Drupal.t('Open Discussions Under MyGov');
2687					var closedDiscussions = Drupal.t('Closed Discussions Under MyGov');
2688					if ($(this).val() == 'all') {
2689						$("#display_type_changer_wrapper h2").text(allDiscussions);
2690					}
2691					if ($(this).val() == 'open') {
2692						$("#display_type_changer_wrapper h2").text(openDiscussions);
2693					}
2694					if ($(this).val() == 'close') {
2695						$("#display_type_changer_wrapper h2").text(closedDiscussions);
2696					}
2697
2698				}
2699				if ($('body.page-home-poll').length > 0) {
2700					var allPolls = Drupal.t('All Polls/Survey Under MyGov');
2701					var openPolls = Drupal.t('Open Polls/Survey Under MyGov');
2702					var closedPolls = Drupal.t('Closed Polls/Survey Under MyGov');
2703					if ($(this).val() == 'all') {
2704						$("#display_type_changer_wrapper h2").text(allPolls);
2705					}
2706					if ($(this).val() == 'open') {
2707						$("#display_type_changer_wrapper h2").text(openPolls);
2708					}
2709					if ($(this).val() == 'close') {
2710						$("#display_type_changer_wrapper h2").text(closedPolls);
2711					}
2712
2713				}
2714				if ($('body.page-home-talk').length > 0) {
2715					var allTalks = Drupal.t('All Talks  Under MyGov');
2716					var openTalks = Drupal.t('Open Talks Under MyGov');
2717					var closedTalks = Drupal.t('Closed Talks Under MyGov');
2718					if ($(this).val() == 'all') {
2719						$("#display_type_changer_wrapper h2").text(allTalks);
2720					}
2721					if ($(this).val() == 'open') {
2722						$("#display_type_changer_wrapper h2").text(openTalks);
2723					}
2724					if ($(this).val() == 'close') {
2725						$("#display_type_changer_wrapper h2").text(closedTalks);
2726					}
2727
2728				}
2729
2730			});
2731
2732
2733		}
2734	}
2735
2736}(jQuery));
2737
2738/** Search Trigger after a word in home page ( Do Discuss Filter Page ). **/
2739(function ($) {
2740	Drupal.behaviors.search_trigger = {
2741		attach: function (context, settings) {
2742			if ($('#edit-field-hashtags-tid').val()) {
2743				var resetLabel = Drupal.t('Reset');
2744				$('.reset_view').replaceWith("<span class='reset_view'>" + resetLabel + "</span>");
2745			}
2746			else {
2747				$('.reset_view').hide();
2748			}
2749
2750			$('.reset_view').click(function (e) {
2751				$('.form-item-field-hashtags-tid input').val("");
2752				$(".views-submit-button input").click();
2753			});
2754
2755			$('#edit_search_btn').click(function (e) {
2756				var text_search = jQuery('#edit_search').val();
2757				if (jQuery(this).hasClass("search_mygov")) {
2758					var type = jQuery("#search_type").val();
2759					var urlPara = "&type=" + type;
2760						if (type == "") {
2761							urlPara = "&type=All";
2762						}else if(type == "advance_poll"){
2763							urlPara = "&type[]=advance_poll&type[]=mygov_survey";
2764						}
2765					var url = jQuery("#search_url").val();
2766					window.location = url + "?title=" + text_search + urlPara;
2767					return false;
2768				}
2769				var n = text_search.indexOf("#");
2770				var hash_text = text_search;
2771				if (n != 0 && $.trim(text_search) != "") {
2772					hash_text = '#' + text_search;
2773				}
2774				$('.form-item-field-hashtags-tid input').val(hash_text);
2775				$('#edit-title').val(text_search);
2776				$('#t_keyword').html(text_search);
2777				$(".views-submit-button input").click();
2778			});
2779			$('.the_box #search_title').keyup(function (e) {
2780				var key = e.which;
2781				if (key == 13) {
2782					$('a#search_link_btn')[0].click();
2783				}
2784			});
2785
2786			$('#search_link_btn').click(function (e) {
2787				let curUrl = '';
2788				if(jQuery("body").hasClass("i18n-hi")){
2789					curUrl = '/hi'; 
2790				}
2791				var searchValue = jQuery(".search_title_box").val();
2792				window.location = curUrl+'/search?title='+searchValue+'&type=All';				
2793			});
2794
2795			$('#edit_reset_btn').click(function (e) {
2796				if (jQuery(this).hasClass("reset_search_mygov")) {
2797					var url = jQuery("#search_url").val();
2798					window.location = url + "?title=&type=All";
2799					return false;
2800				}
2801				$('#edit-title').val("");
2802				$('#edit-type').val("All");
2803				$("#edit-sort-by").change().val("created");
2804				$("#edit-sort-order").change().val("DESC");
2805				$(".views-submit-button input").click();
2806			});
2807
2808			$('#edit_search').keyup(function (e) {
2809				if (e.keyCode == 13) {
2810					var text_search = jQuery('#edit_search').val();
2811					if (jQuery(this).hasClass("search_mygov")) {
2812						var type = jQuery("#search_type").val();
2813						var url = jQuery("#search_url").val();
2814						var urlPara = "&type=" + type;
2815						if (type == "") {
2816							urlPara = "&type=All";
2817						}else if(type == "advance_poll"){
2818							urlPara = "&type[]=advance_poll&type[]=mygov_survey";
2819						}
2820						window.location = url + "?title=" + text_search + urlPara;
2821						return false;
2822					}
2823					var n = text_search.indexOf("#");
2824					var hash_text = text_search;
2825					if (n != 0 && $.trim(text_search) != "") {
2826						hash_text = '#' + text_search;
2827					}
2828					$('.form-item-field-hashtags-tid input').val(hash_text);
2829					$('#edit-title').val(text_search);
2830					$(".views-submit-button input").click();
2831				}
2832			});
2833			$('a.hashtag_comments').click(function (e) {
2834				var text_search = jQuery(this).attr('data');
2835				var n = text_search.indexOf("#");
2836				var hash_text = text_search;
2837				if (n != 0 && $.trim(text_search) != "") {
2838					hash_text = '#' + text_search;
2839				}
2840				$('.form-item-field-hashtags-tid input').val(hash_text);
2841				$('#edit-title').val(text_search);
2842				$(".views-submit-button input").click();
2843				return false;
2844			});
2845		}
2846	}
2847
2848}(jQuery));
2849
2850/** Sort order switch of home page ( Do Discuss Filter Page ). **/
2851(function ($) {
2852	Drupal.behaviors.do_discuss_filter_sort_by = {
2853		attach: function (context, settings) {
2854			$('#sort_by select').change(function () {
2855				if (jQuery('#sort_by select option:selected').val() == 'recent') {
2856					jQuery("#edit-sort-by").change().val("created");
2857					jQuery("#edit-sort-order").change().val("DESC");
2858					jQuery(".views-submit-button input").click();
2859				}
2860				if (jQuery('#sort_by select option:selected').val() == 'oldest') {
2861					jQuery("#edit-sort-by").change().val("created");
2862					jQuery("#edit-sort-order").change().val("ASC");
2863					jQuery(".views-submit-button input").click();
2864				}
2865				if (jQuery('#sort_by select option:selected').val() == 'deadline') {
2866					jQuery("#edit-sort-by").change().val("field_deadline_value");
2867					jQuery("#edit-sort-order").change().val("DESC");
2868					jQuery(".views-submit-button input").click();
2869				}
2870				if (jQuery('#sort_by select option:selected').val() == 'popular') {
2871					jQuery("#edit-sort-by").change().val("comment_count");
2872					jQuery("#edit-sort-order").change().val("DESC");
2873					jQuery(".views-submit-button input").click();
2874				}
2875				if (jQuery('#sort_by select option:selected').val() == 'shared') {
2876					jQuery("#edit-sort-order").change().val("ASC");
2877					jQuery(".views-submit-button input").click();
2878				}
2879			});
2880		}
2881	}
2882
2883}(jQuery));
2884
2885/** Sector Filter switch of home page ( Do Discuss Filter Page ). **/
2886(function ($) {
2887	Drupal.behaviors.do_discuss_filter_sector = {
2888		attach: function (context, settings) {
2889			$('#sector_select').change(function () {
2890				var sec_val = jQuery('#sector_select option:selected').val();
2891				jQuery("#edit-field-sectors-tid-op").change().val("or");
2892				jQuery("#edit-field-sectors-tid").change().val(sec_val);
2893				jQuery(".views-submit-button input").click();
2894			});
2895		}
2896	}
2897}(jQuery));
2898
2899/** Link to us Page Image Positioning Script **/
2900(function ($) {
2901	Drupal.behaviors.link_to_us_page_script = {
2902		attach: function (context, settings) {
2903			var $container = $('#bannerHolder');
2904
2905			$container.imagesLoaded(function () {
2906				$container.masonry({
2907					itemSelector: '.linkto-us-box'
2908				});
2909			});
2910
2911		}
2912	}
2913
2914}(jQuery));
2915
2916/** Refresh Page after clicking DO button on a Task. **/
2917(function ($) {
2918	Drupal.behaviors.flag_link_update = {
2919		attach: function (context, settings) {
2920			/*if ($("#submission_type").find("a.unflag-action").length > 0) {
2921				jQuery("#team_area").show();
2922			}
2923			if ($("#submission_type").find(".unflag-disabled").length > 0) {
2924				jQuery("#team_area").show();
2925			}*/
2926			/*if ($(".invitation_wrapper .flag-reject-invitation").find(".flag.unflag-disabled").length > 0) {
2927				jQuery(".flag-accept-invitation").hide();
2928			}*/
2929			$(document).bind('flagGlobalAfterLinkUpdate', function (event, data) {
2930				if (data.flagName == 'do') {
2931					window.location.reload(true);
2932				}
2933
2934				if (data.flagName == 'reject_invitation' && data.flagStatus == 'flagged') {
2935					var id = "#invitee_" + data.contentId;
2936					jQuery(id + " .flag-accept-invitation").hide();
2937				}
2938				if (data.flagName == 'reject_invitation' && data.flagStatus == 'unflagged') {
2939					var id = "#invitee_" + data.contentId;
2940					jQuery(id + " .flag-accept-invitation").show();
2941				}
2942
2943				if (data.flagName == 'accept_invitation' && data.flagStatus == 'flagged') {
2944					var id = "#invitee_" + data.contentId;
2945					jQuery(id + " .flag-reject-invitation").remove();
2946					jQuery(".flag-reject-invitation a").click();
2947				}
2948
2949				/*if(data.flagName == 'submission_type' && data.flagStatus == 'flagged') {
2950					jQuery("#team_area").show();
2951				}
2952				if(data.flagName == 'submission_type' && data.flagStatus == 'unflagged') {
2953					jQuery("#team_area").hide();
2954				}*/
2955
2956			});
2957		}
2958	}
2959
2960}(jQuery));
2961
2962
2963/** Check availability of Team Name **/
2964(function ($) {
2965	Drupal.behaviors.team_name_check = {
2966		attach: function (context, settings) {
2967			jQuery('#ief-entity-table-edit-field-invitees-und-entities tbody .form-item.form-type-select').parent().hide();
2968			jQuery("#team-node-form #edit-title-field input").blur(function () {
2969				var team_name = encodeURIComponent(jQuery(this).val());
2970				if (team_name == "") {
2971					team_name = "null";
2972				}
2973				jQuery("#name_warning").load("/check_team_name/" + team_name);
2974				jQuery("#name_warning").show();
2975				setInterval(function () {
2976					jQuery("#name_warning").hide();
2977				}, 6000);
2978			});
2979		}
2980	}
2981}(jQuery));
2982
2983/** Adds Class to input submit button after invitee added in team node form. **/
2984(function ($) {
2985	Drupal.behaviors.add_class_input = {
2986		attach: function (context, settings) {
2987			if (jQuery(".field-name-field-invitees .fieldset-wrapper").find(".ief-entity-table").length > 0) {
2988				jQuery('body.page-node-add-team #team-node-form #edit-field-invitees-und-actions input[type="submit"]').addClass("once_add_invitee");
2989			}
2990		}
2991	}
2992}(jQuery));
2993
2994/** Adds active link to group page sorting filters. **/
2995(function ($) {
2996	Drupal.behaviors.change_groups_sort_select = {
2997		attach: function (context, settings) {
2998			if (typeof $('#group_sort').attr('id') != 'undefined') {
2999				if (($('#edit-sort-by option:selected').val()) == 'title') {
3000					$('#group_sort select option')[0].selected = true;
3001				}
3002
3003				if (($('#edit-sort-by option:selected').val()) == 'created' && ($('#edit-sort-order option:selected').val()) == 'DESC') {
3004					$('#group_sort select option')[1].selected = true;
3005				}
3006				if (($('#edit-sort-by option:selected').val()) == 'created' && ($('#edit-sort-order option:selected').val()) == 'ASC') {
3007					$('#group_sort select option')[2].selected = true;
3008				}
3009			}
3010
3011		}
3012	}
3013}(jQuery));
3014
3015/** Remove anchor from inactive links from content detail nav bar. **/
3016(function ($) {
3017	Drupal.behaviors.remove_inactive_href = {
3018		attach: function (context, settings) {
3019			jQuery('#activities a.inactive').removeAttr('href');
3020		}
3021	}
3022}(jQuery));
3023
3024/** Add image and video in comments by clicking icons. **/
3025(function ($) {
3026	Drupal.behaviors.add_image_btn = {
3027		attach: function (context, settings) {
3028			//var md = new MobileDetect(window.navigator.userAgent);
3029			//if (md.mobile() == null && md.phone() == null && md.tablet() == null) {
3030			jQuery('.field-name-field-gi-comment-file .form-managed-file .form-file').addClass('element-invisible');
3031			jQuery('.field-name-field-gi-comment-file fieldset').css('border', 'none');
3032			jQuery('.field-name-field-gi-comment-file legend').css('display', 'none');
3033			jQuery('.field-name-field-comment-file .form-managed-file .form-file').addClass('element-invisible');
3034			jQuery('.field-name-field-comment-file fieldset').css('border', 'none');
3035			//jQuery('.field-name-field-comment-file legend').css('display', 'none');
3036			//} else {
3037			//if (md.mobile()) {
3038			//    			jQuery('.field-name-field-add-image-gi').addClass('element-invisible');
3039			//    			jQuery('.field-name-field-add-image-gi').hide();
3040			//    		}
3041			//    		if (md.phone()) {
3042			//    			jQuery('.field-name-field-add-image-gi').hide();
3043			//    			jQuery('.field-name-field-add-image-gi').addClass('element-invisible');
3044			//    		}
3045			//    		if (md.tablet()) {
3046			//    			jQuery('.field-name-field-add-image-gi').hide();
3047			//    			jQuery('.field-name-field-add-image-gi').addClass('element-invisible');
3048			//    		}
3049			//    	}
3050			jQuery('.comment_body_wrapper div.field-name-field-hashtags').hide();
3051			// jQuery('.comment_body_wrapper div.field-name-field-video').hide();
3052
3053			jQuery('#add_image').once("add_image_btn", function () {
3054				jQuery(this).click(function () {
3055					jQuery('.field-name-field-gi-comment-file input.form-file').click();
3056				});
3057			});
3058
3059			jQuery('#add_image_task', context).off('click').click(function () {
3060				jQuery('.field-name-field-comment-file .form-type-managed-file input.form-file').click();
3061			});
3062		}
3063	}
3064}(jQuery));
3065
3066
3067/** Add youtube video in comments by clicking icons. **/
3068(function ($) {
3069	Drupal.behaviors.youtube_vid = {
3070		attach: function (context, settings) {
3071			jQuery('#add_youtube').once("youtube_vid", function () {
3072				jQuery(this).click(function () {
3073					jQuery('.comment_body_wrapper div.field-name-field-video').toggle();
3074				});
3075			});
3076
3077
3078		}
3079	}
3080}(jQuery));
3081
3082/** Check for IE version **/
3083function msieversion() {
3084	var ua = window.navigator.userAgent
3085	var msie = ua.indexOf("MSIE ")
3086
3087	if (msie > 0)      // If Internet Explorer, return version number
3088		return parseInt(ua.substring(msie + 5, ua.indexOf(".", msie)))
3089	else                 // If another browser, return 0
3090		return 0
3091
3092}
3093
3094/** Show content of details page after clicking See Deatils. **/
3095(function ($) {
3096	Drupal.behaviors.hide_submit_post_button = {
3097		attach: function (context, settings) {
3098             
3099			// jQuery('.node.group-issue .detail_top').hide();
3100			// jQuery('.node.task .detail_top').hide();
3101			jQuery('#see_details .collapse').hide();
3102			jQuery('#see_details .expand').show();
3103			jQuery('#see_details .expand').click(function () {
3104				jQuery('.node-details').slideDown('slow');
3105				jQuery('#see_details .collapse').show();
3106				jQuery('#see_details .expand').hide();
3107				jQuery('.short_description').hide();
3108			});
3109			jQuery('#see_details .collapse').click(function () {
3110				jQuery('.node-details').hide();
3111				jQuery('#see_details .expand').show();
3112				jQuery('.short_description').slideDown('slow');
3113				jQuery('#see_details .collapse').hide();
3114			});
3115
3116		}
3117	}
3118}(jQuery));
3119
3120/** Show Share Links in comment on button click. **/
3121(function ($) {
3122	Drupal.behaviors.show_share_links = {
3123		attach: function (context, settings) {
3124			var sharelink = Drupal.t('Share');
3125
3126			jQuery(".share_links").css('width', '30px');
3127			//jQuery(".share_links").hide();
3128			jQuery(".share_btn").html(sharelink);
3129			jQuery(".share_btn", context).click(function () {
3130				// jQuery(this).next('div.share_links').toggle();
3131			});
3132   
3133		}
3134	}
3135}(jQuery));
3136
3137/** Slide Down comment box like twitter. **/
3138(function ($) {
3139	Drupal.behaviors.slide_down_comment_box = {
3140		attach: function (context, settings) {
3141			if (!jQuery('.comment_body_wrapper').hasClass('once_pr
3141ocessed')) {
3142				jQuery('.comment_body_wrapper').hide();
3143			}
3144			jQuery('#comments form label').hide();
3145			jQuery('.logged-in .submit_comment_button').click(function () {
3146				jQuery('.bottom_nav_wrapper .links_wrapper').remove();
3147				jQuery('.comment_body_wrapper').animate({ height: 'show' });
3148				jQuery('.comment_body_wrapper').addClass('once_processed');
3149			});
3150		}
3151	}
3152}(jQuery));
3153
3154/** Display type changer. GRID and LIST view of home page blocks. **/
3155(function ($) {
3156	Drupal.behaviors.display_type_changer = {
3157		attach: function (context, settings) {
3158			jQuery('#display_type_changer a.grid').click(function () {
3159				jQuery('#-do-discuss-filter-output-wrapper').addClass('grid');
3160				jQuery('.page-groups #block-system-main').addClass('grid');
3161				jQuery('#-do-discuss-filter-output-wrapper').removeClass('list');
3162				jQuery('.page-groups #block-system-main').removeClass('list');
3163				jQuery('#display_type_changer a.grid').addClass('active');
3164				jQuery('#display_type_changer a.list').removeClass('active');
3165			});
3166			jQuery('#display_type_changer a.list').click(function () {
3167				jQuery('#-do-discuss-filter-output-wrapper').addClass('list');
3168				jQuery('.page-groups #block-system-main').addClass('list');
3169				jQuery('#-do-discuss-filter-output-wrapper').removeClass('grid');
3170				jQuery('.page-groups #block-system-main').removeClass('grid');
3171				jQuery('#display_type_changer a.grid').removeClass('active');
3172				jQuery('#display_type_changer a.list').addClass('active');
3173			});
3174
3175			// gigw keyboard show detail
3176	jQuery(".description_wrapper .title a").on('keyup', function(e) { 
3177		var keyCode = e.keyCode || e.which; 
3178
3179		if (keyCode == 9) { 
3180			jQuery(this).parents('.views-row').find('.caption_btn').show();
3181			jQuery(this).parents('.views-row').find('.blog_url').show();
3182			
3183		} 
3184	  });
3185
3186	 
3187
3188	//   jQuery(".caption_btn a").on('keydown', function(e) { 
3189	// 	var keyCode = e.keyCode || e.which; 
3190
3191	// 	if (keyCode == 9) { 
3192	// 		jQuery(this).parent('.caption_btn').hide();
3193	// 	} 
3194	//   });
3195
3196		}
3197	}
3198}(jQuery));
3199
3200/*Referal Code SMS and mail form toggle*/
3201(function ($) {
3202	Drupal.behaviors.ref_forms = {
3203		attach: function (context, settings) {
3204			$('.sms_ref', context).click(
3205				function () {
3206					jQuery('.sms_form ').removeClass('element-invisible');
3207					jQuery('.email_form ').addClass('element-invisible');
3208				});
3209			$('.email_ref', context).click(
3210				function () {
3211					jQuery('.sms_form ').addClass('element-invisible');
3212					jQuery('.email_form ').removeClass('element-invisible');
3213				});
3214			$('#sms_send').click(function () {
3215				if (!$(this).hasClass('mygov-referal-processed-once')) {
3216					var nums = $('#sms_num').val();
3217					var base = $(this).attr('id');
3218					var code = $(this).attr('data-code');
3219
3220					var element_settings = {
3221						url: '/referal_share/' + nums + '/' + code + '/sms',
3222						event: 'ref_sms_send',
3223					};
3224
3225					Drupal.ajax[base] = new Drupal.ajax(base,
3226						this, element_settings);
3227					$(this).trigger('ref_sms_send');
3228					$(this).addClass('mygov-referal-processed-once');
3229				}
3230				return false;
3231			});
3232
3233			$('#email_send').click(function () {
3234				if (!$(this).hasClass('mygov-referal-processed-once')) {
3235					var emails = $('#email_id').val();
3236					var base = $(this).attr('id');
3237					var code = $(this).attr('data-code');
3238
3239					var element_settings = {
3240						url: '/referal_share/' + emails + '/' + code + '/email',
3241						event: 'ref_email_send',
3242					};
3243
3244					Drupal.ajax[base] = new Drupal.ajax(base,
3245						this, element_settings);
3246					$(this).trigger('ref_email_send');
3247					$(this).addClass('mygov-referal-processed-once');
3248				}
3249				return false;
3250			});
3251
3252		}
3253	};
3254}(jQuery));
3255
3256/** chandra  **/
3257(function ($) {
3258	Drupal.behaviors.covidadvisary = {
3259		attach: function (context, settings) {
3260	jQuery(document).ajaxComplete(function () {
3261	
3262	jQuery('.covid .view-covid-states-advisory .view-content').each(function(){
3263	var $pArr = jQuery(this).find('.views-row ');
3264	var pArrLen = $pArr.length;
3265	if ( $pArr.parent().hasClass( 'state_book' ) ) {
3266		    $pArr.unwrap();
3267		}
3268  if(jQuery(window).width() > 767){
3269    var pPerDiv = 10;
3270	for (var i = 0;i < pArrLen;i+=pPerDiv){
3271		$pArr.filter(':eq('+i+'),:lt('+(i+pPerDiv)+'):gt('+i+')').wrapAll('<div class="state_book" />');
3272	}
3273	
3274	jQuery('.covid .view-covid-states-advisory .view-content').addClass('owl-carousel');
3275	  jQuery(this).owlCarousel({
3276		  loop:false,
3277		  nav:true,
3278		  margin:10,
3279		  responsiveClass:true,
3280		  dots:false,
3281		  navText : ["Previous","Next"],
3282		  responsive:{
3283			  0:{
3284				  items: 1
3285			  }
3286		  }
3287		  
3288	  });
3289  }
3290  else{
3291    var pPerDiv = 2;
3292	 for (var i = 0;i < pArrLen;i+=pPerDiv){
3293		$pArr.filter(':eq('+i+'),:lt('+(i+pPerDiv)+'):gt('+i+')').wrapAll('<div class="state_book" />');
3294	}
3295		jQuery(this).addClass('owl-carousel');
3296	  jQuery(this).owlCarousel({
3297		  loop:false,
3298		  nav:true,
3299		  margin:10,
3300		  responsiveClass:true,
3301		  navText : ["Previous","Next"],
3302		  responsive:{
3303			  0:{
3304				  items: 1
3305			  }
3306		  }
3307		  
3308	  });	  
3309	  }
3310	})
3311	})
3312		}}
3313		
3314
3315}(jQuery));
3316
3317document.addEventListener('play', function(e){
3318    var audios = document.getElementsByTagName('audio');
3319    for(var i = 0, len = audios.length; i < len;i++){
3320        if(audios[i] != e.target){
3321            audios[i].pause();
3322        }
3323    }
3324}, true);
3325
3326jQuery(document).ready(function($) {
3327	var tm = Math.floor(Math.random() * 9999999999);
3328		jQuery(".rddnld").attr("href",jQuery(".rddnld").attr("href")+'?'+tm);
3329	  // Handler for .ready() called.
3330		jQuery( ".covid-lang #lang" ).change(function() {
3331			var targetUrl = '/covid-19-language/?lang='+jQuery(this).val();
3332			if(jQuery(this).val() == 'hi' || jQuery(this).val() == '' || jQuery(this).val() == 'en'){
3333				var targetUrl = '/'+jQuery(this).val()+'/covid-19/';
3334			}
3335		  window.open(targetUrl, "_SELF" );
3336		});
3337		jQuery(".i18n-hi  #comments a#add_image").text("छवि/पीडीएफ जोड़ें");
3338		jQuery(".i18n-hi  #comments a#add_image").attr("title","छवि/पीडीएफ जोड़ें");
3339		jQuery('<label for="edit-id-select-1" class="element-invisible" >Country/State/District</label>').insertBefore( ".i18n-en #edit-id-select-1" );
3340		jQuery('<label for="edit-id-select-1" class="element-invisible">देश/राज्य/जिला</label>').insertBefore( ".i18n-hi #edit-id-select-1" );
3341		/*jQuery( ".covid-lang-anuvadak #lang" ).change(function() {
3342			if(jQuery( ".covid-lang-anuvadak #lang" ).val() == 'en'){
3343				var targetUrl = '/covid-19/';
3344				window.open(targetUrl, "_BLANK" );
3345			}else if(jQuery( ".covid-lang-anuvadak #lang" ).val() == 'hi'){
3346				var targetUrl = '/hi/covid-19/';
3347				window.open(targetUrl, "_BLANK" );
3348			}else{
3349				var targetUrl = '/covid-19/'+jQuery(this).val();
3350				//if(jQuery(this).val() == 'hi' || jQuery(this).val() == '' || jQuery(this).val() == 'en'){
3351					//var targetUrl = '/'+jQuery(this).val()+'/covid-19/';
3352				//}/
3353			  window.open(targetUrl, "_BLANK" );
3354			}
3355		});*/
3356		jQuery(".page-node-291871 #page-title").text(jQuery("#titleCovid").text()); // Production Covid Language
3357		jQuery(".page-node-86545 #page-title").text(jQuery("#titleCovid").text());// Staging Covid Language
3358		function numberWithCommas(x) {
3359		  var parts = new Intl.NumberFormat('en-IN', { maximumSignificantDigits: 15 }).format(x);
3360		  return parts;
3361		}
3362
3363		/*function vaccineCounter() {
3364		  jQuery.getJSON('https://cdn-api.co-vin.in/api/v1/reports/getLiveVaccination', function(data) {  
3365		    var vaccineCount = numberWithCommas(data.count);
3366		    jQuery(".vaccine-live-counts").html(vaccineCount);
3367		    //console.log(vaccineCount+'---');
3368		  });
3369		}
3370
3371
3372		 vaccineCounter();*/
3373	});
3374//Added for accordian in simple pages
3375(function ($) {
3376	Drupal.behaviors.accordian_pmay = {
3377		attach: function (context, settings) {
3378			if (jQuery('.accordian-block').length > 0) {
3379				var acc = document.getElementsByClassName("accordion");
3380				var i;
3381				for (i = 0; i < acc.length; i++) {
3382				  acc[i].addEventListener("click", function() {
3383				  	this.classList.toggle("active");
3384				    var parent = this.parentElement;
3385				    var panel = parent.nextElementSibling;
3386				    if (panel.style.maxHeight){
3387				      panel.style.maxHeight = null;
3388				    } else {
3389				      panel.style.maxHeight = panel.scrollHeight + "px";
3390				    }
3391				  });
3392				}
3393			}
3394		}
3395	}
3396}(jQuery));
3397
3398
3399/*
3400window.onbeforeunload = function (e) {
3401    e = e || window.event;
3402
3403    // For IE and Firefox prior to version 4
3404    if (e) {
3405        e.returnValue = 'Sure?';
3406    }
3407
3408    // For Safari
3409    return 'Sure?';
3410};*/
3411
3412
3413
3414
3415function state_advisory(){
3416	var stateid = '';
3417	
3418	if(jQuery("#advisory-states").val() == 'All' || jQuery("#advisory-states").val() === undefined ){
3419			var state = '35';
3420		}else{			
3421			var state = jQuery("#advisory-states").val();
3422		}
3423		stateid = '&state_id='+state;
3424		var catStr = '';
3425		var category = jQuery("#advisory-category").val();
3426		if(jQuery("#advisory-category").val() == 'All' || jQuery("#advisory-category").val() === undefined ){
3427			category = 'All';
3428		}else{
3429			category = jQuery("#advisory-category").val();
3430			var catStr = '&category_id='+jQuery("#advisory-category").val();
3431		}
3432		var curUrl = window.location.href;
3433		var curUrlArray = curUrl.split("/");
3434		var srchKey = '';
3435		var stateStr = '';
3436		var advCat = '';
3437		var title = '';
3438		/*if(!jQuery("#advisory-title").val() === undefined){
3439			title = jQuery("#advisory-title").val();
3440		}*/
3441		if(curUrlArray[3] == 'hi'){
3442			var gatData = "/hi/vaccine-state-advisory?title="+jQuery("#advisory-title").val()+"&states="+jQuery("#advisory-states").val()+"&category="+jQuery("#advisory-category").val();
3443				var srchKey = 'कीवर्ड से खोजें';
3444        var stateStr = 'राज्य';
3445        var advCat = 'सलाहकार श्रेणी';
3446        var apply = "खोजें";
3447        var noRecord = "कोई सूचना मौजूद नहीं है।";
3448		}else{
3449			var gatData = "/vaccine-state-advisory?title="+jQuery("#advisory-title").val()+"&states="+jQuery("#advisory-states").val()+"&category="+jQuery("#advisory-category").val();
3450				var srchKey = 'Search by keyword';
3451        var stateStr = 'States';
3452        var advCat = 'Advisory Category';
3453        var apply = "Apply";
3454        var noRecord = "No advisory found!";
3455		}
3456		var gatData = "https://api.mygov.in/covid-advisory/?api_key=57076294a5e2ab7fe000000112c9e964291444e07dc276e0bca2e54b"+stateid+catStr;
3457		var str = '<div class="state-covid-advisory"><divi class="view-covid-states-advisory view-id-covid_states_advisory"><div class="view-filters"> <div><div class="views-exposed-form"> <div class="views-exposed-widgets clearfix"><!--div id="edit-title-wrapper" class="views-exposed-widget views-widget-filter-title"> <label for="edit-title"> '+srchKey+'          </label><div class="views-widget"> <div class="form-item form-type-textfield form-item-title"> <input autocomplete="off" type="text" id="advisory-title" name="title" value="'+title+'" size="30" maxlength="128" class="form-text" title=""></div> </div> </div--> <div id="edit-field-advisory-states-value-wrapper" class="views-exposed-widget views-widget-filter-field_advisory_states_value"><label for="edit-field-advisory-states-value">'+stateStr+' </label> <div class="views-widget"> <div class="form-item form-type-select form-item-field-advisory-states-value"> <select id="advisory-states" name="field_advisory_states_value" class="form-select"><option value="35">Andaman and Nicobar Islands</option><option value="28">Andhra Pradesh</option><option value="12">Arunachal Pradesh</option><option value="18">Assam</option><option value="10">Bihar</option><option value="4">Chandigarh</option><option value="22">Chhattisgarh</option><option value="26">Dadra and Nagar Haveli and Daman and Diu</option><option value="7">Delhi</option><option value="30">Goa</option><option value="24">Gujarat</option><option value="6">Haryana</option><option value="2">Himachal Pradesh</option><option value="1">Jammu and Kashmir</option><option value="20">Jharkhand</option><option value="29">Karnataka</option><option value="32">Kerala</option><option value="37">Ladakh</option><option value="31">Lakshadweep</option><option value="23">Madhya Pradesh</option><option value="27">Maharashtra</option><option value="14">Manipur</option><option value="17">Meghalaya</option><option value="15">Mizoram</option><option value="13">Nagaland</option><option value="21">Odisha</option><option value="34">Puducherry</option><option value="3">Punjab</option><option value="8">Rajasthan</option><option value="11">Sikkim</option><option value="33">Tamil Nadu</option><option value="36">Telangana</option><option value="16">Tripura</option><option value="9">Uttar Pradesh</option><option value="5">Uttarakhand</option><option value="19">West Bengal</option></select></div> </div></div><div id="edit-field-advisory-category-tid-wrapper" class="views-exposed-widget views-widget-filter-field_advisory_category_tid"> <label for="advisory-category-tid"> '+advCat+' </label><div class="views-widget"> <div class="form-item form-type-select form-item-field-advisory-category-tid"> <select id="advisory-category" name="field_advisory_category_tid" class="form-select"><option value="All" selected="selected">- Any -</option><option value="352101">For Citizens</option><option value="352121">Travel Advisories</option><option value="356171">Training Material</option><option value="352541">Lockdown</option><option value="365121">Civil Aviation Advisories</option><option value="356161">Behavioural Health</option><option value="352151">For Employees</option><option value="352131">For Hospitals</option><option value="361011">Inspirational series on Healthcare</option><option value="352161">For States/Departments/Ministries</option><option value="352141">Awareness Material</option></select></div> </div> </div><div class="views-exposed-widget views-submit-button"> <input type="submit" id="edit-submit-covid-states-advisory" value="'+apply+'" class="form-submit" title="'+apply+'" onclick="state_advisory()">    </div> </div></div></div>    </div><div class="view-content owl-carousel owl-loaded owl-drag">';
3458   // alert("state_advisory");
3459    jQuery("#info-2 img.loader").show();
3460    jQuery("#info-2 .owl-stage-outer").html('');
3461		jQuery.ajax({
3462        type: 'GET',
3463        url: gatData,
3464        dataType: 'json',
3465        success: function(response) { 
3466        	var res = response['notification_data'];
3467        	//alert(res.length); 
3468        	
3469        	for(var i = 0;  i < res.length; i++){
3470        		 str += '<div class="views-row views-row-1 views-row-odd views-row-first"><div class="views-field views-field-field-advisory-date"> <div class="field-content">  <span class="date-display-single">'+res[i]['notification_date']+'</span> </div>  </div> <div class="views-field views-field-nothing"> <span class="field-content"><a href="'+res[i]['link']+'" target="_blank">'+res[i]['notification_title']+'</a></span>   </div> </div>';
3471        	}
3472        	str += '</div></div>';
3473           jQuery(".stade_advisory").html(str);
3474           jQuery("#info-2 img.loader").hide();  
3475           jQuery("#advisory-states").val(state);
3476           jQuery("#advisory-category").val(category);
3477        },
3478        error: function() {
3479        	jQuery("#info-2 img.loader").hide();
3480        },
3481        complete: function() {
3482        	jQuery("#info-2 img.loader").hide();
3483        }
3484    });
3485}
3486(function ($) {
3487	Drupal.behaviors.ajax = { 
3488    attach: function(context) {
3489    //	alert(jQuery('#comments form .form-actions input').val());
3490    	/*jQuery('#comments form .form-actions input').click(function(){
3491			  alert("The paragraph was clicked.");
3492			}); */
3493    	//Remove left image and add class for vaccination form
3494    	jQuery("#know-vaccine-status-form--3").ready(function(e){
3495    		//alert(jQuery(".beneficiary-data").length);
3496    		if(jQuery(".beneficiary-data").length > 0){
3497    			jQuery(".vaccine_status_pic").hide();
3498    			jQuery(".info-block").hide();
3499    			//jQuery(".vaccine_status_content").addClass("full");
3500    			jQuery(".vaccine-status-wrapper").addClass("full");
3501    		} 
3502			jQuery('.return-to-form').click(function(){
3503				jQuery(".vaccine-status-wrapper").removeClass("full");
3504				jQuery(".vaccine_status_pic").show();
3505    			jQuery(".info-block").show();
3506				jQuery(this).parents('#beneficiaries').hide();
3507			})
3508    	})
3509
3510    	//Vaccine js for share status/download certificate
3511    	if(jQuery('.cowin-download-icon').length > 0 ){
3512			  jQuery(".cowin-download-icon").click(function(){
3513		      var token_id = jQuery("input[name='token_val']").val();
3514		      //var beneficiary_id = jQuery("input[name='beneficiary_val']").val();
3515		      //var beneficiary_id = document.getElementsByClassName('cowin-download-icon')[0].id;
3516		      var beneficiary_id = jQuery(this).attr("id");
3517		      var lang = jQuery(this).attr("data-lang");
3518		      if(lang == 'hi') {
3519		      	errMsg = 'कुछ गलत हो गया। कृपया पुन: प्रयास करें।';
3520		      	viewCertificate = 'कृपया अपना प्रमाण पत्र देखने के लिए क्लिक करें';
3521		      } else {
3522		      	errMsg = 'Something went wrong, please try again.';
3523		      	viewCertificate = 'Please click to view your certificate';
3524		      }
3525		      //console.log('beneficiary_id='+beneficiary_id);
3526		      jQuery.ajax({
3527						url: "/api/1.0/cowin-certificate-v1",
3528						type: "POST",
3529						data: {
3530						  token : token_id,
3531						  beneficiary_id : beneficiary_id,
3532						},
3533						dataType: "json",
3534						success: function(data) {
3535							//var errMsg = Drupal.t('Something went wrong, please try again.');
3536							//var viewCertificate = Drupal.t('Please click to view your certificate');
3537							//console.log("#user-"+beneficiary_id);
3538							//console.log(data.url);
3539						  if(data.code = 200 && data.status == 'sucess') {
3540						  	jQuery("#user-"+beneficiary_id).html('<a class="pdf-file-link" href="'+data.url+'" target="_blank">'+viewCertificate+'</a>');
3541						  } else {
3542						  	jQuery("#user-"+beneficiary_id).html(errMsg);
3543						  }
3544						  //console.log(data);
3545						  //console.log(data.url);
3546						}
3547			  	});
3548			  	delete beneficiary_id;
3549				});
3550			}
3551
3552    	//select template code
3553		  jQuery(".template-info-block .badge-icon").click( function(){
3554		  	var sharedUrl = jQuery(this).attr("data-url");
3555		  	jQuery(".template-info .share-links #whatsappLink").attr("href","https://api.whatsapp.com/send?text="+sharedUrl);
3556		  	jQuery(".template-info .share-links #facebookLink").attr("href","https://www.facebook.com/sharer/sharer.php?u="+sharedUrl);
3557		  	jQuery(".template-info .share-links #twitterLink").attr("href","https://twitter.com/intent/tweet?url="+sharedUrl);
3558		  	jQuery(".template-info .share-links #linkedinLink").attr("href","https://www.linkedin.com/sharing/share-offsite/?url="+sharedUrl);
3559		  	jQuery(".template-info .share-links #mailtoLink").attr("href","mailto:?subject=I am vaccinated&amp;body=Check out this "+sharedUrl);
3560		  	
3561		  	document.getElementById("copyUrl").value = sharedUrl;
3562		  	document.getElementById("copyUrl").title = sharedUrl;
3563		  	jQuery(".vaccine_status_pic").hide();
3564		  });
3565		  
3566    	jQuery("#edit-cid").attr("placeholder","Comment ID");
3567	    jQuery('a[href^=http]').once().click(function(e){
3568	      var curUrl = window.location.href;
3569	      var curUrlArray = curUrl.split("/");
3570	      if(curUrlArray[2] == "blog.mygov.in" || curUrlArray[2] == "quiz.mygov.in"){ 
3571	      }else{                       
3572	          var url=jQuery(this).attr('href');                    
3573	          var target=jQuery(this).attr('target'); 
3574	          var urlArray = url.split("/");
3575	          var urlSpArr = urlArray[2].split(".");
3576	          if(urlArray[2] == curUrlArray[2]){ 
3577	          }else{
3578              e.preventDefault(); 
3579              var baseDomn = urlSpArr[urlSpArr.length-2]+'.'+urlSpArr[urlSpArr.length-1];                
3580	            if(urlArray[2] == "www.mygov.in"  || urlArray[2] == "mygov.in"  || urlArray[2] == "auth.mygov.in"  || urlArray[2] == "secure.mygov.in" || urlArray[2]== "xn--11b3cgab9b4bm5d.xn--h2brj9c"  || urlArray[2]== "www.xn--11b3cgab9b4bm5d.xn--h2brj9c" ||  urlArray[2] == curUrlArray[2] ){
3581	                window.location.href=url;
3582	            }
3583			// 	else if((urlArray[2] == "www.youtube.com" && urlArray[3].startsWith("watch?v=")) || (urlArray[2] == "youtube.com" && urlArray[3].startsWith("watch?v="))){
3584                
3585            //   }
3586			  else if(urlArray[2] == "youtu.be"){
3587                window.location.href=url;
3588              }else if(baseDomn == "mygov.in"){
3589                if(urlArray[4] == "login" ||  urlArray[4] == "register" ){
3590                   window.location.href=url;
3591                }else{
3592                     window.open(url, '_blank');
3593                }
3594              }else{
3595                if(jQuery("body").hasClass("i18n-hi")){
3596                    var str = "आपको एक बाहरी वेबसाइट पर रीडायरेक्ट किया जा रहा है। कृपया ध्यान दें कि माईगव बाहरी वेबसाइट के कंटेंट और गोपनीयता नीतियों के लिए ज़िम्मेदार नहीं है.";
3597                }else{
3598                    var str = "You are being redirected to an external website. Please note that MyGov Website cannot be held responsible for external websites content & privacy policies.";
3599                }                   
3600                if (confirm(str)) {
3601                	window.open(url, '_blank');
3602                  /*if(target=='_blank')
3603                    window.open(url, '_blank');
3604                  else
3605                     window.location.href=url;
3606                     */
3607                }
3608	          	}
3609	              
3610	          }
3611	      }
3612	  	});
3613		  jQuery(".beneficiary-info .share-ico").once().click(function(env){ 
3614		    env.preventDefault();
3615		    jQuery(this).toggleClass('active');
3616		   jQuery(this).parents('.beneficiary-wrapper').find('.template-info').slideToggle();
3617 
3618		})
3619		jQuery('.block-republic-day .close').once().click(function(){
3620			jQuery('.block-republic-day').hide();
3621			jQuery('.step_1').show();
3622		})
3623
3624		jQuery('#registration-for-republicday input[name="mobile"]').on('keypress', function(e) {
3625		  keys = ['0','1','2','3','4','5','6','7','8','9']
3626		  return keys.indexOf(event.key) > -1
3627	});
3628	jQuery('#registration-for-republicday input[name="total_attendees"]').on('keypress', function(e) {
3629		  keys = ['0','1','2','3','4','5','6','7','8','9']
3630		  return keys.indexOf(event.key) > -1
3631	});
3632
3633	jQuery('#registration_for_republicday input[name="otp"]').on('keypress', function(e) {
3634		  keys = ['0','1','2','3','4','5','6','7','8','9']
3635		  return keys.indexOf(event.key) > -1
3636	});
3637	jQuery('#certificate-for-republicday input[name="mobile"]').on('keypress', function(e) {
3638		  keys = ['0','1','2','3','4','5','6','7','8','9']
3639		  return keys.indexOf(event.key) > -1
3640	});
3641	jQuery('#certificate-for-republicday input[name="total_attendees"]').on('keypress', function(e) {
3642		  keys = ['0','1','2','3','4','5','6','7','8','9']
3643		  return keys.indexOf(event.key) > -1
3644	});
3645
3646	jQuery('#certificate-for-republicday input[name="otp"]').on('keypress', function(e) {
3647		  keys = ['0','1','2','3','4','5','6','7','8','9']
3648		  return keys.indexOf(event.key) > -1
3649	});
3650		  
3651    }
3652	}
3653}(jQuery));
3654
3655//Get vaccine live counts
3656/*function numberWithCommas(x) {
3657  var parts = new Intl.NumberFormat('en-IN', { maximumSignificantDigits: 15 }).format(x);
3658  return parts;
3659}
3660
3661setInterval(vaccineTimer, 10000);
3662function vaccineTimer() {
3663jQuery.getJSON('https://cdn-api.co-vin.in/api/v1/reports/getLiveVaccination', function(data) {	
3664	var vaccineCount = numberWithCommas(data.count);
3665	//var text = `Count: ${data.count}`
3666	//console.log(vaccineCount);
3667	jQuery(".vaccine-live-count").html(vaccineCount);
3668});
3669}*/
3670
3671//Remove like/dislike/reply for closed activity
3672(function ($) {
3673  Drupal.behaviors.closed_link_remove = {
3674	attach: function (context, settings) {
3675	  if (jQuery('.closed_task').length > 0) {
3676	    $('.comment_extra_links .voting_wrap').remove();
3677	    $('.comment_extra_links .links_wrapper').remove();
3678	    $('.comment_extra_links .spam_wrapper').remove();
3679	    //$('.comment_extra_links .feature_wrapper').remove();
3680	  }
3681	}
3682  }
3683}(jQuery));
3684
3685//Hide/show cards filres
3686(function ($) {
3687  Drupal.behaviors.cards_filres_remove = {
3688	attach: function (context, settings) {
3689	  if (jQuery('.no-filter').length > 0) {
3690	    $('.view-filters').remove();
3691	    /*$('#edit-field-year-value-wrapper').remove();
3692	    $('#edit-field-award-type-value-wrapper').remove();
3693	    $('#edit-shs-term-node-tid-depth-wrapper').remove();*/
3694	  }
3695	  if (jQuery('.show-country-filter').length > 0) {
3696	    $('#edit-field-year-value-wrapper').remove();
3697	    $('#edit-field-award-type-value-wrapper').remove();
3698	  }
3699	  if (jQuery('.show-year-filter').length > 0) {
3700	    $('#edit-shs-term-node-tid-depth-wrapper').remove();
3701	    $('#edit-field-award-type-value-wrapper').remove();
3702	  }
3703	}
3704  }
3705}(jQuery));
3706
3707//copy choosen template url
3708function copySharableLink() {
3709	var copyText = document.getElementById("copyUrl");
3710	navigator.clipboard.writeText(copyText.value);
3711}
3712
3713//Remove unused section
3714if (jQuery('.beneficiary-data').length > 0) {
3715	//jQuery('info-block').remove(); //Remove block text
3716  jQuery('.form-item-mobile').remove(); //Remove mobile input
3717  jQuery('#edit-get-otp').remove(); //Remove mobile input
3718}
3719
3720 //MKB slider home page
3721 
3722 if(jQuery('.mkb-doc').length > 0){
3723	jQuery('.mkb-doc .block-slider').addClass('owl-carousel');
3724	jQuery('.mkb-doc .block-slider').owlCarousel({
3725		loop:false,
3726		dots:false,
3727		nav:true,
3728		margin:15,
3729		items: 1,
3730		responsiveClass:true
3731	  })
3732  }
3733  if(jQuery('.mkb-video').length > 0){
3734	jQuery('.mkb-video .view-content').addClass('owl-carousel');
3735	jQuery('.mkb-video .view-content').owlCarousel({
3736		loop:false,
3737		dots:false,
3738		nav:true,
3739		margin:15,
3740		items: 1,
3741		responsiveClass:true
3742	  })
3743  } 
3744
3745
3746 //slider for each tab of home page
3747 jQuery('.card-slider .view-content').each(function(){
3748   jQuery(this).addClass('owl-carousel');
3749   jQuery(this).owlCarousel({
3750		loop:false,
3751		dots:true,
3752		nav:false,
3753		margin:15,
3754		responsiveClass:true,
3755	   responsive:{
3756		0:{
3757			items: 1
3758		},
3759		569:{
3760		   items:2
3761		},
3762		768:{
3763		   items:3
3764		},
3765		980:{
3766			items:4
3767		 }
3768	   }
3769		
3770	});
3771 })
3772
3773  
3774 //Whats new home page slider
3775 if(jQuery('.whats-new-slider').length > 0){
3776	jQuery('.whats-new-slider .view-content').addClass('owl-carousel');
3777	var whatsNewSlider = jQuery('.whats-new-slider .view-content');
3778	whatsNewSlider.owlCarousel({
3779		loop:true,
3780		autoplay:true,
3781		autoplayTimeout:3000,
3782		autoplayHoverPause:false,
3783		dots:true,
3784		nav:false,
3785		margin:15,
3786		items: 1
3787	  });
3788	 var wpl_btn ="<a href='javascript:void(0)' class='play-whats-new' title='Play Slider' style='display:none'>Play</a><a href='javascript:void(0)' title='Pause Slider' class='stop-whats-new'>Pause</a>"
3789     whatsNewSlider.append(wpl_btn);
3790	jQuery('.play-whats-new').on('click',function(){
3791		whatsNewSlider.trigger('play.owl.autoplay', [3000]);
3792		jQuery(this).hide();
3793		jQuery('.stop-whats-new').show();
3794	})
3795	jQuery('.stop-whats-new').on('click',function(){
3796		whatsNewSlider.trigger('stop.owl.autoplay');
3797		jQuery(this).hide();
3798		jQuery('.play-whats-new').show();
3799	})
3800	whatsNewSlider.on('resize.owl.carousel resized.owl.carousel ',
3801		function(e) {
3802			jQuery('.play-whats-new').hide();
3803			jQuery('.stop-whats-new').show();
3804	});
3805 
3806  }
3807  
3808  
3809 
3810
3811  //poll Survey home page slider 
3812 if(jQuery('.poll-survey-content').length > 0){
3813	jQuery('.poll-survey-content .view-content').addClass('owl-carousel');
3814	var surveySlider =jQuery('.poll-survey-content .view-content');
3815	surveySlider.owlCarousel({
3816		autoplay:true,
3817        autoplayTimeout:3000,
3818		autoplayHoverPause:false,
3819		loop:true,
3820		dots:true,
3821		nav:false,
3822		margin:15,
3823		items: 1,
3824		//onDragged: callback
3825	  });
3826	  var poll_btn ="<a href='javascript:void(0)' class='play-poll' title='Play Slider' style='display:none'>Play</a><a href='javascript:void(0)' title='Pause Slider' class='stop-poll'>Pause</a>"
3827     surveySlider.append(poll_btn);
3828	jQuery('.play-poll').on('click',function(){
3829		surveySlider.trigger('play.owl.autoplay', [3000]);
3830		jQuery(this).hide();
3831		jQuery('.stop-poll').show();
3832
3833		
3834	})
3835	jQuery('.stop-poll').on('click',function(){
3836		surveySlider.trigger('stop.owl.autoplay');
3837		jQuery(this).hide();
3838		jQuery('.play-poll').show();
3839	})
3840	surveySlider.on('resize.owl.carousel resized.owl.carousel ',
3841		function(e) {
3842			jQuery('.play-poll').hide();
3843			jQuery('.stop-poll').show();
3844		});
3845}
3846
3847  //Blog home page slider 
3848 if(jQuery('.blog-data').length > 0){
3849	jQuery('.blog-data .view-content').addClass('owl-carousel');
3850	var blogSlider = jQuery('.blog-data .view-content');
3851	blogSlider.owlCarousel({
3852		autoplay:true,
3853        autoplayTimeout:3000,
3854		autoplayHoverPause:false,
3855		loop:true,
3856		dots:true,
3857		nav:false,
3858		margin:15,
3859		items: 2,
3860		responsive:{
3861			0:{
3862				items: 1
3863			},
3864			569:{
3865			   items:2
3866			}
3867		   },
3868		  
3869		   
3870	  });	 
3871	 var blog_btn ="<a href='javascript:void(0)' class='play-blog' title='Play Slider' style='display:none'>Play</a><a href='javascript:void(0)' title='Pause Slider' class='stop-blog'>Pause</a>"
3872     blogSlider.append(blog_btn);
3873	jQuery('.play-blog').on('click',function(){
3874		blogSlider.trigger('play.owl.autoplay', [3000]);
3875		jQuery(this).hide();
3876		jQuery('.stop-blog').show();
3877	})
3878	jQuery('.stop-blog').on('click',function(){
3879		blogSlider.trigger('stop.owl.autoplay');
3880		jQuery(this).hide();
3881		jQuery('.play-blog').show();
3882	})
3883    blogSlider.on('resize.owl.carousel resized.owl.carousel ',
3884		function(e) {
3885			jQuery('.play-blog').hide();
3886			jQuery('.stop-blog').show();
3887		});
3888   }
3889
3890
3891var keyCodeMap = {
3892	48:"0", 49:"1", 50:"2", 51:"3", 52:"4", 53:"5", 54:"6", 55:"7", 56:"8", 57:"9", 59:";",
3893	65:"a", 66:"b", 67:"c", 68:"d", 69:"e", 70:"f", 71:"g", 72:"h", 73:"i", 74:"j", 75:"k", 76:"l",
3894	77:"m", 78:"n", 79:"o", 80:"p", 81:"q", 82:"r", 83:"s", 84:"t", 85:"u", 86:"v", 87:"w", 88:"x", 89:"y", 90:"z",
3895	96:"0", 97:"1", 98:"2", 99:"3", 100:"4", 101:"5", 102:"6", 103:"7", 104:"8", 105:"9"
3896}
3897
3898jQuery.fn.setup_navigation = function(settings) {
3899
3900settings = jQuery.extend({
3901	menuHoverClass: 'show-menu',
3902}, settings);
3903
3904// Add ARIA role to menubar and menu items
3905jQuery(this).attr('role', 'menubar').find('li').attr('role', 'menuitem');
3906
3907var top_level_links = jQuery(this).find('> li > a');
3908
3909// Added by Terrill: (removed temporarily: doesn't fix the JAWS problem after all)
3910// Add tabindex="0" to all top-level links
3911// Without at least one of these, JAWS doesn't read widget as a menu, despite all the other ARIA
3912//jQuery(top_level_links).attr('tabindex','0');
3913
3914// Set tabIndex to -1 so that top_level_links can't receive focus until menu is open
3915jQuery(top_level_links).next('.submenu')
3916	.find('a')
3917	.attr('tabIndex',-1);
3918
3919// Adding aria-haspopup for appropriate items
3920jQuery(top_level_links).each(function(){
3921	if(jQuery(this).next('.submenu').length > 0)
3922		jQuery(this).parent('li').attr('aria-haspopup', 'true');
3923});
3924
3925// jQuery(top_level_links).hover(function(){
3926// 	jQuery(this).closest('ul')
3927// 		.attr('aria-hidden', 'false')
3928// 		.find('.'+settings.menuHoverClass)
3929// 		.attr('aria-hidden', 'true')
3930// 		.removeClass(settings.menuHoverClass)
3931// 		.find('a')
3932// 		.attr('tabIndex',-1);
3933// 	jQuery(this).next('.submenu')
3934// 		.attr('aria-hidden', 'false')
3935// 		.addClass(settings.menuHoverClass)
3936// 		.find('a').attr('tabIndex',0);
3937// });
3938
3939jQuery(top_level_links).focus(function(){
3940	jQuery(this).parent('li').addClass('cm');
3941	jQuery(this).closest('ul')
3942	// Removed by Terrill
3943	// The following was adding aria-hidden="false" to root ul since menu is never hidden
3944	// and seemed to be causing flakiness in JAWS (needs more testing)
3945	// .attr('aria-hidden', 'false')
3946	.find('.'+settings.menuHoverClass)
3947	.attr('aria-hidden', 'true')
3948	.removeClass(settings.menuHoverClass)
3949	.find('a')
3950	.attr('tabIndex',-1);
3951
3952	jQuery(this).next('.submenu')
3953	.attr('aria-hidden', 'false')
3954	.addClass(settings.menuHoverClass)
3955	.find('a').attr('tabIndex',0);
3956});
3957
3958// Bind arrow keys for navigation
3959jQuery(top_level_links).keydown(function(e){
3960	if(e.keyCode == 37) {
3961		e.preventDefault();
3962		// This is the first item
3963		if(jQuery(this).parent('li').prev('li').length == 0) {
3964			jQuery(this).parents('ul').find('> li').last().find('a').first().focus();
3965		} else {
3966			jQuery(this).parent('li').prev('li').find('a').first().focus();
3967		}
3968	} else if(e.keyCode == 38) {
3969		e.preventDefault();
3970		if(jQuery(this).parent('li').find('.submenu').length > 0) {
3971			jQuery(this).parent('li').find('.submenu')
3972				.attr('aria-hidden', 'false')
3973				.addClass(settings.menuHoverClass)
3974				.find('a').attr('tabIndex',0)
3975				.last().focus();
3976		}
3977	} else if(e.keyCode == 39) {
3978		e.preventDefault();
3979		// This is the last item
3980		if(jQuery(this).parent('li').next('li').length == 0) {
3981			jQuery(this).parents('ul').find('> li').first().find('a').first().focus();
3982			jQuery(this).parent('li').removeClass('cm');
3983		} else {
3984			jQuery(this).parent('li').next('li').find('a').first().focus();
3985		}
3986	} else if(e.keyCode == 40) {
3987		e.preventDefault();
3988		if(jQuery(this).parent('li').find('.submenu').length > 0) {
3989			jQuery(this).parent('li').find('.submenu')
3990				.attr('aria-hidden', 'false')
3991				.addClass(settings.menuHoverClass)
3992				.find('a').attr('tabIndex',0)
3993				.first().focus();
3994		}
3995	} else if(e.keyCode == 13 || e.keyCode == 32) {
3996		// If submenu is hidden, open it
3997		e.preventDefault();
3998		jQuery(this).parent('li').find('.submenu[aria-hidden=true]')
3999				.attr('aria-hidden', 'false')
4000				.addClass(settings.menuHoverClass)
4001				.find('a').attr('tabIndex',0)
4002				.first().focus();
4003	} else if(e.keyCode == 27) {
4004		e.preventDefault();
4005		jQuery('.'+settings.menuHoverClass)
4006			.attr('aria-hidden', 'true')
4007			.removeClass(settings.menuHoverClass)
4008			.find('a')
4009			.attr('tabIndex',-1);
4010	} else {
4011		jQuery(this).parent('li').find('.submenu[aria-hidden=false] a').each(function(){
4012			if(jQuery(this).text().substring(0,1).toLowerCase() == keyCodeMap[e.keyCode]) {
4013				jQuery(this).focus();
4014				return false;
4015			}
4016		});
4017	}
4018});
4019
4020
4021var links = jQuery(top_level_links).parent('li').find('.submenu').find('a');
4022jQuery(links).keydown(function(e){
4023	if(e.keyCode == 38) {
4024		e.preventDefault();
4025		// This is the first item
4026		if(jQuery(this).parent('li').prev('li').length == 0) {
4027			jQuery(this).parents('.submenu').parents('li').find('a').first().focus();
4028		} else {
4029			jQuery(this).parent('li').prev('li').find('a').first().focus();
4030		}
4031	} else if(e.keyCode == 40) {
4032		e.preventDefault();
4033		if(jQuery(this).parent('li').next('li').length == 0) {
4034			jQuery(this).parents('ul').parents('li').find('a').first().focus();
4035		} else {
4036			jQuery(this).parent('li').next('li').find('a').first().focus();
4037		}
4038	} else if(e.keyCode == 27 || e.keyCode == 37) {
4039		e.preventDefault();
4040		jQuery(this)
4041			.parents('.submenu').first()
4042				.prev('a').focus()
4043				.parents('.submenu').first().find('.'+settings.menuHoverClass)
4044				.attr('aria-hidden', 'true')
4045				.removeClass(settings.menuHoverClass)
4046				.find('a')
4047				.attr('tabIndex',-1);
4048	} else if(e.keyCode == 32) {
4049		e.preventDefault();
4050		window.location = jQuery(this).attr('href');
4051	} else {
4052		var found = false;
4053		jQuery(this).parent('li').nextAll('li').find('a').each(function(){
4054			if(jQuery(this).text().substring(0,1).toLowerCase() == keyCodeMap[e.keyCode]) {
4055				jQuery(this).focus();
4056				found = true;
4057				return false;
4058			}
4059		});
4060
4061		if(!found) {
4062			jQuery(this).parent('li').prevAll('li').find('a').each(function(){
4063				if(jQuery(this).text().substring(0,1).toLowerCase() == keyCodeMap[e.keyCode]) {
4064					jQuery(this).focus();
4065					return false;
4066				}
4067			});
4068		}
4069	}
4070});
4071
4072
4073// Hide menu if click or focus occurs outside of navigation
4074jQuery(this).find('a').last().keydown(function(e){
4075	if(e.keyCode == 9) {
4076		// If the user tabs out of the navigation hide all menus
4077		jQuery('.'+settings.menuHoverClass)
4078			.attr('aria-hidden', 'true')
4079			.removeClass(settings.menuHoverClass)
4080			.find('a')
4081				.attr('tabIndex',-1);
4082	}
4083});
4084
4085jQuery(document).click(function(){ jQuery('.'+settings.menuHoverClass).attr('aria-hidden', 'true').removeClass(settings.menuHoverClass).find('a').attr('tabIndex',-1); });
4086
4087jQuery(this).click(function(e){
4088	e.stopPropagation();
4089});
4090}
4091if(jQuery(window).width() > 959){
4092jQuery('.mygov-menu').setup_navigation();
4093}
4094
4095// Mobile menu 
4096if (jQuery(window).width() < 960) {
4097	jQuery('.mygov-menu .dropdown').click(function () {
4098		jQuery(this).parent('li').siblings().find('.submenu').slideUp();
4099		jQuery(this).next('.submenu').slideToggle();
4100		jQuery(this).parent('li').toggleClass('extend_box');
4101		jQuery(this).parent('li').siblings().removeClass('extend_box');
4102
4103	})
4104}
4105
4106
4107var $slider = jQuery('.ex-logoes'); 
4108var $slide = '.row'; 
4109var $transition_time = 1000; 
4110var $time_between_slides = 1500; 
4111function slides(){ 
4112  return $slider.find($slide);
4113}
4114
4115slides().hide();
4116slides().first().addClass('active');
4117slides().first().fadeIn($transition_time);
4118
4119$function = function(){
4120      var $i = $slider.find($slide + '.active').index();
4121
4122      slides().eq($i).removeClass('active');
4123      slides().eq($i).hide();
4124
4125      if (slides().length == $i + 1) $i = -1; // loop to start
4126
4127      slides().eq($i + 1).fadeIn($transition_time);
4128      slides().eq($i + 1).addClass('active');
4129    }
4130
4131$interval = setInterval($function, $transition_time +  $time_between_slides );
4132
4133slides().on("mouseover",function(){
4134 clearInterval($interval);
4135});
4136
4137slides().on("mouseout",function(){
4138	if(checkInterval)
4139    $interval = setInterval($function, $transition_time +  $time_between_slides );
4140});
4141var checkInterval = true;
4142jQuery('.expndbtn').on("click",function(){
4143	if(checkInterval){
4144		checkInterval =false;
4145		jQuery('.extra-logo-section').addClass('expended animated fadeInRight');
4146		clearInterval($interval);
4147		 slides().show();
4148		 var exWd = jQuery('.ex-logoes .row').length*120;
4149		 jQuery('.ex-logoes').css("width", exWd);
4150	}
4151	else{
4152		checkInterval =true;
4153		jQuery('.extra-logo-section').removeClass('expended fadeInRight');
4154		jQuery('.ex-logoes').css("width", "140");
4155		slides().hide();
4156		slides().removeClass('active');
4157		slides().eq(0).show();
4158		$interval = setInterval($function, $transition_time +  $time_between_slides );
4159	}
4160	
4161	// jQuery('.ex-logoes').removeClass('ex-logoes');
4162	// jQuery('.row').removeClass('row');
4163})
4164jQuery(document).ready(function($) {
4165
4166	
4167	var lanList = ["hi","bn","as","gu","or","ml","mr","kn","pa","ta","te"];
4168	var lanListFull = ["हिन्दी","বাংলা","অসমীয়া","ગુજરાતી","ଓଡ଼ିଆ","മലയാളം","मराठी","ಕನ್ನಡ","ਪੰਜਾਬੀ","தமிழ்","తెలుగు"];
4169	var curPath = window.location.pathname;
4170	var curPathArray = curPath.split("/");
4171	var curClass = "en";
4172	var curText = "English";
4173	for(var i = 0; i < lanList.length; i++){
4174		if(lanList[i] == curPathArray[1]){
4175			curClass = lanList[i];
4176			curText = lanListFull[i];
4177		}
4178	}
4179	
4180
4181
4182
4183	jQuery(".addPoll .poll_des").hide(); 
4184	jQuery(".addPoll .poll_des").first().show();
4185	jQuery(".addPoll .poll_desc_wrapper").click(function (){
4186		jQuery(".addPoll .poll_des").hide(); 
4187		jQuery(this).siblings(".poll_des").show();
4188	});
4189
4190	jQuery("."+curClass).addClass("active");
4191	jQuery(".current_lang").text(curText);
4192
4193	var curUrl = window.location.href;
4194
4195	var curUrlArray = curUrl.split("/");
4196	if(curUrlArray[2] == "xn--0dc3cgab9b4bm5d.xn--gecrj9c"){
4197		jQuery(".current_lang").text("ગુજરાતી");
4198		jQuery(".language-switcher-locale-url li").removeClass("active");
4199		jQuery(".language-switcher-locale-url .gu").addClass("active");
4200	}else if(curUrlArray[2] == "xn--d9b3cgab9b4bm5d.xn--s9brj9c"){
4201		jQuery(".current_lang").text("ਪੰਜਾਬੀ");
4202		jQuery(".language-switcher-locale-url li").removeClass("active");
4203		jQuery(".language-switcher-locale-url .pa").addClass("active");
4204	}else if(curUrlArray[2] == "xn--p5bj3d4cc1c9scc.xn--45br5cyl"){
4205		jQuery(".current_lang").text("অসমীয়া");
4206		jQuery(".language-switcher-locale-url li").removeClass("active");
4207		jQuery(".language-switcher-locale-url .as").addClass("active");
4208	}/*else if(curUrlArray[2] == "xn--11b3cgab9b4bm5d.xn--h2brj9c"){
4209		jQuery(".current_lang").text("हिन्दी");
4210		jQuery(".language-switcher-locale-url li").removeClass("active");
4211		jQuery(".language-switcher-locale-url .hi").addClass("active");
4212	}*/else if(curUrlArray[2] == "xn--zoc3cgab9b4be4e2cd.xn--fpcrj9c3d"){
4213		jQuery(".current_lang").text("తెలుగు");
4214		jQuery(".language-switcher-locale-url li").removeClass("active");
4215		jQuery(".language-switcher-locale-url .te").addClass("active");
4216	}else if(curUrlArray[2] == "xn--ohc3cgab9b4be4e.xn--3hcrj9c"){
4217		jQuery(".current_lang").text("ଓଡ଼ିଆ");
4218		jQuery(".language-switcher-locale-url li").removeClass("active");
4219		jQuery(".language-switcher-locale-url .Or").addClass("active");
4220	}else if(curUrlArray[2] == "xn--p5b3cgab9b4be4e.xn--45brj9c"){
4221		jQuery(".current_lang").text("বাংলা");
4222		jQuery(".language-switcher-locale-url li").removeClass("active");
4223		jQuery(".language-switcher-locale-url .bn").addClass("active");
4224	}else if(curUrlArray[2] == "xn--11bp4cjb9b0be1f.xn--h2brj9c"){
4225		jQuery(".current_lang").text("मराठी");
4226		jQuery(".language-switcher-locale-url li").removeClass("active");
4227		jQuery(".language-switcher-locale-url .mr").addClass("active");
4228	}
4229	//console.log(curUrlArray[2]+":basePath===");
4230	if('undefined' === typeof window){
4231		importScripts('https://'+curUrlArray[2]+'/sites/all/themes/mygov/js/fcm_config.js');
4232	}
4233
4234	if(jQuery('#btnDownload').length > 0){
4235		const fileInput = document.querySelector("#videoUrl");
4236	    downloadBtn = document.querySelector("#btnDownload");
4237
4238		downloadBtn.addEventListener("click", e => {
4239		    e.preventDefault();
4240		    downloadBtn.innerText = "Downloading file...";
4241		    fetchFile(fileInput.value);
4242		});
4243	}
4244	if(jQuery('#btnDownload').length > 0){
4245		const fileInput = document.querySelector("#videoUrl");
4246	    downloadBtn = document.querySelector("#btnDownload");
4247
4248		downloadBtn.addEventListener("click", e => {
4249		    e.preventDefault();
4250		    downloadBtn.innerText = "Downloading file...";
4251		    fetchFile(fileInput.value);
4252		});
4253	}
4254
4255	async function fetchFile(url) {
4256    await fetch(url).then(res => res.blob()).then(file => {
4257        let tempUrl = URL.createObjectURL(file);
4258        const aTag = document.createElement("a");
4259        aTag.href = tempUrl;
4260        aTag.download = url.replace(/^.*[\\\/]/, '');
4261        document.body.appendChild(aTag);
4262        aTag.click();
4263        downloadBtn.innerText = "Download File";
4264        URL.revokeObjectURL(tempUrl);
4265        aTag.remove();
4266    }).catch(() => {
4267        alert("Failed to download file!");
4268        downloadBtn.innerText = "Download File";
4269    });
4270	}
4271    if(!jQuery( "body" ).hasClass( "logged-in" ) && jQuery.cookie("isPopShown") != 1){
4272
4273        setTimeout(function(){
4274        	var i = 25;
4275        	var interval = setInterval(function () {
4276        		i = i - 1;
4277        		if(i >= 0)
4278        	 		myFunction(i); 
4279        	}, 1000);
4280          jQuery(".login-popup").fadeIn();
4281          var expire = new Date();
4282					//set expiry to current time plus 15 minutes in milliseconds
4283					expire.setTime(expire.getTime() + (8 * 60 * 60 * 1000)); 
4284
4285          //jQuery.cookie("isPopShown", 1, { expires : expire ; SameSite=Lax;secure=true;});
4286          jQuery.cookie( "isPopShown", 1,  {
4287      			path: Drupal.settings.basePath + '; SameSite=Lax;secure=true;',      
4288      			expires: 36500
4289		    }
4290		  );
4291          //console,log("Cookie started");
4292        }, 5000);
4293        setTimeout(function(){
4294					jQuery(".login-popup").fadeOut();
4295        }, 30000);
4296    }else{
4297        jQuery(".login-popup").hide();
4298    }
4299
4300    /*
4301    *
4302    Media section
4303    *
4304    */
4305
4306    jQuery(".media-thumb-wrapper .views-row-1").hide();
4307    var id = 1;
4308    jQuery(".media-thumb-wrapper .views-row").each(function( index ) {
4309		  jQuery(this).on("click", function(){
4310		  	jQuery(".media-thumb-wrapper .video").hide();
4311		  	for(var i = 0; i <  id; i++ ){
4312        	jQuery(".media-thumb-wrapper .views-row-"+i).show();
4313        }
4314        jQuery(this).hide();
4315        var test = '<video controls   poster="https://playhls.media.nic.in/igot_vod/MyGov/PadmaV1/thumbnail/BandiRamakrishnaReddyUnsungjpeg.png" class="home-media"><source src="'+jQuery(this).find(".video").text()+'" type="video/mp4"></video>';
4316        var videoUrl = jQuery(this).find(".video .url").text();
4317        var thumbsUrl = jQuery(this).find(".video .vd-info-wrapper").attr("src");
4318        var resol = jQuery(this).find(".video .resol").text();
4319        var size = jQuery(this).find(".video .size").text();
4320        var videoCategory = jQuery(this).find(".video .videoCategory").text();
4321        var dnd = jQuery(this).find(".video .dnd").text();
4322        var ndUrl = jQuery(this).find(".video .ndUrl").text();
4323        var title = jQuery(this).find("h3").text();
4324        var dnlStr = '';
4325        if(dnd == "Yes"){
4326        	dnlStr = '<div class="video-download"><input type="hidden" name="videoUrl" id="videoUrl" value="'+videoUrl+'"><button   id="btnDownload"><i></i>Download</button></div>'; 
4327        }
4328       
4329
4330
4331       		 var topString = '<div class="video-block"><video controls   poster="'+thumbsUrl+'" class="home-media">    <source src="'+videoUrl+'" type="video/mp4">    </video> </div>  <div class="vdDetails">    <div class="vd-info-wrapper">      <h2><a href="'+ndUrl+'" >'+title+'</a></h2>      <div class="video-info"><div class="download-share-wrapper">  <div class="organizer">        <img src="/sites/all/themes/mygov/images/mygov.png" alt="MyGov India"> MyGov India  </div> <div class="video-share">   <a class="share-btn" href="javascript:void(0)"><i></i>Share</a> <div class="share-box">              <a  href="https://www.facebook.com/sharer/sharer.php?u='+ndUrl+'" title="Facebook" class="fb" >Facebook</a> <a href="https://twitter.com/intent/tweet?url='+ndUrl+'/&amp;text='+title+'"  title="witter" class="twitter">Twitter</a>           <a href="whatsapp://send?text='+title+'-'+ndUrl+'" class="whatsapp"></a>  </div>  </div> '+dnlStr+'     </div>   <div class="vsize"> <div class="videoCategory">'+videoCategory+'</div>   <div class="videoSize"><span>Video Size</span>: '+size+'</div> <div class="videoResolusion"><span>Video Resolution</span>'+resol+'</div> </div></div></div></div>';
4332
4333		  	//console.log("media :=5=: "+jQuery(this).find('img').attr('src'));
4334        jQuery(".top-video-section").html(topString); 
4335    	});
4336    	id++;
4337		});  
4338    	var whatsAppUrl = "https://whatsapp.com/channel/0029Va4WxI4ISTkQcvGgWY1H";
4339		if(jQuery("body").hasClass("i18n-hi")){
4340			whatsAppUrl = "https://whatsapp.com/channel/0029VaAo7laJZg4DOLCJhJ1x"; 
4341		} 
4342    jQuery(".vdDetails .video-share .share-box").append('<a href="'+ jQuery(".video-share .video .whatsappUrl").text()+'" class="whatsapp"></a>');
4343    jQuery(".whatsapp-wrapper .video-share .share-box").append('<a href="whatsapp://send?text=MyGov-Whats-App-Channel-'+whatsAppUrl+'" class="whatsapp"></a>');
4344
4345});
4346function pnMedia(n, type){
4347	var nxt = n + 1;
4348	var prv = n - 1;
4349	if(n < 2){
4350		prv = 4;
4351	}
4352	if(n > 3){
4353		nxt = 1;
4354	}
4355	if(type == "next"){
4356		jQuery(".media-thumbs .views-row-"+nxt).hide();
4357    var test = '<video controls   poster="'+jQuery(".media-thumbs .views-row-"+nxt).find('img').attr('src')+'" class="home-media"><source src="'+jQuery(".media-thumbs .views-row-"+nxt).find(".video").text()+'" type="video/mp4"></video>';
4358    
4359    jQuery(".media-video .video-block").html(test);
4360	}else{
4361		jQuery(".media-thumbs .views-row-"+prv).hide();
4362    var test = '<video controls   poster="'+jQuery(".media-thumbs .views-row-"+nxt).find('img').attr('src')+'" class="home-media"><source src="'+jQuery(".media-thumbs .views-row-"+prv).find(".video").text()+'" type="video/mp4"></video>';
4363    
4364  	console.log("media :=5=: "+jQuery(this).find('img').attr('src'));
4365    jQuery(".media-video .video-block").html(test);
4366	}
4367}
4368function skipLoginPopup(){
4369 		jQuery.cookie("isPopShown", 1, { expires : 30 });
4370    jQuery(".login-popup").hide();
4371}
4372/***********Media suggession page navigation***********/
4373function pageNaveSugg(nid, page){
4374	jQuery(".media_wrapper img.loader").show();
4375  jQuery.ajax({
4376    type: 'GET',
4377    url: '/video-suggession/' + nid +'/'+page,
4378    dataType: 'html',
4379    timeout: 6000,
4380    async: true,  //set false if load map with data
4381    success: function(response) { 
4382       // alert(response.length);
4383    	jQuery(".media_wrapper img.loader").hide();
4384        jQuery(".trending").html(response);
4385    }
4386  });
4387}
4388 
4389function copyUrlWhatsApp() {
4390  // Get the text field
4391  var copyText = "https://whatsapp.com/channel/0029Va4WxI4ISTkQcvGgWY1H";
4392	if(jQuery("body").hasClass("i18n-hi")){
4393		copyText = "https://whatsapp.com/channel/0029VaAo7laJZg4DOLCJhJ1x"; 
4394	} 
4395  // Select the text field
4396  //copyText.select();
4397 // copyText.setSelectionRange(0, 99999); // For mobile devices
4398
4399   // Copy the text inside the text field
4400  navigator.clipboard.writeText(copyText);
4401
4402  jQuery(".copyLinkText").text("Copied");
4403  setTimeout(function(){
4404		jQuery(".copyLinkText").text("Copy Link");
4405  }, 3000);
4406}
4407
4408function myFunction (i) {
4409	jQuery(".clock").text(i)
4410   // console.log(i);
4411}
4412
4413// jQuery(window).on('resize',function(){
4414// 	alert(window.screen.availWidth+','+window.screen.availHeight)
4415// })
4416

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.