PageSourceSearch

https://www.healthinsurance.org/wp-content/themes/hio/assets/js/global.js?ver=4.0.740

js healthinsurance.org collected 2026-09-24 17:43:17 UTC 101,669 bytes, 2,248 lines download raw bytes

1/************************************
2 GA Event Tracker
3 ************************************/
4function URL_filepath(){
5    this_path = document.URL.split("/");
6    this_path.splice(0,3);
7    this_path = this_path.join('/');
8    this_path = ('/' + this_path);
9    this_path = this_path.split('?');
10    this_path = this_path[0];
11    return this_path;
12}
13
14
15/***********************************
16 Mobile Detect (Simple)
17 ***********************************/
18var isMobile = {
19    Android: function() {
20        return navigator.userAgent.match(/Android/i);
21    },
22    BlackBerry: function() {
23        return navigator.userAgent.match(/BlackBerry/i);
24    },
25    iOS: function() {
26        return navigator.userAgent.match(/iPhone|iPad|iPod/i);
27    },
28    Opera: function() {
29        return navigator.userAgent.match(/Opera Mini/i);
30    },
31    Windows: function() {
32        return navigator.userAgent.match(/IEMobile/i);
33    },
34    any: function() {
35        return (isMobile.Android() || isMobile.BlackBerry() || isMobile.iOS() || isMobile.Opera() || isMobile.Windows());
36    }
37};
38
39
40jQuery(document).ready(function($){
41
42    jQuery.event.special.touchstart = {
43        setup: function( _, ns, handle ) {
44            this.addEventListener('touchstart', handle, { passive: !ns.includes('noPreventDefault') });
45        }
46    };
47    jQuery.event.special.touchmove = {
48        setup: function( _, ns, handle ) {
49            this.addEventListener('touchmove', handle, { passive: !ns.includes('noPreventDefault') });
50        }
51    };
52
53    /**
54     * Media contact form
55     */
56    var MediaContactFormBtn = jQuery('#media_contact_submit');
57    var MediaContactFormInput = jQuery('#media_contact_input');
58    var MediaContactFormMessage = jQuery('#email_sent_message');
59    MediaContactFormBtn.click(function(){
60        let form = jQuery(this).parents('form');
61        ihcMediaContactFormSubmit(form);
62    });
63
64    function ihcMediaContactFormSubmit(form){
65        form.submit(function(e) {
66            e.preventDefault();
67        }).validate({
68            ignore: [],
69            errorElement: 'span',
70            rules:{
71                media_contact_email_input: {
72                    required: true,
73                    email: true
74                },
75            },
76
77            messages:{
78                media_contact_email_input: {
79                    required: settingsGlobal.errorEmail,
80                },
81            },
82
83            submitHandler: function(a, t) {
84
85                let ajaxData = new FormData(),
86                    formParams = form.serializeArray();
87
88                jQuery.each(formParams, function(i, val) {
89                    ajaxData.append(val.name, val.value);
90                });
91
92                ajaxData.append('action', 'ihc_media_contact_form_mail');
93                ajaxData.append('sc', settingsGlobal.sc);
94
95                jQuery.ajax({
96                    url: settingsGlobal.ajaxurl,
97                    type: "POST",
98                    data: ajaxData,
99                    contentType: false,
100                    processData: false,
101                }).done(function (data) {
102                    MediaContactFormBtn.css('display', 'none');
103                    MediaContactFormInput.css('display', 'none');
104                    MediaContactFormMessage.css('display', 'block');
105                });
106            }
107        });
108
109    }
110
111    // // Back to top
112    // const takeaway = jQuery('.takeaway');
113    // const full_text_old_template = jQuery('.full_text');
114    // if (takeaway.length && full_text_old_template.length) {
115    //     let anchors = jQuery(".full_text a:not([href])");
116    //     var validAnchors = anchors;
117    //     // anchors.each(function (i, el) {
118    //     //     if(jQuery(this).parentsUntil('.full_text').next().not('h3') && jQuery(this).parentsUntil('.full_text').next().not('.hio_question')) {
119    //     //         validAnchors = validAnchors.remove(jQuery(this));
120    //     //     }
121    //     // });
122    //
123    //     const backToTopBtn = '<a href="#" class="takeaways-back-to-top" style="display: block; margin: 10px 0;">'+settingsGlobal.back_to_top+'</a>';
124    //     let validAnchorsCount = validAnchors.length;
125    //
126    //     validAnchors.each(function (i, el) {
127    //
128    //         console.log(validAnchors);
129    //         console.log(i);
130    //         console.log(validAnchorsCount);
131    //         if (i < validAnchorsCount - 1) {
132    //             if (jQuery(this).parentsUntil('.full_text').next('.hio_question').length) {
133    //                 if (jQuery(this).parentsUntil('.full_text').next('.hio_question').nextUntil('.hio_question').last().index() < 0 || jQuery(this).parentsUntil('.full_text').next('.hio_question').nextUntil('h3').last().index() < 0) {
134    //                     jQuery(this).parentsUntil('.full_text').next('.hio_question').append(backToTopBtn);
135    //                 } else {
136    //                     if (jQuery(this).parentsUntil('.full_text').next('.hio_question').nextUntil('.hio_question').last().index() < jQuery(this).parentsUntil('.full_text').next('.hio_question').nextUntil('h3').last().index()) {
137    //                         jQuery(this).parentsUntil('.full_text').next('.hio_question').nextUntil('.hio_question').last().append(backToTopBtn);
138    //                     } else {
139    //                         jQuery(this).parentsUntil('.full_text').next('.hio_question').nextUntil('h3').last().append(backToTopBtn);
140    //                     }
141    //                 }
142    //             } else {
143    //                 if (jQuery(this).parentsUntil('.full_text').next('h3').length) {
144    //                     if (jQuery(this).parentsUntil('.full_text').next('h3').nextUntil('.hio_question').last().index() < jQuery(this).parentsUntil('.full_text').nextUntil('h3').next('h3').last().index()) {
145    //                         jQuery(this).parentsUntil('.full_text').next('h3').nextUntil('.hio_question').last().append(backToTopBtn);
146    //                     } else {
147    //                         jQuery(this).parentsUntil('.full_text').next('h3').nextUntil('h3').last().append(backToTopBtn);
148    //                     }
149    //                 } else {
150    //                     if (jQuery(this).parentsUntil('.full_text').next().not('h3') && jQuery(this).parentsUntil('.full_text').next().not('.hio_question')) {
151    //                         if (jQuery(this).parentsUntil('.full_text').next().not('h3').index() < jQuery(this).parentsUntil('.full_text').next().not('.hio_question')) {
152    //                             if (jQuery(this).parentsUntil('.full_text').next().not('h3').nextUntil('h3').last().index() < jQuery(this).parentsUntil('.full_text').next().not('h3').nextUntil('.hio_question').last().index()) {
153    //                                 jQuery(this).parentsUntil('.full_text').next().not('h3').nextUntil('h3').last().append(backToTopBtn);
154    //                             } else {
155    //                                 jQuery(this).parentsUntil('.full_text').next().not('h3').nextUntil('.hio_question').last().append(backToTopBtn);
156    //                             }
157    //                         } else {
158    //                             if (jQuery(this).parentsUntil('.full_text').next().not('.hio_question').nextUntil('h3').last().index() < jQuery(this).parentsUntil('.full_text').next().not('.hio_question').nextUntil('.hio_question').last().index()) {
159    //                                 jQuery(this).parentsUntil('.full_text').next().not('.hio_question').nextUntil('h3').last().append(backToTopBtn);
160    //                             } else {
161    //                                 jQuery(this).parentsUntil('.full_text').next().not('.hio_question').nextUntil('.hio_question').last().append(backToTopBtn);
162    //                             }
163    //                         }
164    //                     }
165    //                 }
166    //             }
167    //         } else {
168    //             if (full_text_old_template.children().last().prev().is('hr')) {
169    //                 full_text_old_template.children().last().prev().before(backToTopBtn);
170    //             }
171    //         }
172    //
173    //     });
174    //     //jQuery('.full_text').append(backToTopBtn);
175    // }
176
177    // Back to top
178    // const takeaway = jQuery('.takeaway');
179    // if (takeaway.length) {
180    //     let anchors = jQuery("a:not([href])");
181    //     let full_text = document.getElementsByClassName('full_text');
182    //     const backToTopBtn = '<a href="#" class="takeaways-back-to-top">'+settingsGlobal.back_to_top+'</a>';
183    //     anchors.each(function (i, el) {
184    //         if (i !== 0) {
185    //             jQuery(this).closest('p').after(backToTopBtn);
186    //         }
187    //     });
188    //     jQuery('.full_text').append(backToTopBtn);
189    // }
190    // Back to top
191    const takeaway = jQuery('.takeaway');
192    if (takeaway.length) {
193        let anchors = jQuery("a:not([href], [class])");
194        let full_text = jQuery('.full_text').length ? jQuery('.full_text') : jQuery('.article-content');
195        let elementsFound = [];
196        let articleEndBackToTopBtnStatus = false;
197        const backToTopBtn = '<a href="#" class="takeaways-back-to-top">'+settingsGlobal.back_to_top+'</a>';
198
199        anchors.each(function (i, el) {
200            if(jQuery(this).parent('p').length) {
201                if (jQuery(this).parent().nextAll('h3').first().length) {
202                    if ((jQuery(this).parent().nextAll('.hio_question').first().index() > 0 && jQuery(this).parent().nextAll('h3').first().index() > 0) && (jQuery(this).parent().nextAll('.hio_question').first().index() < jQuery(this).parent().nextAll('h3').first().index())) {
203                        if(!elementsFound.includes(jQuery(this).parent().nextAll('.hio_question').first().index())) {
204                            jQuery(this).parent().nextAll('.hio_question').first().after(backToTopBtn);
205                            elementsFound.push(jQuery(this).parent().nextAll('.hio_question').first().index());
206                        }
207                    } else if((jQuery(this).parent().nextAll('.hio_question').first().index() > 0 && jQuery(this).parent().nextAll('h3').first().index() > 0) && (jQuery(this).parent().nextAll('.hio_question').first().index() > jQuery(this).parent().nextAll('h3').first().index())){
208                        if ((jQuery(this).parent().nextAll('h3').first().nextAll('.hio_question').first().index() > 0 && jQuery(this).parent().nextAll('h3').first().nextAll('h3').first().index() > 0) && (jQuery(this).parent().nextAll('h3').first().nextAll('.hio_question').first().index() < jQuery(this).parent().nextAll('h3').first().nextAll('h3').first().index())) {
209                            if(!elementsFound.includes('before_' + jQuery(this).parent().nextAll('h3').first().nextAll('.hio_question').first().index())) {
210                                jQuery(this).parent().nextAll('h3').first().nextAll('.hio_question').first().before(backToTopBtn);
211                                elementsFound.push('before_' + jQuery(this).parent().nextAll('h3').first().nextAll('.hio_question').first().index());
212                            }
213                        } else if((jQuery(this).parent().nextAll('h3').first().nextAll('.hio_question').first().index() > 0 && jQuery(this).parent().nextAll('h3').first().nextAll('h3').first().index() > 0) && (jQuery(this).parent().nextAll('h3').first().nextAll('.hio_question').first().index() > jQuery(this).parent().nextAll('h3').first().nextAll('h3').first().index())) {
214                            if(!elementsFound.includes('before_' + jQuery(this).parent().nextAll('h3').first().nextAll('h3').first().index())) {
215                                jQuery(this).parent().nextAll('h3').first().nextAll('h3').first().before(backToTopBtn);
216                                elementsFound.push('before_' + jQuery(this).parent().nextAll('h3').first().nextAll('h3').first().index());
217                            }
218                        } else if(jQuery(this).parent().nextAll('h3').first().nextAll('.hio_question').first().index() > 0 && jQuery(this).parent().nextAll('h3').first().nextAll('h3').first().index() < 0) {
219                            if(!elementsFound.includes('before_' + jQuery(this).parent().nextAll('h3').first().nextAll('.hio_question').first().index())) {
220                                jQuery(this).parent().nextAll('h3').first().nextAll('.hio_question').first().before(backToTopBtn);
221                                elementsFound.push('before_' + jQuery(this).parent().nextAll('h3').first().nextAll('.hio_question').first().index());
222                            }
223                        } else if(jQuery(this).parent().nextAll('h3').first().nextAll('.hio_question').first().index() < 0 && jQuery(this).parent().nextAll('h3').first().nextAll('h3').first().index() > 0) {
224                            if(!elementsFound.includes('before_' + jQuery(this).parent().nextAll('h3').first().nextAll('h3').first().index())) {
225                                jQuery(this).parent().nextAll('h3').first().nextAll('h3').first().before(backToTopBtn);
226                                elementsFound.push('before_' + jQuery(this).parent().nextAll('h3').first().nextAll('h3').first().index());
227                            }
228                        }
229                    } else if(jQuery(this).parent().nextAll('.hio_question').first().index() > 0 && jQuery(this).parent().nextAll('h3').first().index() < 0){
230                        if(!elementsFound.includes(jQuery(this).parent().nextAll('.hio_question').first().index())) {
231                            jQuery(this).parent().nextAll('.hio_question').first().after(backToTopBtn);
232                            elementsFound.push(jQuery(this).parent().nextAll('.hio_question').first().index());
233                        }
234                    } else if(jQuery(this).parent().nextAll('.hio_question').first().index() < 0 && jQuery(this).parent().nextAll('h3').first().index() > 0) {
235                        if(jQuery(this).parent().nextAll('h3').first().nextAll('h3').first().index() > 0) {
236                            if(!elementsFound.includes('before_' + jQuery(this).parent().nextAll('h3').first().nextAll('h3').first().index())) {
237                                jQuery(this).parent().nextAll('h3').first().nextAll('h3').first().before(backToTopBtn);
238                                elementsFound.push('before_' + jQuery(this).parent().nextAll('h3').first().nextAll('h3').first().index());
239                            }
240                        } else {
241                            if(!articleEndBackToTopBtnStatus) {
242                                full_text.append(backToTopBtn);
243                                articleEndBackToTopBtnStatus = true;
244                            }
245                        }
246                    }
247                } else {
248                    if ((jQuery(this).parent().nextAll('.hio_question').first().index() > 0 && jQuery(this).parent().nextAll('h4').first().index() > 0) && (jQuery(this).parent().nextAll('.hio_question').first().index() < jQuery(this).parent().nextAll('h4').first().index())) {
249                        if(!elementsFound.includes(jQuery(this).parent().nextAll('.hio_question').first().index())) {
250                            jQuery(this).parent().nextAll('.hio_question').first().after(backToTopBtn);
251                            elementsFound.push(jQuery(this).parent().nextAll('.hio_question').first().index());
252                        }
253                    } else if((jQuery(this).parent().nextAll('.hio_question').first().index() > 0 && jQuery(this).parent().nextAll('h4').first().index() > 0) && (jQuery(this).parent().nextAll('.hio_question').first().index() > jQuery(this).parent().nextAll('h4').first().index())){
254                        if ((jQuery(this).parent().nextAll('h4').first().nextAll('.hio_question').first().index() > 0 && jQuery(this).parent().nextAll('h4').first().nextAll('h4').first().index() > 0) && (jQuery(this).parent().nextAll('h4').first().nextAll('.hio_question').first().index() < jQuery(this).parent().nextAll('h4').first().nextAll('h4').first().index())) {
255                            if(!elementsFound.includes('before_' + jQuery(this).parent().nextAll('h4').first().nextAll('.hio_question').first().index())) {
256                                jQuery(this).parent().nextAll('h4').first().nextAll('.hio_question').first().before(backToTopBtn);
257                                elementsFound.push('before_' + jQuery(this).parent().nextAll('h4').first().nextAll('.hio_question').first().index());
258                            }
259                        } else if((jQuery(this).parent().nextAll('h4').first().nextAll('.hio_question').first().index() > 0 && jQuery(this).parent().nextAll('h4').first().nextAll('h4').first().index() > 0) && (jQuery(this).parent().nextAll('h4').first().nextAll('.hio_question').first().index() > jQuery(this).parent().nextAll('h4').first().nextAll('h4').first().index())) {
260                            if(!elementsFound.includes('before_' + jQuery(this).parent().nextAll('h4').first().nextAll('h4').first().index())) {
261                                jQuery(this).parent().nextAll('h4').first().nextAll('h4').first().before(backToTopBtn);
262                                elementsFound.push('before_' + jQuery(this).parent().nextAll('h4').first().nextAll('h4').first().index());
263                            }
264                        } else if(jQuery(this).parent().nextAll('h4').first().nextAll('.hio_question').first().index() > 0 && jQuery(this).parent().nextAll('h4').first().nextAll('h4').first().index() < 0) {
265                            if(!elementsFound.includes('before_' + jQuery(this).parent().nextAll('h4').first().nextAll('.hio_question').first().index())) {
266                                jQuery(this).parent().nextAll('h4').first().nextAll('.hio_question').first().before(backToTopBtn);
267                                elementsFound.push('before_' + jQuery(this).parent().nextAll('h4').first().nextAll('.hio_question').first().index());
268                            }
269                        } else if(jQuery(this).parent().nextAll('h4').first().nextAll('.hio_question').first().index() < 0 && jQuery(this).parent().nextAll('h4').first().nextAll('h4').first().index() > 0) {
270                            if(!elementsFound.includes('before_' + jQuery(this).parent().nextAll('h4').first().nextAll('h4').first().index())) {
271                                jQuery(this).parent().nextAll('h4').first().nextAll('h4').first().before(backToTopBtn);
272                                elementsFound.push('before_' + jQuery(this).parent().nextAll('h4').first().nextAll('h4').first().index());
273                            }
274                        }
275                    } else if(jQuery(this).parent().nextAll('.hio_question').first().index() > 0 && jQuery(this).parent().nextAll('h4').first().index() < 0){
276                        if(!elementsFound.includes(jQuery(this).parent().nextAll('.hio_question').first().index())) {
277                            jQuery(this).parent().nextAll('.hio_question').first().after(backToTopBtn);
278                            elementsFound.push(jQuery(this).parent().nextAll('.hio_question').first().index());
279                        }
280                    } else if(jQuery(this).parent().nextAll('.hio_question').first().index() < 0 && jQuery(this).parent().nextAll('h4').first().index() > 0) {
281                        if(jQuery(this).parent().nextAll('h4').first().nextAll('h4').first().index() > 0) {
282                            if(!elementsFound.includes('before_' + jQuery(this).parent().nextAll('h4').first().nextAll('h4').first().index())) {
283                                jQuery(this).parent().nextAll('h4').first().nextAll('h4').first().before(backToTopBtn);
284                                elementsFound.push('before_' + jQuery(this).parent().nextAll('h4').first().nextAll('h4').first().index());
285                            }
286                        } else {
287                            if(!articleEndBackToTopBtnStatus) {
288                                full_text.append(backToTopBtn);
289                                articleEndBackToTopBtnStatus = true;
290                            }
291                        }
292                    }
293                }
294            } else {
295                if (jQuery(this).nextAll('h3').first().length) {
296                    if ((jQuery(this).nextAll('.hio_question').first().index() > 0 && jQuery(this).nextAll('h3').first().index() > 0) && (jQuery(this).nextAll('.hio_question').first().index() < jQuery(this).nextAll('h3').first().index())) {
297                        if(!elementsFound.includes(jQuery(this).nextAll('.hio_question').first().index())) {
298                            jQuery(this).nextAll('.hio_question').first().after(backToTopBtn);
299                            elementsFound.push(jQuery(this).nextAll('.hio_question').first().index());
300                        }
301                    } else if((jQuery(this).nextAll('.hio_question').first().index() > 0 && jQuery(this).nextAll('h3').first().index() > 0) && (jQuery(this).nextAll('.hio_question').first().index() > jQuery(this).nextAll('h3').first().index())){
302                        if ((jQuery(this).nextAll('h3').first().nextAll('.hio_question').first().index() > 0 && jQuery(this).nextAll('h3').first().nextAll('h3').first().index() > 0) && (jQuery(this).nextAll('h3').first().nextAll('.hio_question').first().index() < jQuery(this).nextAll('h3').first().nextAll('h3').first().index())) {
303                            if(!elementsFound.includes('before_' + jQuery(this).nextAll('h3').first().nextAll('.hio_question').first().index())) {
304                                jQuery(this).nextAll('h3').first().nextAll('.hio_question').first().before(backToTopBtn);
305                                elementsFound.push('before_' + jQuery(this).nextAll('h3').first().nextAll('.hio_question').first().index());
306                            }
307                        } else if((jQuery(this).nextAll('h3').first().nextAll('.hio_question').first().index() > 0 && jQuery(this).nextAll('h3').first().nextAll('h3').first().index() > 0) && (jQuery(this).nextAll('h3').first().nextAll('.hio_question').first().index() > jQuery(this).nextAll('h3').first().nextAll('h3').first().index())) {
308                            if(!elementsFound.includes('before_' + jQuery(this).nextAll('h3').first().nextAll('h3').first().index())) {
309                                jQuery(this).nextAll('h3').first().nextAll('h3').first().before(backToTopBtn);
310                                elementsFound.push('before_' + jQuery(this).nextAll('h3').first().nextAll('h3').first().index());
311                            }
312                        } else if(jQuery(this).nextAll('h3').first().nextAll('.hio_question').first().index() > 0 && jQuery(this).nextAll('h3').first().nextAll('h3').first().index() < 0) {
313                            if(!elementsFound.includes('before_' + jQuery(this).nextAll('h3').first().nextAll('.hio_question').first().index())) {
314                                jQuery(this).nextAll('h3').first().nextAll('.hio_question').first().before(backToTopBtn);
315                                elementsFound.push('before_' + jQuery(this).nextAll('h3').first().nextAll('.hio_question').first().index());
316                            }
317                        } else if(jQuery(this).nextAll('h3').first().nextAll('.hio_question').first().index() < 0 && jQuery(this).nextAll('h3').first().nextAll('h3').first().index() > 0) {
318                            if(!elementsFound.includes('before_' + jQuery(this).nextAll('h3').first().nextAll('h3').first().index())) {
319                                jQuery(this).nextAll('h3').first().nextAll('h3').first().before(backToTopBtn);
320                                elementsFound.push('before_' + jQuery(this).nextAll('h3').first().nextAll('h3').first().index());
321                            }
322                        }
323                    } else if(jQuery(this).nextAll('.hio_question').first().index() > 0 && jQuery(this).nextAll('h3').first().index() < 0){
324                        if(!elementsFound.includes(jQuery(this).nextAll('.hio_question').first().index())) {
325                            jQuery(this).nextAll('.hio_question').first().after(backToTopBtn);
326                            elementsFound.push(jQuery(this).nextAll('.hio_question').first().index());
327                        }
328                    } else if(jQuery(this).nextAll('.hio_question').first().index() < 0 && jQuery(this).nextAll('h3').first().index() > 0) {
329                        if(jQuery(this).nextAll('h3').first().nextAll('h3').first().index() > 0) {
330                            if(!elementsFound.includes('before_' + jQuery(this).nextAll('h3').first().nextAll('h3').first().index())) {
331                                jQuery(this).nextAll('h3').first().nextAll('h3').first().before(backToTopBtn);
332                                elementsFound.push('before_' + jQuery(this).nextAll('h3').first().nextAll('h3').first().index());
333                            }
334                        } else {
335                            if(!articleEndBackToTopBtnStatus) {
336                                full_text.append(backToTopBtn);
337                                articleEndBackToTopBtnStatus = true;
338                            }
339                        }
340                    }
341                } else {
342                    if ((jQuery(this).nextAll('.hio_question').first().ind
342ex() > 0 && jQuery(this).nextAll('h4').first().index() > 0) && (jQuery(this).nextAll('.hio_question').first().index() < jQuery(this).nextAll('h4').first().index())) {
343                        if(!elementsFound.includes(jQuery(this).nextAll('.hio_question').first().index())) {
344                            jQuery(this).nextAll('.hio_question').first().after(backToTopBtn);
345                            elementsFound.push(jQuery(this).nextAll('.hio_question').first().index());
346                        }
347                    } else if((jQuery(this).nextAll('.hio_question').first().index() > 0 && jQuery(this).nextAll('h4').first().index() > 0) && (jQuery(this).nextAll('.hio_question').first().index() > jQuery(this).nextAll('h4').first().index())){
348                        if ((jQuery(this).nextAll('h4').first().nextAll('.hio_question').first().index() > 0 && jQuery(this).nextAll('h4').first().nextAll('h4').first().index() > 0) && (jQuery(this).nextAll('h4').first().nextAll('.hio_question').first().index() < jQuery(this).nextAll('h4').first().nextAll('h4').first().index())) {
349                            if(!elementsFound.includes('before_' + jQuery(this).nextAll('h4').first().nextAll('.hio_question').first().index())) {
350                                jQuery(this).nextAll('h4').first().nextAll('.hio_question').first().before(backToTopBtn);
351                                elementsFound.push('before_' + jQuery(this).nextAll('h4').first().nextAll('.hio_question').first().index());
352                            }
353                        } else if((jQuery(this).nextAll('h4').first().nextAll('.hio_question').first().index() > 0 && jQuery(this).nextAll('h4').first().nextAll('h4').first().index() > 0) && (jQuery(this).nextAll('h4').first().nextAll('.hio_question').first().index() > jQuery(this).nextAll('h4').first().nextAll('h4').first().index())) {
354                            if(!elementsFound.includes('before_' + jQuery(this).nextAll('h4').first().nextAll('h4').first().index())) {
355                                jQuery(this).nextAll('h4').first().nextAll('h4').first().before(backToTopBtn);
356                                elementsFound.push('before_' + jQuery(this).nextAll('h4').first().nextAll('h4').first().index());
357                            }
358                        } else if(jQuery(this).nextAll('h4').first().nextAll('.hio_question').first().index() > 0 && jQuery(this).nextAll('h4').first().nextAll('h4').first().index() < 0) {
359                            if(!elementsFound.includes('before_' + jQuery(this).nextAll('h4').first().nextAll('.hio_question').first().index())) {
360                                jQuery(this).nextAll('h4').first().nextAll('.hio_question').first().before(backToTopBtn);
361                                elementsFound.push('before_' + jQuery(this).nextAll('h4').first().nextAll('.hio_question').first().index());
362                            }
363                        } else if(jQuery(this).nextAll('h4').first().nextAll('.hio_question').first().index() < 0 && jQuery(this).nextAll('h4').first().nextAll('h4').first().index() > 0) {
364                            if(!elementsFound.includes('before_' + jQuery(this).nextAll('h4').first().nextAll('h4').first().index())) {
365                                jQuery(this).nextAll('h4').first().nextAll('h4').first().before(backToTopBtn);
366                                elementsFound.push('before_' + jQuery(this).nextAll('h4').first().nextAll('h4').first().index());
367                            }
368                        }
369                    } else if(jQuery(this).nextAll('.hio_question').first().index() > 0 && jQuery(this).nextAll('h4').first().index() < 0){
370                        if(!elementsFound.includes(jQuery(this).nextAll('.hio_question').first().index())) {
371                            jQuery(this).nextAll('.hio_question').first().after(backToTopBtn);
372                            elementsFound.push(jQuery(this).nextAll('.hio_question').first().index());
373                        }
374                    } else if(jQuery(this).nextAll('.hio_question').first().index() < 0 && jQuery(this).nextAll('h4').first().index() > 0) {
375                        if(jQuery(this).nextAll('h4').first().nextAll('h4').first().index() > 0) {
376                            if(!elementsFound.includes('before_' + jQuery(this).nextAll('h4').first().nextAll('h4').first().index())) {
377                                jQuery(this).nextAll('h4').first().nextAll('h4').first().before(backToTopBtn);
378                                elementsFound.push('before_' + jQuery(this).nextAll('h4').first().nextAll('h4').first().index());
379                            }
380                        } else {
381                            if(!articleEndBackToTopBtnStatus) {
382                                full_text.append(backToTopBtn);
383                                articleEndBackToTopBtnStatus = true;
384                            }
385                        }
386                    }
387                }
388            }
389        });
390        //jQuery('.info-section').append(backToTopBtn);
391    }
392
393    const takeaways_button = jQuery('.takeaways-back-to-top');
394    takeaways_button.click(function (event) {
395        event.preventDefault();
396        // Store hash
397        let hashURL = jQuery(this).attr("href");
398
399        // Make sure this.hash has a value before overriding default behavior
400        if (hashURL !== "") {
401            //Animate scroll down | change URL
402            jQuery('html, body').animate({
403                scrollTop: takeaway.offset().top - 100
404            }, 300, function (){
405                history.replaceState(null, document.title , window.location.pathname + hashURL);
406            });
407        }
408    });
409    // End back to top
410
411    // Run Adobe Accessible Mega Menu on the top navigation
412    $("nav.header_nav").accessibleMegaMenu({
413        // prefix for generated unique id attributes, which are required to indicate aria-owns, aria-controls and aria-labelledby
414        uuidPrefix: "accessible-megamenu",
415
416        // CSS class of top level ul
417        menuClass: "top_level",
418
419        // CSS class of items in the top level which have submenus
420        topNavItemClass: "top_level_item",
421
422        // CSS class of the part which drops down
423        panelClass: "second_level",
424
425        // CSS class for the ul within the panel which drops down
426        panelGroupClass: "second_level_group",
427
428        // css class for the hover state
429        hoverClass: "hover",
430
431        // css class for the focus state
432        focusClass: "focus",
433
434        // css class for the open state
435        openClass: "open",
436
437        // Delay between mousing in/out that it should open/close, milliseconds, original values 333 and 333 or 0
438        openDelay: 25,
439        closeDelay: 100
440    });
441
442    // disable clicks on elements with empty hrefs... (captures focus+ (enter/return) on keyboards, too)
443    $("nav.header_nav ul > li a").click(function(){
444        if($(this).attr('href') == ''){
445            return false;
446        }
447    });
448
449    /* Open and close the search form panel */
450    $('.search_button').click(function(event) {
451        event.preventDefault();
452        if ( $('#search_panel').hasClass('hide') ) {
453            $('#search_panel').removeClass('hide');
454            $('#search_panel').attr('aria-hidden', "false");
455            $(this).attr('aria-expanded', "true");
456            $('.desktop_search_input').focus();
457        } else {
458            $('#search_panel').addClass('hide');
459            $('#search_panel').attr('aria-hidden', "true");
460            $(this).attr('aria-expanded', "false");
461        }
462    });
463    var active_menu_parent_item;
464    /* Open header menu desktop */
465    jQuery('header.simple .header_wrapper .header_bottom nav > ul > li').on('mouseenter', function (){
466        let parent = jQuery(this).attr('id');
467        let child_selector = '.simple_sub_menu_wrapper .simple_sub_menu[data-parent="' + parent + '"]';
468        active_menu_parent_item = jQuery(this);
469        jQuery('header.simple .header_wrapper .header_bottom nav > ul > li').not(this).removeClass('opened');
470        jQuery('.simple_sub_menu_wrapper .simple_sub_menu').removeClass('opened');
471        jQuery(this).addClass('opened');
472        jQuery(child_selector).addClass('opened');
473    });
474    jQuery('header.simple .header_wrapper .header_bottom nav > ul > li').on('mouseleave', function (){
475        if(!jQuery('.simple_sub_menu_wrapper .simple_sub_menu').hasClass('opened')){
476            jQuery('header.simple .header_wrapper .header_bottom nav > ul > li').removeClass('opened');
477        }
478    });
479    jQuery('.simple_sub_menu_wrapper .simple_sub_menu').on('mouseenter', function (){
480        jQuery(this).addClass('opened');
481        active_menu_parent_item.addClass('opened')
482    });
483    jQuery('.simple_sub_menu_wrapper .simple_sub_menu').on('mouseleave', function (){
484        jQuery(this).removeClass('opened');
485        jQuery('header.simple .header_wrapper .header_bottom nav > ul > li').removeClass('opened');
486    });
487    jQuery('header.simple .header_wrapper .header_bottom .header_menu .simple_header_nav').on('mouseleave', function (){
488        jQuery('.simple_sub_menu_wrapper .simple_sub_menu').removeClass('opened');
489        if(!jQuery('.simple_sub_menu_wrapper .simple_sub_menu').hasClass('opened')){
490            active_menu_parent_item.removeClass('opened');
491        }
492    });
493    jQuery('.simple_sub_menu_wrapper .simple_second_level_parent').on('click', function () {
494        jQuery('.simple_second_level_parent').not(this).removeClass('opened');
495        jQuery(this).toggleClass('opened');
496
497        jQuery('.simple_third_level_sub_menu').not(jQuery(this).next('.simple_third_level_sub_menu')).slideUp();
498        jQuery(this).next('.simple_third_level_sub_menu').slideToggle();
499    });
500
501
502
503    /* Change header size and appearance on scroll */
504    // $(window).scroll(function() {
505    //     var scroll = $(window).scrollTop();
506    //     if (scroll >= 300) {
507    //         //$('header.main').addClass('slim');
508    //         //$('header.simple').addClass('slim');
509    //         //$('.mobile_quotes_panel').addClass('docked');
510    //         //$('.get_a_quote_popup_wrapper #popupForGetAQuote .form-row div.form_block.submit label').addClass('phone');
511    //     } else {
512    //         //$('header.main').removeClass('slim');
513    //         //$('header.simple').removeClass('slim');
514    //         //$('.mobile_quotes_panel').removeClass('docked');
515    //         //$('.get_a_quote_popup_wrapper #popupForGetAQuote .form-row div.form_block.submit label').removeClass('phone');
516    //     }
517    // });
518
519    /* Enforce values must come from datalist for selecting state on state root pages */
520    $('input.force_valid').on('input', function(event) {
521        var uservalue = $(this).val();
522        var list = $(this).attr('list');
523        var match = $('#' + list + ' option').filter(function() {
524            return ($(this).val() === uservalue);
525        });
526        if (match.length > 0) {
527            // console.log('User value is in the list');
528            document.location.href=match.data('url');
529        } else {
530            // console.log('User value not in the list');
531        }
532    });
533
534    /* Add qtip error messages to zip code form; relocate out of default into form? */
535    if(jQuery().qtip) {
536        $('span.error_icon').qtip({
537            position: {
538                my: 'left center',
539                at: 'right center'
540            },
541            style: {classes: 'qtip_error'}
542        });
543    }
544
545    /* Close button for quote forms */
546    $('.zip_code_form .close_button').click(function(event) {
547        event.preventDefault();
548        $(this).parent().slideUp();
549    });
550
551
552    /* Open external links in a new window */
553    $('a[rel="external"]').each(function() {
554        $(this).attr('target', '_blank');
555    });
556
557    /* Open link in new window for desktop (non-mobile) devices */
558    $('a[rel="desktop_external"]').click(function() {
559        if(!isMobile.any()){
560            // desktop, open new window.
561            $(this).attr('target', '_blank');
562        }
563    });
564
565
566    // quote form clicks...
567    $('#getQuoteButton').click(function() {
568//		_gaq.push(['_trackEvent', 'QuoteButton', 'Click', URL_filepath() ]);
569        ga('send', {
570            hitType:'event',
571            eventCategory: 'QuoteButton',
572            eventAction: 'Click',
573            eventLabel: URL_filepath()
574        });
575    });
576
577    /* PDF link clicks */
578    $("a[href$='pdf']").click(function( event ) {
579        $(this).attr('target', '_blank'); // make all pdf's load in a new window/tab...
580        pdf_path = $(this).attr('href');
581        //	_gaq.push(['_trackEvent', 'PDF Downloads (Link Clicks)', pdf_path, URL_filepath()]);
582        ga('send', {
583            hitType:'event',
584            eventCategory: 'PDF Downloads (Link Clicks)',
585            eventAction: pdf_path,
586            eventLabel: URL_filepath()
587        });
588    });
589
590    /* All-purpose GA event */
591    // $('a').click(function(){
592    //     // Add GA events to links using data supplied in data attributes as such:
593    //     // <a href="#" data-gacategory="Quote Re-route" data-gaevent="200.1" data-galabel="100">my text</a>
594    //     if(
595    //         $(this).attr('data-gacategory') &&
596    //         $(this).attr('data-gaevent') &&
597    //         $(this).attr('data-galabel')
598    //     ) {
599    //         //	_gaq.push(['_trackEvent', $(this).attr('data-gacategory'), $(this).attr('data-gaevent'), $(this).attr('data-galabel')]);
600    //         ga('send', {
601    //             hitType:'event',
602    //             eventCategory: $(this).attr('data-gacategory'),
603    //             eventAction: $(this).attr('data-gaevent'),
604    //             eventLabel: $(this).attr('data-galabel')
605    //         });
606    //     }
607    // });
608
609    /* 2017-03-24 - OneSignal Integration */
610    var OneSignal = window.OneSignal || [];
611    OneSignal.push(['init', {
612        appId: 'af64d50a-f9fe-493b-ab4f-28f6332eed6e',
613        safari_web_id: 'web.onesignal.auto.599df49f-4478-46e8-9089-3c95d63b63cf',
614        autoRegister: true,
615        notifyButton: {
616            enable: true,
617            prenotify: true,
618            colors: {
619                'circle.background': '#508FAF',
620                'circle.foreground': '#FFF',
621                'badge.background': '#508FAF',
622                'badge.foreground': '#FFF',
623                'badge.bordercolor': '#FFF'
624            }
625        }
626    }]);
627
628    /* 2017-09-20 - svg4everybody to make external use of SVG icon set work on IE and others */
629    if (typeof svg4everybody == 'function') {
630        svg4everybody();
631    }
632
633    /* 2018-09-06 - Modal window for quote form sponsored link and others */
634    $('.modal').click(function(event) {
635        event.preventDefault();
636
637        let hashURL = jQuery(this).attr("href");
638        history.replaceState(null, document.title , window.location.pathname + hashURL);
639
640        modal_content_id = ('#' + $(this).data('contentid'));
641        var cboxOptions = {
642            inline:true,
643            fixed:true,
644            scrolling:true,
645            height: '95%',
646            width: '95%',
647            maxWidth: '720px',
648            maxHeight: '480px',
649            href: modal_content_id,
650            onOpen: function() {
651                $(modal_content_id).show();
652            },
653            onCleanup: function() {
654                $(modal_content_id).hide();
655            }
656        }
657        $(this).colorbox(cboxOptions);
658    });
659    $('.modal_content').hide();
660
661    $(window).resize(function(){
662        if($('#cboxOverlay').is(':visible')){
663            $.colorbox.resize({
664                width: window.innerWidth > 1000 ? '720px' : '95%',
665                height: window.innerHeight > 700 ? '480px' : '95%'
666            });
667        }
668    });
669
670    //elementor toogle
671    if(jQuery('.elementor-toggle').length) {
672        jQuery(".elementor-toggle .elementor-toggle-item .elementor-tab-title").first().addClass('elementor-active');
673        if (jQuery(".elementor-toggle .elementor-toggle-item .elementor-tab-title").hasClass('elementor-active')) {
674            jQuery(".elementor-toggle .elementor-toggle-item .elementor-tab-title.elementor-active").closest('.elementor-toggle-item').find('.elementor-tab-content').show();
675        }
676        jQuery(".elementor-toggle .elementor-toggle-item .elementor-tab-title").click(function () {
677            if (jQuery(this).not('.elementor-active')) {
678                jQuery(".elementor-toggle .elementor-toggle-item .elementor-tab-title").not(this).removeClass('elementor-active');
679                jQuery(".elementor-toggle .elementor-toggle-item .elementor-tab-title").not(this).closest('.elementor-toggle-item').find('.elementor-tab-content').removeClass('elementor-active');
680                jQuery(".elementor-toggle .elementor-toggle-item .elementor-tab-title").not(this).closest('.elementor-toggle-item').find('.elementor-tab-content').hide();
681
682                let scrollTop = jQuery(this).offset().top - 60;
683                jQuery('html, body').animate({
684                    scrollTop: scrollTop
685                });
686            }
687        });
688    }
689
690    //document.onload = scrollAfterRedirectSpecialEnrollment();
691    document.onload = scrollAfterRedirect();
692
693    //Circle of champions badge
694    // let hero_form_badge = document.querySelector('.form_badge img');
695    // let hero_form_badge_mobile = document.querySelector('.form_badge_mobile img');
696    // let hero_form_tooltiptext = document.querySelector('.form_badge .tooltiptext');
697    // let hero_form_tooltiptext_mobile = document.querySelector('.form_badge_mobile .tooltiptext');
698    //
699    // if(hero_form_badge) {
700    //     hero_form_badge.addEventListener('click', function () {
701    //         if (hero_form_tooltiptext.style.display !== 'none') {
702    //             hero_form_tooltiptext.style.display = 'none';
703    //         } else {
704    //             hero_form_tooltiptext.style.display = 'block';
705    //         }
706    //     });
707    //
708    //     hero_form_badge.addEventListener('mouseover', function (){
709    //         hero_form_tooltiptext.style.display = 'block';
710    //     });
711    //
712    //     hero_form_badge.addEventListener('mouseout', function (){
713    //         hero_form_tooltiptext.style.display = 'none';
714    //     });
715    // }
716    //
717    // if(hero_form_badge_mobile) {
718    //     hero_form_badge_mobile.addEventListener('touchstart', function () {
719    //         if (hero_form_tooltiptext_mobile.style.display !== 'none') {
720    //             hero_form_tooltiptext_mobile.style.display = 'none';
721    //         } else {
722    //             hero_form_tooltiptext_mobile.style.display = 'block';
723    //         }
724    //     });
725    // }
726
727    //Medicare Poll Iframe
728    jQuery('iframe[src="https://www.medicareresources.org/survey-iframe/"]').parent('div').addClass('medicare_poll_iframe_wrapper');
729
730    //footnotes
731    if(jQuery('.footnote-identifier-link').length){
732        jQuery('.footnote-identifier-link').each(function (index){
733            if(this.parentNode.nodeName.toLowerCase() == 'sup' && (this.parentNode.nextSibling && this.parentNode.nextSibling.nodeName.toLowerCase() == 'sup')){
734                jQuery(this).text(jQuery(this).text() + ',');
735            }
736        });
737    }
738
739});
740
741
742//handle quick link click takeaways
743jQuery(".takeaway li a").click(function(e){
744    e.preventDefault();
745
746    // Store hash
747    let hashURL = jQuery(this).attr("href");
748
749    // Make sure this.hash has a value before overriding default behavior
750    if (hashURL !== "") {
751        //change URL
752        history.replaceState(null, document.title , window.location.pathname + hashURL);
753    }
754});
755
756//handle quick link click glossary
757jQuery(".animateGlossary").click(function(e){
758    e.preventDefault();
759
760    // Store hash
761    let hashURL = jQuery(this).attr("href");
762
763    // Make sure this.hash has a value before overriding default behavior
764    if (hashURL !== "") {
765        //Animate scroll down | change URL
766        jQuery('html, body').animate({
767            scrollTop: jQuery(hashURL).offset().top - 50
768
769        }, 800, function(){
770            history.replaceState(null, document.title , window.location.pathname + hashURL);
771        });
772    }
773});
774
775jQuery(document).ready(function($) {
776    let headerNav = $('.header_nav');
777    let headerSearchButton = $('a.search_button');
778    headerNav.css('display', 'inline-block');
779    headerSearchButton.css('display', 'inline-block');
780
781    /*Mobile menu parent click with submenu fix*/
782    if (jQuery(window).width() <= 1024) {
783
784        jQuery('.mobile_menu li a').on('click', function(e) {
785            if(jQuery(this).parent().hasClass('menu-item-has-children')) {
786                e.preventDefault();
787                if (!jQuery(this).parent().hasClass('sub-menu-open')) {
788                    //jQuery('.mobile_menu li').removeClass('sub-menu-open');
789                    jQuery(this).parent().siblings().removeClass('sub-menu-open');
790                    jQuery(this).parent().addClass('sub-menu-open');
791                } else {
792                    jQuery(this).parent().removeClass('sub-menu-open');
793                }
794            } else {
795                return true;
796            }
797        });
798    }
799});
800jQuery( document ).ready(function($) {
801    // Show comment button if there are comments
802    $commentSection = jQuery('#comments');
803    if ($commentSection.length) {
804        jQuery('a[href="#comments"]').parent().show();
805    }
806
807    // FAQ widget
808    let i = 0,
809        faqsPageH3 = jQuery('.page-id-34581 .full_text h3').not('.survey-widget-header h3'),
810        faqQuickLinks = jQuery('#faq-quick-links');
811
812    faqsPageH3.each(function () {
813        let $headline = jQuery(this).html();
814        $headline = $headline.replace(/<\/?[^>]+(>|$)/g, "");
815
816        jQuery(this).attr('id', 'headline-'+i);
817
818        faqQuickLinks.append('<li><a href="#headline-'+i+'">'+$headline+'</a></li>');
819        i++;
820
821        // Back to top button
822        jQuery(this).next('ul').after('<a href="#faq-quick-links-module">'+settingsGlobal.back_to_top+'</a>');
823    });
824
825    jQuery(document).on('click', 'a[href^="#"]', function(event) {
826        event.preventDefault();
827        let selector = jQuery.attr(this, 'href');
828        let anchor = jQuery(selector);
829        if (!anchor.length) {
830            anchor = jQuery('a[name="'+selector.split("#")[1]+'"]');
831        }
832        if(anchor.offset() !== undefined)
833        {
834            jQuery('html, body').animate({
835                scrollTop: anchor.offset().top - 60
836            }, 700, 'linear');
837        }
838    });
839    // end FAQ widget
840
841    // Products Filter
842    let products = $('.product');
843    let bulletsArray = [];
844    let firstActive = [];
845    let allBullets = $('.bullets .bullet');
846    products.each(function(){
847        bulletsArray.push($(this).find('.bullets .bullet'));
848    })
849
850    // Show Current active product
851    for(let bullets in bulletsArray){
852        bulletsArray[bullets].each(function(){
853            if( $(this).hasClass('active')){
854                firstActive.push($(this).data('id'));
855            }
856        });
857    }
858
859    // Toggle active class on bullets
860    allBullets.click(function(e){
861        e.preventDefault();
862        let dataId = $(this).data('id');
863        let currentBullet = $(this);
864        let row = currentBullet.parent().find('.bullet');
865        row.each(function(){
866            $(this).removeClass('active')
867        })
868        $(this).addClass('active');
869
870        let blocks = currentBullet.parent().parent().find('.product');
871        blocks.each(function(){
872            if($(this).data('id') === dataId){
873                $(this).fadeIn(300);
874            }
875            else{
876                $(this).hide();
877            }
878        })
879    })
880
881    // SLIDER MEDIA WIDGET
882    let mediaWrapper = $('.articles');
883    let mediItems = $('.articles a');
884
885    if(mediItems.length > 4){
886        mediaWrapper.slick({
887            slidesToShow: 4,
888            slidesToScroll: 1,
889            dots: false,
890            focusOnSelect: true,
891            infinite: true,
892            autoplay: false,
893            prevArrow: '<div class="slick-prev"><i class="fa fa-angle-left" aria-hidden="true"></i></div>',
894            nextArrow: '<div class="slick-next"><i class="fa fa-angle-right" aria-hidden="true"></i></div>',
895            responsive: [
896                {
897                    breakpoint: 1024,
898                    settings: {
899                        slidesToShow: 3,
900                        prevArrow: '<div class="slick-prev"><i class="fa fa-angle-left" aria-hidden="true"></i></div>',
901                        nextArrow: '<div class="slick-next"><i class="fa fa-angle-right" aria-hidden="true"></i></div>',
902                    }
903                },
904                {
905                    breakpoint: 768,
906                    settings: {
907                        slidesToShow: 2,
908                        prevArrow: '<div class="slick-prev"><i class="fa fa-angle-left" aria-hidden="true"></i></div>',
909                        nextArrow: '<div class="slick-next"><i class="fa fa-angle-right" aria-hidden="true"></i></div>',
910                    }
911                },
912                {
913                    breakpoint: 480,
914                    settings: {
915                        slidesToShow: 1,
916                        prevArrow: '<div class="slick-prev"><i class="fa fa-angle-left" aria-hidden="true"></i></div>',
917                        nextArrow: '<div class="slick-next"><i class="fa fa-angle-right" aria-hidden="true"></i></div>',
918                    }
919                }
920
921            ]
922        });
923    }
924
925    // SLIDER WHY HIO
926    let whyhioWrapper = $('#whyslider');
927    let whyItems = $('.why-item');
928
929    if(whyItems.length > 3){
930        whyhioWrapper.slick({
931            slidesToShow: 3,
932            slidesToScroll: 1,
933            dots: false,
934            focusOnSelect: true,
935            infinite: true,
936            autoplay: false,
937            prevArrow: '<div class="slick-prev whyarrow-prev"><i class="fa fa-angle-left" aria-hidden="true"></i></div>',
938            nextArrow: '<div class="slick-next whyarrow-next"><i class="fa fa-angle-right" aria-hidden="true"></i></div>',
939            responsive: [
940                {
941                    breakpoint: 1024,
942                    settings: {
943                        slidesToShow: 3,
944                        prevArrow: '<div class="slick-prev"><i class="fa fa-angle-left" aria-hidden="true"></i></div>',
945                        nextArrow: '<div class="slick-next"><i class="fa fa-angle-right" aria-hidden="true"></i></div>',
946                    }
947                },
948                {
949                    breakpoint: 768,
950                    settings: {
951                        slidesToShow: 2,
952                        prevArrow: '<div class="slick-prev"><i class="fa fa-angle-left" aria-hidden="true"></i></div>',
953                        nextArrow: '<div class="slick-next"><i class="fa fa-angle-right" aria-hidden="true"></i></div>',
954                    }
955                },
956                {
957                    breakpoint: 480,
958                    settings: {
959                        slidesToShow: 1,
960                        prevArrow: '<div class="slick-prev"><i class="fa fa-angle-left" aria-hidden="true"></i></div>',
961                        nextArrow: '<div class="slick-next"><i class="fa fa-angle-right" aria-hidden="true"></i></div>',
962                    }
963                }
964
965            ]
966        });
967    }
968
969    // SLIDER MEDICAID REDETERMINATION STEPS
970    let medicaidRedeterminationWrapper = $('#medicaidRedeterminationSteps');
971    let medicaidRedeterminationItems = $('#medicaidRedeterminationSteps .why-item');
972
973    if(medicaidRedeterminationItems.length > 3){
974        medicaidRedeterminationWrapper.slick({
975            rows: 2,
976            slidesToShow: 2,
977            slidesToScroll: 1,
978            dots: false,
979            focusOnSelect: true,
980            infinite: true,
981            autoplay: false,
982            prevArrow: '<div class="slick-prev whyarrow-prev"><i class="fa fa-angle-left" aria-hidden="true"></i></div>',
983            nextArrow: '<div class="slick-next whyarrow-next"><i class="fa fa-angle-right" aria-hidden="true"></i></div>',
984        });
985    }
986
987    // HELP WIDGET SLIDER
988    let helpWrapper = $('.help-items');
989    let helpItems = $('.help-item');
990
991    if(helpItems.length > 3){
992        helpWrapper.slick({
993            slidesToShow: 3,
994            slidesToScroll: 1,
995            dots: false,
996            focusOnSelect: true,
997            infinite: true,
998            autoplay: false,
999            prevArrow: '<div class="slick-prev helparrow-prev"><i class="fa fa-angle-left" aria-hidden="true"></i></div>',
1000            nextArrow: '<div class="slick-next helparrow-next"><i class="fa fa-angle-right" aria-hidden="true"></i></div>',
1001            responsive: [
1002                {
1003                    breakpoint: 1024,
1004                    settings: {
1005                        slidesToShow: 3,
1006                        prevArrow: '<div class="slick-prev helparrow-prev"><i class="fa fa-angle-left" aria-hidden="true"></i></div>',
1007                        nextArrow: '<div class="slick-next helparrow-next"><i class="fa fa-angle-right" aria-hidden="true"></i></div>',
1008                    }
1009                },
1010                {
1011                    breakpoint: 768,
1012                    settings: {
1013                        slidesToShow: 2,
1014                        prevArrow: '<div class="slick-prev helparrow-prev"><i class="fa fa-angle-left" aria-hidden="true"></i></div>',
1015                        nextArrow: '<div class="slick-next helparrow-next"><i class="fa fa-angle-right" aria-hidden="true"></i></div>',
1016                    }
1017                },
1018                {
1019                    breakpoint: 480,
1020                    settings: {
1021                        slidesToShow: 1,
1022                        prevArrow: '<div class="slick-prev helparrow-prev"><i class="fa fa-angle-left" aria-hidden="true"></i></div>',
1023                        nextArrow: '<div class="slick-next helparrow-next"><i class="fa fa-angle-right" aria-hidden="true"></i></div>',
1024                    }
1025                }
1026
1027            ]
1028        });
1029    }
1030
1031
1032    // PARTNERS WIDGET SLIDER
1033    let partners = $('.partners');
1034    let partnerLogo = $('.partner-logo');
1035
1036    if(partnerLogo.length > 4){
1037        partners.slick({
1038            slidesToShow: 4,
1039            slidesToScroll: 1,
1040            dots: false,
1041            focusOnSelect: true,
1042            infinite: true,
1043            autoplay: false,
1044            prevArrow: '<div class="slick-prev partner-prev"><i class="fa fa-angle-left" aria-hidden="true"></i></div>',
1045            nextArrow: '<div class="slick-next partner-next"><i class="fa fa-angle-right" aria-hidden="true"></i></div>',
1046            responsive: [
1047                {
1048                    breakpoint: 1024,
1049                    settings: {
1050                        slidesToShow: 3,
1051                        prevArrow: '<div class="slick-prev partner-prev"><i class="fa fa-angle-left" aria-hidden="true"></i></div>',
1052                        nextArrow: '<div class="slick-next partner-next"><i class="fa fa-angle-right" aria-hidden="true"></i></div>',
1053                    }
1054                },
1055                {
1056                    breakpoint: 768,
1057                    settings: {
1058                        slidesToShow: 2,
1059                        prevArrow: '<div class="slick-prev partner-prev"><i class="fa fa-angle-left" aria-hidden="true"></i></div>',
1060                        nextArrow: '<div class="slick-next partner-next"><i class="fa fa-angle-right" aria-hidden="true"></i></div>',
1061                    }
1062                },
1063                {
1064                    breakpoint: 480,
1065                    settings: {
1066                        slidesToShow: 1,
1067                        prevArrow: '<div class="slick-prev partner-prev"><i class="fa fa-angle-left" aria-hidden="true"></i></div>',
1068                        nextArrow: '<div class="slick-next partner-next"><i class="fa fa-angle-right" aria-hidden="true"></i></div>',
1069                    }
1070                }
1071
1072            ]
1073        });
1074    }
1075
1076    // SLIDER STM Articles
1077    let stmarticlesWrapper = $('.stm-articles-items');
1078    let stmarticlesItems = $('.stm-articles-item');
1079
1080    if(stmarticlesItems.length > 3){
1081        stmarticlesWrapper.slick({
1082            slidesToShow: 3,
1083            slidesToScroll: 1,
1084            dots: false,
1085            focusOnSelect: false,
1086            infinite: true,
1087            autoplay: false,
1088            swipeToSlide: true,
1089            prevArrow: '<div class="slick-prev whyarrow-prev"><i class="fa fa-angle-left" aria-hidden="true"></i></div>',
1090            nextArrow: '<div class="slick-next whyarrow-next"><i class="fa fa-angle-right" aria-hidden="true"></i></div>',
1091            responsive: [
1092                {
1093                    breakpoint: 1024,
1094                    settings: {
1095                        slidesToShow: 3,
1096                        prevArrow: '<div class="slick-prev"><i class="fa fa-angle-left" aria-hidden="true"></i></div>',
1097                        nextArrow: '<div class="slick-next"><i class="fa fa-angle-right" aria-hidden="true"></i></div>',
1098                    }
1099                },
1100                {
1101                    breakpoint: 768,
1102                    settings: {
1103                        slidesToShow: 2,
1104                        prevArrow: '<div class="slick-prev"><i class="fa fa-angle-left" aria-hidden="true"></i></div>',
1105                        nextArrow: '<div class="slick-next"><i class="fa fa-angle-right" aria-hidden="true"></i></div>',
1106                    }
1107                },
1108                {
1109                    breakpoint: 480,
1110                    settings: {
1111                        slidesToShow: 1,
1112                        prevArrow: '<div class="slick-prev"><i class="fa fa-angle-left" aria-hidden="true"></i></div>',
1113                        nextArrow: '<div class="slick-next"><i class="fa fa-angle-right" aria-hidden="true"></i></div>',
1114                    }
1115                }
1116
1117            ]
1118        });
1119    } else {
1120        stmarticlesWrapper.slick({
1121            slidesToShow: 2,
1122            slidesToScroll: 1,
1123            dots: false,
1124            focusOnSelect: false,
1125            infinite: true,
1126            autoplay: false,
1127            swipeToSlide: true,
1128            prevArrow: '<div class="slick-prev whyarrow-prev"><i class="fa fa-angle-left" aria-hidden="true"></i></div>',
1129            nextArrow: '<div class="slick-next whyarrow-next"><i class="fa fa-angle-right" aria-hidden="true"></i></div>',
1130            responsive: [
1131                {
1132                    breakpoint: 1024,
1133                    settings: {
1134                        slidesToShow: 2,
1135                        prevArrow: '<div class="slick-prev"><i class="fa fa-angle-left" aria-hidden="true"></i></div>',
1136                        nextArrow: '<div class="slick-next"><i class="fa fa-angle-right" aria-hidden="true"></i></div>',
1137                    }
1138                },
1139                {
1140                    breakpoint: 768,
1141                    settings: {
1142                        slidesToShow: 2,
1143                        prevArrow: '<div class="slick-prev"><i class="fa fa-angle-left" aria-hidden="true"></i></div>',
1144                        nextArrow: '<div class="slick-next"><i class="fa fa-angle-right" aria-hidden="true"></i></div>',
1145                    }
1146                },
1147                {
1148                    breakpoint: 480,
1149                    settings: {
1150                        slidesToShow: 1,
1151                        prevArrow: '<div class="slick-prev"><i class="fa fa-angle-left" aria-hidden="true"></i></div>',
1152                        nextArrow: '<div class="slick-next"><i class="fa fa-angle-right" aria-hidden="true"></i></div>',
1153                    }
1154                }
1155
1156            ]
1157        });
1158    }
1159});
1160
1161function getCookie(name)
1162{
1163    var re = new RegExp(name + "=([^;]+)");
1164    var value = re.exec(document.cookie);
1165    return (value != null) ? unescape(value[1]) : null;
1166}
1167
1168/**
1169 * Quoting
1170 */
1171let zip = jQuery('.zip'),
1172    getQuoteButton = jQuery('.getQuoteButton'),
1173    quotingForm = jQuery('.hio_quote'),
1174    quotingFormHomepage = jQuery('.hio_quote_homepage'),
1175    quotingFormPage = jQuery('.hio_quote_page');
1176    //stateDropdown = jQuery('#state-guides');
1177    census_form = jQuery('#census_form');
1178
1179zip.bind('keyup', function(e) {
1180    passwordInputKeyupHandler(e);
1181});
1182
1183function passwordInputKeyupHandler(e) {
1184    if (e.which === 13) {
1185        console.log('Enter key!');
1186        zip.unbind('keyup');
1187
1188        return setTimeout(function(){
1189            console.log('Rebind keyup event');
1190            zip.keyup(passwordInputKeyupHandler);
1191        }, 2000);
1192    }
1193
1194}
1195
1196
1197zip.on('focus', function () {
1198    let zipCodeError = jQuery('.error_icon'),
1199        check = jQuery('.icon.check'),
1200        countyGroup = jQuery(".county-group"),
1201        stateSelect = jQuery("select[name='county-select']"),
1202        errorWrapp = jQuery('.error-wrapp');
1203
1204    getQuoteButton.attr('disabled', false);
1205    jQuery(this).removeClass('error');
1206    zipCodeError.remove();
1207    errorWrapp.html('');
1208    check.remove();
1209    countyGroup.addClass('d-none');
1210    stateSelect.remove();
1211
1212});
1213
1214
1215quotingForm.on('submit',function(event){
1216    event.preventDefault();
1217
1218    let zip = jQuery(this).find('.zip').val(),
1219        product = jQuery(this).find('.quote_type').val(),
1220        countyDropdown = jQuery(this).find('select[name="county-select"]').val(),
1221        id =  jQuery(this).attr('data-id');
1222
1223    zipVerification(zip,jQuery(this).find('.zip'),function(){
1224        quotingRedirection(zip,product,countyDropdown, id);
1225    });
1226
1227});
1228
1229quotingFormHomepage.on('submit', function(event){
1230    event.preventDefault();
1231
1232    let zip = jQuery(this).find('.zip').val();
1233    let redirection_path = jQuery(this).find('input[name="redirection_path"]').val();
1234    let open_enrollment_period_switch = jQuery(this).find('input[name="open_enrollment_period_switch"]').val();
1235
1236    let insxParamKeys = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'gclid'];
1237    let insxParamValues = {};
1238    let insxParamUrlString = '';
1239    let insxFormData = {};
1240
1241    insxParamKeys.forEach(function (currentValue, index) {
1242        if (localStorage.getItem(currentValue) != null && localStorage.getItem(currentValue) != "") {
1243            insxParamValues[currentValue] = localStorage.getItem(currentValue);
1244        }
1245    });
1246
1247    if (Object.entries(insxParamValues).length) {
1248        let insxParamIndex = 0;
1249        for (const [key, value] of Object.entries(insxParamValues)) {
1250            if (insxParamIndex == 0) {
1251                insxParamUrlString += `?${key}=${value}`;
1252            } else {
1253                insxParamUrlString += `&${key}=${value}`;
1254            }
1255            insxParamIndex++;
1256        }
1257    }
1258
1259    //add utm_content = url path
1260    if(insxParamUrlString !== '') {
1261        insxParamUrlString += `&utm_content=${window.location.pathname}`;
1262    } else {
1263        insxParamUrlString += `?utm_content=${window.location.pathname}`;
1264    }
1265
1266    insxFormData['zipCode'] = zip;
1267    let insxFormDataStr = JSON.stringify(insxFormData);
1268    let insxFormDataB64 = btoa(insxFormDataStr);
1269
1270    if(insxParamUrlString !== '') {
1271        insxParamUrlString += "&q=" + insxFormDataB64;
1272    } else {
1273        insxParamUrlString += "?q=" + insxFormDataB64;
1274    }
1275
1276
1277    let new_tab_nedeed = 'no';
1278    let popUnderUrl = '';
1279    let redirectionUrl = '';
1280
1281    // let zipVerificationResponse = zipVerification(zip,jQuery(this).find('.zip'));
1282    //
1283    // if(zipVerificationResponse !== 'valid') {
1284    //     return false;
1285    // }
1286
1287    zipVerification(zip,jQuery(this).find('.zip'),function(){
1288        jQuery.ajax({
1289            type: "POST",
1290            url: settingsGlobal.ajaxurl,
1291            dataType:"json",
1292            data: {
1293                "action": "ihc_handle_quoting_redirection_homepage",
1294                'security' : settingsGlobal.security,
1295                "zip": zip,
1296                "redirection_path": redirection_path,
1297                "open_enrollment_period_switch": open_enrollment_period_switch,
1298                'insxParamUrlString': insxParamUrlString
1299            },
1300            success: function(data) {
1301
1302                // redirect the user based on the first quote results that he got for that region
1303                if (data[0].includes('/quotes/special-enrollment/') === false) {
1304                    if(localStorage.getItem(zip + '_' + data[2] +'_route_id') !== null && localStorage.getItem(zip + '_' + data[2] + '_vendor_id') !== null && localStorage.getItem(zip + '_' + data[2] + '_url_short') !== null) {
1305                        if(data[5][localStorage.getItem(zip + '_' + data[2] + '_vendor_id')] == 1) {
1306                            data[1] = localStorage.getItem(zip + '_' + data[2] + '_vendor_id');
1307                            data[4] = localStorage.getItem(zip + '_' + data[2] + '_url_short');
1308                            if(data[1] != "Lucie Health" && data[1] != "TempLucieHealth") {
1309                                if(data[1] != 'healthcare') {
1310                                    data[0] = localStorage.getItem(zip + '_' + data[2] + '_route_id');
1311                                } else {
1312                                    data[0] = data[4] + data[6];
1313                                }
1314                            } else {
1315                                data[0] = data[4] + insxParamUrlString;
1316                            }
1317                        } else {
1318                            localStorage.setItem(zip + '_' + data[2] + '_route_id', data[0]);
1319                            localStorage.setItem(zip + '_' + data[2] + '_vendor_id', data[1]);
1320                            localStorage.setItem(zip + '_' + data[2] + '_url_short', data[4]);
1321                        }
1322                    } else {
1323                        localStorage.setItem(zip + '_' + data[2] + '_route_id', data[0]);
1324                        localStorage.setItem(zip + '_' + data[2] + '_vendor_id', data[1]);
1325                        localStorage.setItem(zip + '_' + data[2] + '_url_short', data[4]);
1326                    }
1327                }
1328
1329                jQuery.ajax({
1330                    type: "POST",
1331                    url: settingsGlobal.ajaxurl,
1332                    dataType:"json",
1333                    data: {
1334                        action : "ihc_routing_log_data",
1335                        route_id : data[0],
1336                        vendor_id : data[1],
1337                        product : data[2],
1338                        source : data[3],
1339                        zip : zip,
1340                        url_short : data[4]
1341                    },
1342                    success: function(data) {
1343
1344                    }
1345                });
1346
1347                //popunder functionality
1348                // if(settingsGlobal.mediaAlphaPopUnderStatus == 1 && (data[2] == "health-insurance" || data[2] == "main-page-routing") && ((data[1] == 'sherpa' && data[4] == 'https://www.healthsherpa.com/?_agent_id=IHC-Specialty-Benefits') || ((data[1] == 'INSXCloud' || data[1] == "TempINSXCloud") && (data[4] == 'https://hio.insxcloud.com/aca/get-a-quote' || data[4] == 'https://hio.insxcloud.us/aca/get-a-quote')))
1348) {
1349                //     new_tab_nedeed = 'yes';
1350                //     let base_url = window.location.origin;
1351                //     let media_alpha_url = base_url + '/quotes/media-alpha-landing/?zip=' + zip + '&type=health-insurance';
1352                //     let media_alpha_url_short = base_url + '/quotes/media-alpha-landing/';
1353                //
1354                //     jQuery.ajax({
1355                //         type: "POST",
1356                //         async: false,
1357                //         url: settingsGlobal.ajaxurl,
1358                //         dataType:"json",
1359                //         data: {
1360                //             action : "ihc_routing_log_data",
1361                //             route_id : media_alpha_url,
1362                //             vendor_id : 'media-alpha',
1363                //             product : data[2],
1364                //             source : data[3],
1365                //             zip : zip,
1366                //             url_short : media_alpha_url_short
1367                //         },
1368                //         success: function(data) {
1369                //
1370                //         }
1371                //     });
1372                //     redirectionUrl = data[0];
1373                //     popUnderUrl = media_alpha_url;
1374                // } else {
1375                //     redirectionUrl = data[0];
1376                //     new_tab_nedeed = 'no';
1377                // }
1378            }
1379        }).then(function (response){
1380            if (location.hostname !== new URL(response[0]).host) {
1381                jQuery('.redirect_notification').show();
1382                setTimeout(() => {
1383                    window.location.href = response[0];
1384                    jQuery('.redirect_notification').hide();
1385                }, "2000");
1386            } else {
1387                window.location.href = response[0];
1388            }
1389        });
1390    });
1391
1392    //popunder functionality
1393    // if(new_tab_nedeed == 'yes') {
1394    //     // let new_window = window.open('', '_blank');
1395    //     // new_window.location.href = redirectionUrl;
1396    //     window.open(redirectionUrl, '_blank')
1397    //     window.location.href = popUnderUrl;
1398    // } else {
1399    //     window.location.href = redirectionUrl;
1400    // }
1401
1402});
1403
1404quotingFormPage.on('submit',function(event){
1405    event.preventDefault();
1406
1407    let zip = jQuery(this).find('.zip').val(),
1408        product = jQuery(this).find('.quote_type').val(),
1409        countyDropdown = jQuery(this).find('select[name="county-select"]').val(),
1410        id =  jQuery(this).attr('data-id');
1411
1412    jQuery.ajax({
1413        type: "POST",
1414        url: settingsGlobal.ajaxurl,
1415        dataType:"json",
1416        data: {
1417            "action": "ihc_handle_quoting_redirection_page",
1418            'security' : settingsGlobal.security,
1419            "zip": zip,
1420            "product" : product,
1421            "countyDropdown" : countyDropdown,
1422            "id" : id
1423        },
1424        success: function(data) {
1425            jQuery.ajax({
1426                type: "POST",
1427                url: settingsGlobal.ajaxurl,
1428                dataType:"json",
1429                data: {
1430                    action : "ihc_routing_log_data",
1431                    route_id : data[0],
1432                    vendor_id : data[1],
1433                    product : data[2],
1434                    source : 'quotes',
1435                    zip : zip,
1436		    url_short : data[3]
1437                },
1438                success: function(data) {
1439
1440                }
1441            });
1442
1443            window.location.href = data[0] + "?zip="+zip+"&type="+data[2];
1444        }
1445    });
1446
1447});
1448
1449
1450function inIframe() {
1451    try {
1452        return window.self == window.top;
1453    } catch (e) {
1454        return true;
1455    }
1456}
1457
1458/**
1459 * Create quoting redirection
1460 * @param zip
1461 * @param product
1462 * @param countyDropdown
1463 * @param id
1464 */
1465function quotingRedirection(zip,product,countyDropdown, id) {
1466    let insxParamKeys = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'gclid'];
1467    let insxParamValues = {};
1468    let insxParamUrlString = '';
1469    let insxFormData = {};
1470
1471    insxParamKeys.forEach(function (currentValue, index) {
1472        if (localStorage.getItem(currentValue) != null && localStorage.getItem(currentValue) != "") {
1473            insxParamValues[currentValue] = localStorage.getItem(currentValue);
1474        }
1475    });
1476
1477    if (Object.entries(insxParamValues).length) {
1478        let insxParamIndex = 0;
1479        for (const [key, value] of Object.entries(insxParamValues)) {
1480            if (insxParamIndex == 0) {
1481                insxParamUrlString += `?${key}=${value}`;
1482            } else {
1483                insxParamUrlString += `&${key}=${value}`;
1484            }
1485            insxParamIndex++;
1486        }
1487    }
1488
1489    //add utm_content = url path
1490    if(insxParamUrlString !== '') {
1491        insxParamUrlString += `&utm_content=${window.location.pathname}`;
1492    } else {
1493        insxParamUrlString += `?utm_content=${window.location.pathname}`;
1494    }
1495
1496    //  // // passing a next day effective date in the q value (according to the 31.10.2022 task requirement)  for stm products// // //
1497    //  // // passing a next day effective date in the q value (according to the 02.11.2022 task requirement)  for dental products// // //
1498    if ( product == 'stm' || product == 'dental' || product == 'accident' || product == 'critical-illness-insurance' || product == 'cancer' || product == 'supplemental' || product == 'vision')
1499    {
1500        // Creating the date instance
1501        var d = new Date();
1502        // Adding one date to the present date
1503        d.setDate(d.getDate() + 1);
1504        var year = d.getFullYear()
1505        var month = String(d.getMonth() + 1)
1506        var day = String(d.getDate())
1507        // Adding leading 0 if the day or month
1508        // is one digit value
1509        month = month.length == 1 ?
1510            month.padStart('2', '0') : month;
1511        day = day.length == 1 ?
1512            day.padStart('2', '0') : day;
1513        // Printing the present date
1514        // console.log(`${year}-${month}-${day}`);
1515        // pass a formated curent date +1 to the insxform data
1516        insxFormData['effectiveDate'] = `${year}-${month}-${day}`;
1517        insxFormData['applyForSubsidy'] = false;
1518        //disable subsidy questions
1519        insxFormData['hideAptcQuestions'] = true;
1520    }
1521
1522    //passing product CONSTANT in the q value (according to the 01.11.2022 task requirement)  for dental products
1523    if ( product == 'dental' )
1524    {
1525        insxFormData['product'] = 'Dental';
1526    }
1527    //passing product CONSTANT in the q value for STM products
1528    if ( product == 'stm' )
1529    {
1530        insxFormData['product'] = 'Short Term Medical';
1531    }
1532    //passing product CONSTANT in the q value for Accident products
1533    if ( product == 'accident' )
1534    {
1535        insxFormData['product'] = 'Supplemental';
1536    }
1537    //passing product CONSTANT in the q value for critical illness products
1538    if ( product == 'critical-illness-insurance' )
1539    {
1540        insxFormData['product'] = 'Critical Illness';
1541    }
1542    //passing product CONSTANT in the q value for cancer products
1543    if ( product == 'cancer' )
1544    {
1545        insxFormData['product'] = 'Cancer';
1546    }
1547    //passing product CONSTANT in the q value for supplemental products
1548    if ( product == 'supplemental' )
1549    {
1550        insxFormData['product'] = 'Supplemental';
1551    }
1552    //passing product CONSTANT in the q value for vision products
1553    if ( product == 'vision' )
1554    {
1555        insxFormData['product'] = 'Vision';
1556    }
1557    insxFormData['zipCode'] = zip;
1558    let insxFormDataStr = JSON.stringify(insxFormData);
1559    let insxFormDataB64 = btoa(insxFormDataStr);
1560
1561    if(insxParamUrlString !== '') {
1562        insxParamUrlString += "&q=" + insxFormDataB64;
1563    } else {
1564        insxParamUrlString += "?q=" + insxFormDataB64;
1565    }
1566
1567    let new_tab_nedeed = 'no';
1568    let popUnderUrl = '';
1569    let redirectionUrl = '';
1570
1571    jQuery.ajax({
1572        type: "POST",
1573        url: settingsGlobal.ajaxurl,
1574        dataType:"json",
1575        data: {
1576            "action": "ihc_handle_quoting_redirection",
1577            'security' : settingsGlobal.security,
1578            "zip": zip,
1579            "product" : product,
1580            "countyDropdown" : countyDropdown,
1581            "id" : id,
1582            'insxParamUrlString': insxParamUrlString,
1583        },
1584        success: function(data) {
1585
1586            // redirect the user based on the first quote results that he got for that region
1587            if (data[0].includes('/quotes/special-enrollment/') === false) {
1588                if (localStorage.getItem(zip + '_' + product + '_route_id') !== null && localStorage.getItem(zip + '_' + product + '_vendor_id') !== null && localStorage.getItem(zip + '_' + product + '_url_short') !== null) {
1589                    if(data[5][localStorage.getItem(zip + '_' + product + '_vendor_id')] == 1) {
1590                        data[1] = localStorage.getItem(zip + '_' + product + '_vendor_id');
1591                        data[4] = localStorage.getItem(zip + '_' + product + '_url_short');
1592                        if(data[1] != "Lucie Health" && data[1] != "TempLucieHealth") {
1593                            if(data[1] != 'healthcare') {
1594                                data[0] = localStorage.getItem(zip + '_' + product + '_route_id');
1595                            } else {
1596                                data[0] = data[4] + data[6];
1597                            }
1598                        } else {
1599                            data[0] = data[4] + insxParamUrlString;
1600                        }
1601                    } else {
1602                        localStorage.setItem(zip + '_' + product + '_route_id', data[0]);
1603                        localStorage.setItem(zip + '_' + product + '_vendor_id', data[1]);
1604                        localStorage.setItem(zip + '_' + product + '_url_short', data[4]);
1605                    }
1606                } else {
1607                    localStorage.setItem(zip + '_' + product + '_route_id', data[0]);
1608                    localStorage.setItem(zip + '_' + product + '_vendor_id', data[1]);
1609                    localStorage.setItem(zip + '_' + product + '_url_short', data[4]);
1610                }
1611            }
1612
1613            jQuery.ajax({
1614                type: "POST",
1615                url: settingsGlobal.ajaxurl,
1616                dataType:"json",
1617                data: {
1618                    action : "ihc_routing_log_data",
1619                    route_id : data[0],
1620                    vendor_id : data[1],
1621                    product : data[2],
1622                    source : data[3],
1623                    zip : zip,
1624		            url_short : data[4]
1625                },
1626                success: function(data) {
1627
1628                }
1629            });
1630
1631            // popunder functionality
1632            // if(settingsGlobal.mediaAlphaPopUnderStatus == 1 && product == "health-insurance" && ((data[1] == 'sherpa' && data[4] == 'https://www.healthsherpa.com/?_agent_id=IHC-Specialty-Benefits') || ((data[1] == 'INSXCloud' || data[1] == "TempINSXCloud") && (data[4] == 'https://hio.insxcloud.com/aca/get-a-quote' || data[4] == 'https://hio.insxcloud.us/aca/get-a-quote')))
1632) {
1633            //     new_tab_nedeed = 'yes';
1634            //     let base_url = window.location.origin;
1635            //     let media_alpha_url = base_url + '/quotes/media-alpha-landing/?zip=' + zip + '&type=health-insurance';
1636            //     let media_alpha_url_short = base_url + '/quotes/media-alpha-landing/';
1637            //
1638            //     jQuery.ajax({
1639            //         type: "POST",
1640            //         async: false,
1641            //         url: settingsGlobal.ajaxurl,
1642            //         dataType:"json",
1643            //         data: {
1644            //             action : "ihc_routing_log_data",
1645            //             route_id : media_alpha_url,
1646            //             vendor_id : 'media-alpha',
1647            //             product : data[2],
1648            //             source : data[3],
1649            //             zip : zip,
1650            //             url_short : media_alpha_url_short
1651            //         },
1652            //         success: function(data) {
1653            //
1654            //         }
1655            //     });
1656            //
1657            //     redirectionUrl = data[0];
1658            //     popUnderUrl = media_alpha_url;
1659            // } else {
1660            //     redirectionUrl = data[0];
1661            //     new_tab_nedeed = 'no';
1662            // }
1663        }
1664    }).then(function (response){
1665        if (location.hostname !== new URL(response[0]).host) {
1666            jQuery.colorbox.close();
1667            jQuery('.redirect_notification').show();
1668            setTimeout(() => {
1669                window.location.href = response[0];
1670                jQuery('.redirect_notification').hide();
1671            }, "2000");
1672        } else {
1673            if(inIframe()){
1674                window.location.href = response[0];
1675            } else {
1676                window.open(response[0], '_blank');
1677            }
1678        }
1679    });
1680
1681    // popunder functionality
1682    // if(inIframe()){
1683    //     if(new_tab_nedeed == 'yes') {
1684    //         window.open(redirectionUrl, '_blank')
1685    //         window.location.href = popUnderUrl;
1686    //     } else {
1687    //         window.location.href = redirectionUrl;
1688    //     }
1689    // } else {
1690    //     window.open(redirectionUrl, '_blank');
1691    // }
1692
1693}
1694
1695// stateDropdown.on('change', function(event){
1696//     jQuery.ajax({
1697//         type: "POST",
1698//         url: settingsGlobal.ajaxurl,
1699//         dataType:"json",
1700//         data: {
1701//             action: "stm_routing_log_data",
1702//             security: settingsGlobal.security,
1703//             current_url: this.options[this.selectedIndex].value,
1704//         }
1705//     });
1706// });
1707
1708
1709census_form.on('submit', function(event){
1710
1711    let zip = jQuery(this).find('.zipcode_field').val();
1712    let response_url = getCookie('response_url');
1713    jQuery.ajax({
1714        type: "POST",
1715        url: settingsGlobal.ajaxurl,
1716        dataType:"json",
1717        data: {
1718            action: "stm_api_routing_log_data",
1719            security: settingsGlobal.security,
1720            zipcode: zip,
1721            response_url: response_url,
1722        }
1723    });
1724});
1725
1726function zipVerification(zipCode,$this,callback) {
1727    let zip_status_response = '';
1728    if (typeof zipCode !== "undefined" ) {
1729        jQuery.ajax({
1730            url: settingsGlobal.restURL + 'counties/' + zipCode
1731        }).done(function (data) {
1732            zip_status_response = 'valid';
1733            let countyGroup = jQuery(".county-group"),
1734                zipCodeError = jQuery('.error_icon'),
1735                stateSelect = jQuery("select[name='county-select']"),
1736                countyFips = jQuery('.county-fips'),
1737                getQuoteButton = jQuery('.getQuoteButton'),
1738                errorWrapp = jQuery($this).parents('form').first().find('.error-wrapp');
1739
1740            zipCodeError.remove();
1741            errorWrapp.html('');
1742            $this.removeClass('error');
1743
1744            if (data.length === 0) {
1745
1746                stateSelect.remove();
1747                countyGroup.addClass('d-none');
1748
1749                $this.next('.fa-check-circle').remove();
1750
1751                if(!zipCodeError.length)
1752                    $this.after('<span class="icon check"></span>');
1753
1754                return false;
1755
1756            } else if (data.length === 1) {
1757
1758                stateSelect.remove();
1759                countyGroup.addClass('d-none');
1760
1761                countyFips.val(data[0].stateFips + '' + data[0].countyFips);
1762                getQuoteButton.attr('disabled', false);
1763                $this.parent().append("<span class=\"icon check\"></span>");
1764
1765
1766                if( typeof callback === 'function')
1767                    callback();
1768
1769            } else {
1770                let proceed = true;
1771
1772                if(stateSelect.length !== 1){
1773
1774                    let options_temp = "<option value=''>Select county</option>";
1775                    data.forEach(function (el, index) {
1776                        options_temp += "<option value=\"" + el.stateFips + '' + el.countyFips + "\">" + el.county + " (" + el.state + ")</option>";
1777                    });
1778
1779                    countyFips.after('<select name="county-select"  class="form-control" required>');
1780
1781                    let stateSelectNew = jQuery("select[name='county-select']");
1782
1783                    stateSelectNew.html(options_temp);
1784                    countyGroup.removeClass('d-none');
1785
1786                    if(stateSelectNew.val() === '')
1787                        proceed = false;
1788
1789                }
1790
1791                $this.parent().append("<span class=\"icon check\"></span>");
1792                getQuoteButton.attr('disabled', false);
1793
1794                if( typeof callback === 'function' && proceed)
1795                    callback();
1796
1797            }
1798        }).fail(function (err) {
1799            zip_status_response = 'invalid';
1800            let zipCodeError = jQuery('.error_icon'),
1801                errorWrapp = jQuery($this).parents('form').first().find('.error-wrapp');
1802
1803            $this.next('.fa-check-circle').remove();
1804
1805            if(zipCodeError.length == '0'){
1806                errorWrapp.html('<div class="error_msg"> You must enter a valid ZIP code. </div>');
1807                $this.after('<span class="error_icon" title="Invalid" title=""></span>');
1808            }
1809        });
1810
1811    }
1812
1813    return zip_status_response;
1814
1815}
1816
1817/**
1818 * Allow only numeric data
1819 */
1820zip.on('keypress change',function(event){
1821    let key = event.keyCode;
1822    if (event.keyCode === 8 || event.keyCode === 46 ||  event.keyCode === 13) {
1823        return true;
1824    } else if ( key < 48 || key > 57 ) {
1825        return false;
1826    } else {
1827        return true;
1828    }
1829});
1830
1831jQuery( document ).ready(function($) {
1832    let resultWrap = $('.homepage-new #results_wrapper'),
1833        zip = $('.homepage-new #healthInsCalcForm #zipcode'),
1834        age = $('.homepage-new #healthInsCalcForm #age'),
1835        householdSize = $('.homepage-new #healthInsCalcForm #householdSize'),
1836        calcDesc = $('.homepage-new .subsidy_calc_desc'),
1837        incomeSlider = $('.homepage-new #incomeSlider');
1838
1839    zip.change(function () {
1840        resultWrap.addClass('show-results');
1841        calcDesc.addClass('increase-margin');
1842    });
1843    age.change(function () {
1844        resultWrap.addClass('show-results');
1845        calcDesc.addClass('increase-margin');
1846    });
1847    householdSize.change(function () {
1848        resultWrap.addClass('show-results');
1849        calcDesc.addClass('increase-margin');
1850    });
1851
1852    incomeSlider.on("slide", function (event, ui) {
1853        resultWrap.addClass('show-results');
1854        calcDesc.addClass('increase-margin');
1855    });
1856});
1857
1858jQuery(document).ready(function()
1859 {
1860 var el = document.getElementsByClassName("elementor-toggle-title");
1861 for (var i=0; i < el.length; i++) {
1862 el[i].outerHTML = '<h3 class="elementor-toggle-title" style="font-size: 24px; margin: auto; font-weight: 600; font-family: Roboto, Sans-serif;">' + el[i].innerHTML + '</h3>';
1863 }
1864});
1865
1866jQuery( document ).ready(function (){
1867        jQuery('#oep-table tr').slice(13, 52).hide();
1868});
1869
1870var eop_table_btn_status = 0;
1871
1872jQuery('#oep-table-btn').on('click', function (){
1873    if(eop_table_btn_status == 0){
1874        jQuery('#oep-table tr').slice(13, 52).show();
1875        jQuery("#oep-table-btn").html('Hide deadlines for additional states');
1876        eop_table_btn_status = 1;
1877    } else {
1878        jQuery('#oep-table tr').slice(13, 52).hide();
1879        window.scrollTo({
1880            top: findPos(document.getElementById("oep-table")) - 60,
1881            left: 0,
1882            behavior: 'smooth'
1883        });
1884        jQuery("#oep-table-btn").html('View deadlines for additional states');
1885        eop_table_btn_status = 0;
1886    }
1887})
1888
1889// var featuredWidget = document.querySelector(".featured-widget");
1890// var mobileQuotes = document.querySelector(".mobile_quotes_panel");
1891//
1892// if(jQuery('.featured-widget').length) {
1893//     var featuredWidgetRect = document.querySelector(".featured-widget").getBoundingClientRect();
1894//     var featuredWidgetBottom = featuredWidgetRect.bottom;
1895// }
1896//
1897// var currentUrlPathComponents = window.location.pathname.split('/');
1898//
1899// if(mobileQuotes) {
1900//     if (currentUrlPathComponents[1] != "quotes") {
1901//         jQuery(window).on('scroll', function () {
1902//
1903//             if (jQuery(window).width() <= 1020) {
1904//                 if (jQuery('.featured-widget').length) {
1905//                     if (jQuery(window).scrollTop() >= featuredWidgetBottom) {
1906//
1907//                         mobileQuotes.setAttribute("style", "display:block !important;");
1908//
1909//                     } else {
1910//                         mobileQuotes.setAttribute("style", "display:none !important;");
1911//                     }
1912//                 } else {
1913//                     if (jQuery(window).width() <= 1020 && jQuery(window).width() >= 770) {
1914//                         if (jQuery(window).scrollTop() >= 444) {
1915//
1916//                             mobileQuotes.setAttribute("style", "display:block !important;");
1917//
1918//                         } else {
1919//                             mobileQuotes.setAttribute("style", "display:none !important;");
1920//                         }
1921//                     } else if (jQuery(window).width() <= 770) {
1922//                         if (jQuery(window).scrollTop() >= 800) {
1923//
1924//                             mobileQuotes.setAttribute("style", "display:block !important;");
1925//
1926//                         } else {
1927//                             mobileQuotes.setAttribute("style", "display:none !important;");
1928//                         }
1929//                     }
1930//                 }
1931//             } else {
1932//                 mobileQuotes.setAttribute("style", "display:none !important;");
1933//             }
1934//         });
1935//     }
1936// }
1937
1938//Finds y value of given object
1939function findPos(e) {
1940    var top = 0;
1941
1942    do {
1943        top += e.offsetTop;
1944    } while (e = e.offsetParent);
1945
1946    return top;
1947}
1948
1949//Finds bottom value of given object
1950function findPosBottom(e) {
1951    var bottom = 0;
1952
1953    do {
1954        bottom += e.offsetBottom;
1955    } while (e = e.offsetParent);
1956
1957    return bottom;
1958}
1959
1960// function specialEnrollmentQuotingRedirection() {
1961//     window.location.href = '/quotes/special-enrollment/';
1962// }
1963
1964function scrollAfterRedirect() {
1965    if(location.hash == '#quotes') {
1966        window.scrollTo({
1967            top: findPos(document.getElementById("featured-widget-subtitle")) - 60,
1968            left: 0,
1969            behavior: 'smooth'
1970        });
1971        return false;
1972    }
1973}
1974
1975// function scrollAfterRedirectSpecialEnrollment() {
1976//     if(jQuery(window).width() <= 768) {
1977//         if (location.pathname == '/quotes/special-enrollment/') {
1978//             window.scrollTo({
1979//                 top: findPos(document.getElementById("special-enrollment-quote")) - 160,
1980//                 left: 0,
1981//                 behavior: 'smooth'
1982//             });
1983//             return false;
1984//         }
1985//     }
1986// }
1987
1988// jQuery(document).on('click', ".mobile_quotes_text", function(e) {
1989//
1990//     if(jQuery('.featured-widget').length){
1991//         e.preventDefault();
1992//         window.scrollTo({
1993//             top: findPos(document.getElementById("featured-widget-subtitle")) - 60,
1994//             left: 0,
1995//             behavior: 'smooth'
1996//         });
1997//     } else {
1998//         e.preventDefault();
1999//         specialEnrollmentQuotingRedirection();
2000//     }
2001// });
2002
2003// Parse the URL
2004function getParameterByName(name) {
2005    name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
2006    var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
2007        results = regex.exec(location.search);
2008    return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
2009}
2010
2011function storeIncomingParameters(){
2012    let utm_source = getParameterByName('utm_source');
2013    let utm_medium = getParameterByName('utm_medium');
2014    let utm_campaign = getParameterByName('utm_campaign');
2015    let utm_term = getParameterByName('utm_term');
2016    let gclid = getParameterByName('gclid');
2017
2018    if(utm_source.length) {
2019        localStorage.setItem('utm_source', utm_source);
2020    }
2021    if(utm_medium.length) {
2022        localStorage.setItem('utm_medium', utm_medium);
2023    }
2024    if(utm_campaign.length) {
2025        localStorage.setItem('utm_campaign', utm_campaign);
2026    }
2027    if(utm_term.length) {
2028        localStorage.setItem('utm_term', utm_term);
2029    }
2030    if(gclid.length) {
2031        localStorage.setItem('gclid', gclid);
2032    }
2033}
2034
2035jQuery(document).ready(function(){
2036    storeIncomingParameters();
2037
2038    // Give the URL parameters variable names
2039    var utm_source = getParameterByName('utm_source');
2040    var utm_medium = getParameterByName('utm_medium');
2041    var utm_campaign = getParameterByName('utm_campaign');
2042    var utm_content = getParameterByName('utm_content');
2043    var utm_term = getParameterByName('utm_term');
2044    var gclid = getParameterByName('gclid');
2045
2046    // Set the cookies
2047    if(utm_source.length) {
2048        if (jQuery.cookie('UTM_Source') == null || jQuery.cookie('UTM_Source') == "" || jQuery.cookie('UTM_Source') != utm_source) {
2049            jQuery.cookie('UTM_Source', utm_source);
2050        }
2051    }
2052
2053    if(utm_medium.length) {
2054        if (jQuery.cookie('UTM_Medium') == null || jQuery.cookie('UTM_Medium') == "" || jQuery.cookie('UTM_Medium') != utm_medium) {
2055            jQuery.cookie('UTM_Medium', utm_medium);
2056        }
2057    }
2058
2059    if(utm_campaign.length) {
2060        if (jQuery.cookie('UTM_Campaign') == null || jQuery.cookie('UTM_Campaign') == "" || jQuery.cookie('UTM_Campaign') != utm_campaign) {
2061            jQuery.cookie('UTM_Campaign', utm_campaign);
2062        }
2063    }
2064
2065    if(utm_content.length) {
2066        if (jQuery.cookie('UTM_Content') == null || jQuery.cookie('UTM_Content') == "" || jQuery.cookie('UTM_Content') != utm_content) {
2067            jQuery.cookie('UTM_Content', utm_content);
2068        }
2069    }
2070});
2071
2072/* 09.11.2022 - Popup for 'Get a quote' and 'Find a plan' buttons */
2073jQuery(document).ready(function($){
2074
2075    // $('.sf_lead_gen_entry a.button.cta, .popupForGetAQuote_trigger.old-popup-trigger').click(function(event) {
2076    //     event.preventDefault();
2077    //
2078    //     if ($('.sf_faux_modal.hio-theme').length > 0) {
2079    //         $('.sf_faux_modal.hio-theme').show();
2080    //     }
2081    //
2082    // });
2083
2084    let mobilePopupBtn = jQuery('nav.mobile_menu li.popupForGetAQuote_trigger');
2085
2086    if(mobilePopupBtn.length) {
2087        mobilePopupBtn.attr('data-contentid', 'popupForGetAQuote');
2088    }
2089
2090    // let mobileQuotes = jQuery('div.mobile_quotes_panel');
2091    // let mobileQuotesLink = jQuery('a.mobile_quotes_text');
2092    //
2093    // if(mobileQuotes.length) {
2094    //     //mobileQuotesLink.attr('href', '#popupForGetAQuote');
2095    //     mobileQuotes.attr('data-contentid', 'popupForGetAQuote');
2096    //     mobileQuotes.addClass('popupForGetAQuote_trigger');
2097    // }
2098
2099    $('.popupForGetAQuote_trigger:not(.old-popup-trigger)').click(function(event) {
2100        event.preventDefault();
2101
2102
2103        //let hashURL = jQuery(this).attr("href");
2104        // console.log(hashURL);
2105        //history.replaceState(null, document.title , window.location.pathname + hashURL);
2106        // popup_former_data = jQuery(this).next();
2107        // console.log(popup_former_data);
2108        modal_content_id = ('#' + $(this).data('contentid'));
2109        // console.log(modal_content_id);
2110        var cboxOptions = {
2111            close:'X',
2112            className: 'get_a_quote_popup_wrapper',
2113            inline:true,
2114            fixed:true,
2115            scrolling:true,
2116            height: '95%',
2117            width: '95%',
2118            maxWidth: '580px',
2119            maxHeight: '240px',
2120            href: modal_content_id,
2121            onOpen: function() {
2122                $(modal_content_id).show();
2123            },
2124            onCleanup: function() {
2125                $(modal_content_id).hide();
2126                // $(popup_former_data).hide();
2127            }
2128        }
2129        $(this).colorbox(cboxOptions);
2130    });
2131
2132    if( window.innerWidth < 1000 ){
2133        jQuery('#popupForGetAQuote input.zip').attr('placeholder','Enter ZIP');
2134    }
2135    else{
2136        jQuery('#popupForGetAQuote input.zip').attr('placeholder','00000');
2137    }
2138
2139    $('.popupForGetAQuote_content').hide();
2140    $('.popupForGetAQuote_content').css('display','none');
2141
2142    $(window).resize(function(){
2143        if(jQuery('#cboxOverlay').is(':visible')){
2144            jQuery.colorbox.resize({
2145                width: window.innerWidth > 1000 ? '580px' : '95%',
2146                //height: window.innerHeight > 700 ? '250px' : '95%'
2147            });
2148        }
2149
2150        if( window.innerWidth < 1000 ){
2151            jQuery('#popupForGetAQuote input.zip').attr('placeholder','Enter ZIP');
2152        }
2153        else{
2154            jQuery('#popupForGetAQuote input.zip').attr('placeholder','00000');
2155        }
2156    });
2157});
2158
2159//HIO Index Section
2160jQuery(document).ready(function($){
2161    if($('.index-section-sidebar').length) {
2162        let medicaidRedeterminationIndexSectionTopDistance = $('.index-section-sidebar').offset().top;
2163        let medicaidRedeterminationTitleSectionTopDistance = $('.oep-title-subtitle-widget').offset().top;
2164
2165        $('.index-section-sidebar').css('top', medicaidRedeterminationTitleSectionTopDistance + 150);
2166
2167        $(window).resize(function () {
2168            medicaidRedeterminationTitleSectionTopDistance = $('.oep-title-subtitle-widget').offset().top;
2169            $('.index-section-sidebar').css('top', medicaidRedeterminationTitleSectionTopDistance + 150);
2170        });
2171
2172        let medicaidRedeterminationIndexSectionAnchors = [];
2173        let IndexSectionAnchorsInsideContent = [];
2174        $('.index-section-sidebar').find('li a').each(function () {
2175            medicaidRedeterminationIndexSectionAnchors.push($(this).attr('href'));
2176        });
2177        medicaidRedeterminationIndexSectionAnchors.forEach(function (value) {
2178            value = value.replace('#', '');
2179            if ($('.homepage-new').find(`a[id="${value}"]`).length) {
2180                IndexSectionAnchorsInsideContent.push($('.homepage-new').find(`a[id="${value}"]`));
2181            }
2182            if ($('.homepage-new').find(`a[name="${value}"]`).length) {
2183                IndexSectionAnchorsInsideContent.push($('.homepage-new').find(`a[name="${value}"]`));
2184            }
2185        });
2186        $(window).on('scroll', function () {
2187            let scrollTop = $(this).scrollTop();
2188            let position = '';
2189            let currentIndexSectionAnchor;
2190
2191            if (jQuery(this).width() >= 1850) {
2192                if ((medicaidRedeterminationIndexSectionTopDistance - 70) < scrollTop) {
2193                    if (position != 'fixed') {
2194                        $('.index-section-sidebar').addClass("index-section-sidebar-fixed");
2195                        position = 'fixed';
2196                    }
2197                } else {
2198                    if (position != 'absolute') {
2199                        $('.index-section-sidebar').removeClass("index-section-sidebar-fixed");
2200                        position = 'absolute';
2201                    }
2202                }
2203
2204                if (scrollTop - IndexSectionAnchorsInsideContent[IndexSectionAnchorsInsideContent.length - 1].offset().top > 100) {
2205                    $('.index-section-sidebar').removeClass("index-section-sidebar-fixed");
2206                    position = 'absolute';
2207                }
2208
2209                if ((IndexSectionAnchorsInsideContent[0].offset().top - 70) > scrollTop) {
2210                    $('.index-section-sidebar').find('li').removeClass("index-section-sidebar-active-element");
2211                }
2212
2213                IndexSectionAnchorsInsideContent.forEach(function (value) {
2214                    currentIndexSectionAnchor = jQuery(value);
2215                    currentIndexSectionAnchorTopDistance = currentIndexSectionAnchor.offset().top;
2216                    if ((currentIndexSectionAnchorTopDistance - 70) < scrollTop) {
2217                        $('.index-section-sidebar').find('li').removeClass("index-section-sidebar-active-element");
2218                        $('.index-section-sidebar').find(`li a[href="#${currentIndexSectionAnchor.attr('id')}"]`).parent('li').addClass("index-section-sidebar-active-element");
2219                        $('.index-section-sidebar').find(`li a[href="#${currentIndexSectionAnchor.attr('name')}"]`).parent('li').addClass("index-section-sidebar-active-element");
2220                    }
2221                });
2222
2223            } else {
2224                $('.index-section-sidebar').removeClass("index-section-sidebar-fixed");
2225                position = 'absolute';
2226            }
2227
2228        });
2229    }
2230});
2231
2232
2233jQuery(document).ready(function($) {
2234    // When an element with the class 'hio-footnotes-title' is clicked,
2235    // toggle the 'active' class on the clicked element,
2236    // and slide toggle the next sibling element with the class 'footnotes'.
2237    $('.hio-footnotes-title').on('click', function() {
2238        $(this).toggleClass('active');
2239        $(this).next('.footnotes').slideToggle();
2240    });
2241    $('.footnote-identifier-link').on('click', function () {
2242        $('.hio-footnotes-title').addClass('active');
2243        $('ol.footnotes').slideDown();
2244    })
2245});
2246
2247
2248

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.