PageSourceSearch

https://emcgazette.com/custom.js?v=1785042275

js emcgazette.com collected 2026-09-26 21:36:45 UTC 13,164 bytes, 422 lines download raw bytes

1// BEGIN: Convert Homepage HTTPS into HTTP if IFRAME ADDED
2/*
3$(document).ready(function(){
4if($('iframe[src="http://jailroster.mctx.org/"]')) {
5if (location.href.indexOf("http://") == -1) {
6location.href = location.href.replace("https://", "http://");
7}
8}
9else {
10if (location.href.indexOf("https://") == -1) {
11location.href = location.href.replace("http://", "https://");
12}
13}
14});
15*/
16
17// END: Convert Homepage HTTPS into HTTP if IFRAME ADDED
18
19// BEGIN: Popup Login from half way of article 
20/*
21$(document).ready(function(){
22if (readCookie('loginStatus') != 'Yes') {
23createCookie('curl', location.href);
24if($('#divMain').length){
25$(window).scroll(function(){
26if($('.layout_pagephoto').length){var p = $('.layout_pagephoto').height();} else {var p = 0;}
27var d = $(document).scrollTop() + $(window).height();
28var a = $('.layout_pagebody').offset().top;
29var b = $('.layout_pagebody').height() - p;
30var c = b / 2;
31var h = a + c + p;
32if (d > h) {
33$.magnificPopup.open({
34items: [
35{
36src: '/target_form.asp?sname=target_form.asp&smenu=&pform={{Login}}', 
37type: 'iframe'}],   
38gallery: { enabled: true },modal: true,
39iframe: {markup: '<div class="popup4-article">'+'<div class="mfp-iframe-scaler" >'+'<div style="display:none;" class="mfp-close"></div>'+'<iframe class="mfp-iframe" frameborder="0" allowfullscreen></iframe>'+'</div></div>'}
40});
41}
42});
43}
44}
45});
46*/
47// END: Popup Login from half way of article 
48
49
50// BEGIN: Restriction after 5 Free articles
51/*
52$(document).ready(function(){
53if($('#divMain').length){
54if(!readCookie('AIP')){
55$.getJSON("https://jsonip.com?callback=?", function (data) {
56createCookie('AIP', data.ip, 60);
57});
58}
59if (readCookie('CIP') != readCookie('AIP')) {createCookie('CIP', readCookie('AIP'), 60);}
60if (readCookie('CIP') == readCookie('AIP')) {
61if (readCookie('AN') == null) {
62createCookie('AN', '1', 60);
63}
64else if (readCookie('AN') == '1') {createCookie('AN', '2', 60);}
65else if (readCookie('AN') == '2') {createCookie('AN', '3', 60);}
66else if (readCookie('AN') == '3') {createCookie('AN', '4', 60);}
67else if (readCookie('AN') == '4') {createCookie('AN', '5', 60);}
68else if (readCookie('AN') == '5') {
69if(readCookie('loginStatus') != 'Yes'){
70createCookie('curl', location.href);
71location.href = "/target_form.asp?sname=target_form.asp&pform={{Login}}";
72}
73}
74}
75}
76});
77*/
78// END: Restriction after 5 Free articles
79// BEGIN: New Responsive Menu
80
81$(window).bind('load',function() {
82    $('#cssmenu #menu-button').css('visibility','visible');
83    $('#cssmenu ul ul').css('background-color', $('.submenubodyhorizontal').css('background-color'));
84    $('.submenubodyhorizontal').each(function(){
85    if($(this).css('display') == 'none')
86    $(this).remove();
87    });
88    if ($(window).width() > 768)
89    {
90    $('#cssmenu ul ul').each(function () {
91    if ($(this).children('li').length > 8)
92    $(this).addClass('columnsTwo');
93    else if ($(this).children('li').length > 16)
94    $(this).addClass('columnsThree');
95    else if ($(this).children('li').length > 24)
96    $(this).addClass('columnsFour');
97    else if ($(this).children('li').length > 32)
98    $(this).addClass('columnsFive');
99    });
100    }
101    });
102
103$(document).ready(function() {
104
105  $.fn.menumaker = function(options) {
106      
107      var cssmenu = $(this), settings = $.extend({
108        title: "Menu",
109        format: "dropdown",
110        sticky: false
111      }, options);
112
113      return this.each(function() {
114        cssmenu.prepend('<div id="menu-button">' + settings.title + '</div>');
115        $(this).find("#menu-button").on('click', function(){
116          $(this).toggleClass('menu-opened');
117          var mainmenu = $(this).next('ul');
118          if (mainmenu.hasClass('open')) { 
119            mainmenu.hide().removeClass('open');
120          }
121          else {
122            mainmenu.show().addClass('open');
123            if (settings.format === "dropdown") {
124              mainmenu.find('ul').show();
125            }
126          }
127        });
128
129        cssmenu.find('li ul').parent().addClass('has-sub');
130
131        multiTg = function() {
132          cssmenu.find(".has-sub").prepend('<span class="submenu-button"></span>');
133          cssmenu.find('.menubodyhorizontal').on('click', function() {
134            $(this).toggleClass('submenu-opened');
135            if ($(this).siblings('ul').hasClass('open')) {
136              $(this).siblings('ul').removeClass('open').hide();
137            }
138
139            else {
140              $(this).siblings('ul').addClass('open').show();
141            }
142          });
143       cssmenu.find('.submenu-button').on('click', function() {
144            $(this).parents('li').toggleClass('submenu-opened');
145            if ($(this).siblings('ul').hasClass('open')) {
146              $(this).siblings('ul').removeClass('open').hide();
147            }
148
149            else {
150              $(this).siblings('ul').addClass('open').show();
151            }
152          });
153        };
154
155        if (settings.format === 'multitoggle') multiTg();
156        else cssmenu.addClass('dropdown');
157
158        if (settings.sticky === true) cssmenu.css('position', 'fixed');
159
160        resizeFix = function() {
161          if ($( window ).width() > 768) {
162            cssmenu.find('ul').show();
163          }
164
165          if ($(window).width() <= 768) {
166            cssmenu.find('ul').hide().removeClass('open');
167          }
168        };
169        resizeFix();
170        return $(window).on('resize', resizeFix);
171
172      });
173  };
174});
175
176$(document).ready(function() {
177  $("#cssmenu").menumaker({
178    title: "Menu",
179    format: "multitoggle"
180  });
181
182  $("#cssmenu").prepend("");
183
184var foundActive = false, activeElement, linePosition = 0, menuLine = $("#cssmenu #menu-line"), lineWidth, defaultPosition, defaultWidth;
185
186$("#cssmenu > ul > li").each(function() {
187  if ($(this).hasClass('active')) {
188    activeElement = $(this);
189    foundActive = true;
190  }
191});
192
193if (foundActive === false) {
194  activeElement = $("#cssmenu > ul > li").first();
195}
196
197defaultWidth = lineWidth = activeElement.width();
198
199defaultPosition = linePosition = activeElement.position().left;
200
201menuLine.css("width", lineWidth);
202menuLine.css("left", linePosition);
203
204$("#cssmenu > ul > li").hover(function() {
205  activeElement = $(this);
206  lineWidth = activeElement.width();
207  linePosition = activeElement.position().left;
208  menuLine.css("width", lineWidth);
209  menuLine.css("left", linePosition);
210}, 
211function() {
212  menuLine.css("left", defaultPosition);
213  menuLine.css("width", defaultWidth);
214});
215
216});
217
218$(document).ready(function(){
219$(window).load(function(){
220$('a.menubodyhorizontal[href*="#"]').prev('.submenu-button').css('visibility', 'visible');
221});
222});
223
224$(document).ready(function(){
225if ($(window).width() <= 768) {
226$('#cssmenu > ul').css('background-color',$('#cssmenu').parent('div').css('backgroundColor'));
227$('#menu-button').css('background-color',$('#cssmenu').parent('div').css('backgroundColor'));
228}
229});
230$(window).bind('load',function(){
231if ($(window).width() <= 768) {
232$('#menu-button').toggle(function(){
233$('body').css('overflow','hidden');
234$('#cssmenu').css({'height':$(window).height() + 7, 'overflow-y':'auto', 'z-index':'9999', 'top':0, 'position':'fixed','display':'block'});
235$('#cssmenu > ul').css({'height' : $(window).height() - $('#menu-button').outerHeight(), 'overflow-y':'auto'});
236}, function(){
237$('body').css('overflow','visible');
238$('#cssmenu').css({'height':'auto','overflow-y':'auto', 'z-index':'auto', 'top':0, 'position':'relative','display':'flex'});
239$('#cssmenu > ul').css('height', 'auto');
240});
241}
242});
243
244// END: New Responsive Menu
245
246
247//BEGIN: SubMenu Footer Limit
248
249$(window).bind('load',function(){
250$('.SubMenus81').css('height', 'auto');
251$('.SubMenus81').each(function () {
252  if ($(this).height() > 84) {
253    $(this).siblings('.SeeMore81').css('display', 'block');
254  } 
255  else {
256    $(this).siblings('.SeeMore81').css('display', 'none');
257  }
258});
259$('.SubMenus81').css('height', '84px');
260$('.SeeMore81').click(function () {
261  $(this).siblings('.SubMenus81').css('height', 'auto');
262  $(this).css('display', 'none');
263});
264});
265
266//END: SubMenu Footer Limit
267
268
269// BEGIN: Footer Menu81 JS
270
271$(document).ready(function(){
272$('.SubMenus81 > div:only-child').each(function(){
273 if($(this).css('display') == 'none')
274  $(this).parents('.MenuContainer81').remove();
275});
276$('.SubMenus81 > div').each(function(){
277if($(this).css('display') == 'none')
278$(this).remove();
279});
280$('.SubMenus81 div:last-of-type').each(function(){
281$(this).find('.SubMenuFooterBullet81').css('display', 'none');
282});
283$('.SubMenus81 > div a').each(function(){
284if($(this).is(':empty'))
285$(this).parents('.MenuContainer81').remove();
286});   
287$('.Menus81 > a').each(function(){
288if(jQuery(this).attr("href") == "#")
289  $(this).css('pointer-events', 'none');
290});
291/* if($('#Menu_footer').height()>$('.c30').height())
292  $('.c30').css('height', $('#Menu_footer').height());
293else
294  $('#Menu_footer').css('height', $('.c30').height()); */
295/* $('.MenuContainer81:last-of-type').each(function(){
296$(this).find('.SubMenus81').css('border-width', 0);
297}); */
298});
299
300// END: Footer Menu81 JS
301
302
303
304
305// BEGIN: Section Layout
306
307$(document).ready(function () {
308$('.article-section-body').each(function () {
309$('.article-section-image img[src^=\'/images/blank.gif\']').parents('.article-section-image').css('display', 'none');
310if ($(window).width() > 1025) {
311$('.article-section-image img[src^=\'/images/blank.gif\']').parents('.article-section-image').siblings('.article-section-heading').css('width', '100%');
312$('.article-section-image img[src^=\'/images/blank.gif\']').parents('.article-section-image').siblings('.article-section-date').css('width', '100%');
313$('.article-section-image img[src^=\'/images/blank.gif\']').parents('.article-section-image').siblings('.article-section-body').css('width', '100%');
314}
315});
316$('.article-section-archive-label > span').click(function() {
317$('.article-section-archive-block').css('display', 'none');
318$('.article-section-archive-list').css('display', 'block');
319if($(window).width() > 1024){
320setTimeout( function(){
321$('.col1, .col2, .col3').css('height','auto');
322a = $('.col1').height();
323b = $('.col2').height();
324c = $('.col3').height();
325
326if(a > b && a > c){
327$('.col2').css('height',a);
328$('.col3').css('height',a);
329}
330if(b > a && b > c) {
331$('.col1').css('height',b);
332$('.col3').css('height',b);
333}
334if(c > a && c > b) {
335$('.col1').css('height',c);
336$('.col2').css('height',c);
337}
338},500);
339}
340});
341});
342
343$(document).ready(function(){
344$('.article-section-body').each(function () {
345if ($(this).children('span').hasClass('pagemore')) {
346$(this).next('.article-section-more').css('display', 'inline-block');
347} 
348else {
349$(this).next('.article-section-more').css('display', 'none');
350}
351$('.article-section-body').css('max-height', 'none');
352if ($(this).height() > 100) {
353$(this).next('.article-section-more').css('display', 'inline-block');
354$(this).addClass('article-shadow');
355} 
356else {
357if ($(this).children('span').hasClass('pagemore')) {
358$(this).next('.article-section-more').css('display', 'inline-block');
359$(this).addClass('article-shadow');
360}
361else
362$(this).next('.article-section-more').css('display', 'none');
363}
364$('.article-section-body').css('max-height', '100px');
365});
366});
367
368// END: Section Layout
369
370// Custom Search Bar Implementation
371function newCustomSearch(options = {}) {
372    const container = document.querySelector(options.selector || "#custom-search-box");
373
374    if (!container) return;
375
376    const currentUrl = new URL(window.location.href);
377    const currentQuery = currentUrl.searchParams.get("q") || "";
378
379    container.innerHTML = `
380        <div class="cus-search-wrapper">
381            <svg class="cus-search-icon" xmlns="http://www.w3.org/2000/svg" width="18" height="18" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24">
382                <circle cx="11" cy="11" r="7"></circle>
383                <line x1="16.65" y1="16.65" x2="21" y2="21"></line>
384            </svg>
385
386            <input 
387                type="text" 
388                class="cus-search-input" 
389                placeholder="SEARCH"
390                value="${currentQuery}"
391            >
392        </div>
393    `;
394
395    const input = container.querySelector(".cus-search-input");
396
397    // Redirect on Enter
398    input.addEventListener("keydown", function (e) {
399        if (e.key === "Enter") {
400            redirectSearch();
401        }
402    });
403
404    // Redirect on icon click
405    container.querySelector(".cus-search-icon").addEventListener("click", redirectSearch);
406
407   function redirectSearch() {
408       const value = input.value.trim();
409   
410       // Prevent empty search
411       if (!value) return;
412   
413       // Minimum 3 characters validation
414       if (value.length < 3) {
415          // alert('Please enter at least 3 characters to search.');
416          // return;
417       }
418   
419       window.location.href = `/search?q=${encodeURIComponent(value)}`;
420   }
421}
422// /Custom Search Bar Implementation

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.