/************************


    JS Cookies


*************************/


;


(function(factory) {


    if (typeof define === 'function' && define.amd) {


        define(factory);


    } else if (typeof exports === 'object') {


        module.exports = factory();


    } else {


        var OldCookies = window.Cookies;


        var api = window.Cookies = factory();


        api.noConflict = function() {


            window.Cookies = OldCookies;


            return api;


        };


    }


}(function() {


    function extend() {


        var i = 0;


        var result = {};


        for (; i < arguments.length; i++) {


            var attributes = arguments[i];


            for (var key in attributes) {


                result[key] = attributes[key];


            }


        }


        return result;


    }





    function init(converter) {


        function api(key, value, attributes) {


            var result;


            if (typeof document === 'undefined') {


                return;


            }


            if (arguments.length > 1) {


                attributes = extend({


                    path: '/'


                }, api.defaults, attributes);


                if (typeof attributes.expires === 'number') {


                    var expires = new Date();


                    expires.setMilliseconds(expires.getMilliseconds() + attributes.expires * 864e+5);


                    attributes.expires = expires;


                }


                try {


                    result = JSON.stringify(value);


                    if (/^[\{\[]/.test(result)) {


                        value = result;


                    }


                } catch (e) {}


                if (!converter.write) {


                    value = encodeURIComponent(String(value)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent);


                } else {


                    value = converter.write(value, key);


                }


                key = encodeURIComponent(String(key));


                key = key.replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent);


                key = key.replace(/[\(\)]/g, escape);


                return (document.cookie = [key, '=', value, attributes.expires && '; expires=' + attributes.expires.toUTCString(), attributes.path && '; path=' + attributes.path, attributes.domain && '; domain=' + attributes.domain, attributes.secure ? '; secure' : ''].join(''));


            }


            if (!key) {


                result = {};


            }


            var cookies = document.cookie ? document.cookie.split('; ') : [];


            var rdecode = /(%[0-9A-Z]{2})+/g;


            var i = 0;


            for (; i < cookies.length; i++) {


                var parts = cookies[i].split('=');


                var name = parts[0].replace(rdecode, decodeURIComponent);


                var cookie = parts.slice(1).join('=');


                if (cookie.charAt(0) === '"') {


                    cookie = cookie.slice(1, -1);


                }


                try {


                    cookie = converter.read ? converter.read(cookie, name) : converter(cookie, name) || cookie.replace(rdecode, decodeURIComponent);


                    if (this.json) {


                        try {


                            cookie = JSON.parse(cookie);


                        } catch (e) {}


                    }


                    if (key === name) {


                        result = cookie;


                        break;


                    }


                    if (!key) {


                        result[name] = cookie;


                    }


                } catch (e) {}


            }


            return result;


        }


        api.set = api;


        api.get = function(key) {


            return api(key);


        };


        api.getJSON = function() {


            return api.apply({


                json: true


            }, [].slice.call(arguments));


        };


        api.defaults = {};


        api.remove = function(key, attributes) {


            api(key, '', extend(attributes, {


                expires: -1


            }));


        };


        api.withConverter = init;


        return api;


    }


    return init(function() {});


}));


/************************


    JS Cookies END


*************************/


var wahCurrentMousePos = {


    x: -1,


    y: -1


};


var wnexpress_resize_clicks 		 = wnexpress_get_resize_clicks();


var wnexpress_magic_buttons_top 	 = jQuery('body').hasClass('admin-bar') ? 80 : 60;


var resizable_elements 	         = jQuery("a:not(.wahout),p,span,ul,ol,h1,h2,h3,h4,h5,h6,.vc_custom_heading");


var wnexpress_cookies 		         = wnexpress_settings.wnexpress_cookies ? parseInt(wnexpress_settings.wnexpress_cookies) : 14;


var wnexpress_gdpr_cookies          = wnexpress_settings.wnexpress_gdpr_cookies ? parseInt(wnexpress_settings.wnexpress_gdpr_cookies) : 30;


if ( typeof wnexpress_contrast_elements == 'undefined' && !wnexpress_contrast_elements ) {


	if( jQuery('body').hasClass('nagishx-wah-modern') ){


		var wnexpress_contrast_elements = jQuery('body,header,footer,#colophon,main,section,article,.section,#page,button,input,textarea');


	} else {


		var wnexpress_contrast_elements = jQuery('body,header,footer,#colophon,main,section,article,.section,h1,h2,h3,h4,h5,h6,p,#page,button,input,textarea');


	}





}





var wnexpress_title_elements = jQuery('h1, h2, h3, h4, h5, h6, .title, .entry-title');


var wnexpress_txt_elements   = jQuery('p, li');


var wnexpress_link_elements  = jQuery('a');





jQuery(window).on("load", function() {





	wnexpress_setup_default_txt_styles();





	wnexpress_init_default_title_styles();





	wnexpress_setup_default_link_styles();





	wnexpress_setup_default_contrast_styles();





	wnexpress_load_custom_text_colors();





	wnexpress_load_custom_link_colors();





	jQuery(".aicon_link").fadeIn(350);





	// Handle ESC button and close the WNagish Express sidebar


	jQuery(document).on('keydown', function(e){


		if( jQuery('body').hasClass('nagishx-wah-modern') && jQuery('.accessability_container').hasClass('active') ){


			var keyboard_btn = e.which ? e.which : e.keyCode;


			if( 27 === keyboard_btn ){


				wah_close_sidebar();


				setTimeout( function(){


					jQuery('.aicon_link').removeClass('wne-is-active').focus();


				}, 250);


			}


		}


	});





});





// text to speech


if (typeof wnexpress_settings.wah_enable_web_speech != 'undefined' && wnexpress_settings.wah_enable_web_speech != 0) {


    jQuery('body').on('mouseup', function() {


        var wah_speech = window.speechSynthesis;


        var text = window.getSelection().toString();


        var msg = new SpeechSynthesisUtterance(text);


        // var message_language = document.documentElement.lang;


        // msg.lang             = message_language;





        if (text && wah_speech && msg) {


            // cancel previous selection speaking


            window.speechSynthesis.cancel();


            window.speechSynthesis.speak(msg);


        }


    });


}





jQuery(document).ready(function() {





	if( jQuery('#wne-switch-side').length ){


		var wah_side = '';


		jQuery('#wne-switch-side').on('click', function(e){


			e.preventDefault();


			if( jQuery('body').hasClass('accessibility-location-right') ){


				jQuery('body').removeClass('accessibility-location-right').addClass('accessibility-location-left');


				wah_side = 'left';


			} else {


				jQuery('body').removeClass('accessibility-location-left').addClass('accessibility-location-right');


				wah_side = 'right';


			}


			Cookies.set('wah-side', wah_side, {


				expires: wnexpress_gdpr_cookies


			});


		});


	}





	if( jQuery('body').hasClass( 'nagishx-standart-sidebar' ) ){


		jQuery('.access_container_inner').niceScroll({


			cursorcolor: "#18a1b7",


			cursorwidth: "5px",


			cursorborderradius: "5px"


		});


	}





	if( jQuery('body').hasClass( 'nagishx-wide-sidebar' ) ){





		/************************************************************


			i18n popup


		************************************************************/


		wnexpress_switch_i18n( Cookies.get('wnexpress_current_lang_code') );


		if( jQuery('#select-nagishx-language').length ){


			// load current language


			


			// Open languages popup


			jQuery('#select-nagishx-language').on('click', function(){


				alert("hello");


				jQuery('.nagishx-i18n-languages-list').addClass('active');


				jQuery('.nagishx-i18n-languages-list').attr('aria-hidden', 'false');


				wnexpress_open_sidebar_overlay();


				setTimeout( function(){


					jQuery('.nagishx-close-languages-selector').focus();


					jQuery('.nagishx-i18n-languages-list ul li:last-child button').on('blur', function(){


						jQuery('.nagishx-close-languages-selector').focus();


					});


				}, 350);


			});


			// Close languages popup


			jQuery('.nagishx-close-languages-selector').on('click', function(e){


				e.preventDefault();


				jQuery('.nagishx-i18n-languages-list').removeClass('active');


				jQuery('.nagishx-i18n-languages-list').attr('aria-hidden', 'true');


				wnexpress_close_sidebar_overlay();


			});


			// switch language


			jQuery('.nagishx-i18n-languages-list ul li button').on('click', function(e){


				// handle click


				e.preventDefault();


				var lang_code = jQuery(this).attr('data-lang-code');


				var lang_name = jQuery(this).attr('data-lang');


				wnexpress_switch_i18n(lang_code);


				jQuery('.nagishx-i18n-languages-list').removeClass('active');


				wnexpress_close_sidebar_overlay();


				wnexpress_set_current_language(lang_code, lang_name);


				setTimeout( function(){


					jQuery('#select-nagishx-language').focus();


				}, 350);


			});


		}


		/************************************************************


			i18n popup [END]


		************************************************************/





		jQuery('body.nagishx-wah-modern #wp_nagish_express_container label.wne-action-button').bind("wah_enter_spcace_Key",function(e){


		   jQuery(this).click();


		});


		jQuery('body.nagishx-wah-modern #wp_nagish_express_container label.wne-action-button').keyup(function(e){


			// fire click on enter or space buttons


		    if( e.keyCode == 13 || e.keyCode == 32 ) {


				e.preventDefault();


		        jQuery(this).trigger("wah_enter_spcace_Key");


		    }


		});





		jQuery('.access_container_inner').niceScroll({


            cursorcolor: "#18a1b7",


            cursorwidth: "5px",


            cursorborderradius: "5px"


        });





		// Text alignment module


		jQuery('.font-alignment-settings-inner .a_module_exe label').on('click', function(e){


			e.preventDefault();


			var input      = jQuery(this).find('input[type="checkbox"]');


			var id         = jQuery(this).attr('id');


			var input_name = input.attr('name');


			if( ! input.is(':checked') ){


				jQuery('.font-alignment-settings-inner .a_module_exe label input:checked').prop('checked', false );


				jQuery('.font-alignment-settings-inner .a_module_exe label').each( function(){


					var input = jQuery(this).find('input');


					if( id == input.attr('name') ){


						input.prop('checked', true );


					}


				});


				setTextAlignmentCookie(id);


			} else {


				jQuery('.font-alignment-settings-inner .a_module_exe label').each( function(){


					var input = jQuery(this).find('input');


					if( id == input.attr('name') ){


						input.prop('checked', false );


					}


				});


				setTextAlignmentCookie('');


			}


		});


	}





	wnexpress_init_accessibility_statement();





    init_report_problem();





    wnexpress_log();





    load_wah_cookies();





    var $body = jQuery("body"),


        $body_link = jQuery("body a");





    var currFFZoom = 1;


    var currIEZoom = 100;





    // Accept WAH GDPR


    if (jQuery('.accept-wah-gdpr-popup').length) {


        jQuery('.accept-wah-gdpr-popup').on('click', function(e) {


            e.preventDefault();


            Cookies.set('wahgdpr', 'on', {


                expires: wnexpress_gdpr_cookies


            });


            jQuery('#wah-gdpr-popup').fadeOut(300, function() {


                jQuery(this).remove();


            });


        });


    }


    // Cancel WAH GDPR


    if (jQuery('.close-wah-gdpr-popup').length) {


        jQuery('.close-wah-gdpr-popup').on('click', function(e) {


            e.preventDefault();


            jQuery('#wah-gdpr-popup').fadeOut(300, function() {


                jQuery(this).remove();


            });


        });


    }


    // wah gdpr - remove gdrp popup cache fix


    if (typeof Cookies.get('wahgdpr') != 'undefined' && Cookies.get('wahgdpr') == 'on') {


        if (jQuery('#wah-gdpr-popup').length) {


            jQuery('#wah-gdpr-popup').remove();


        }


    } else {


        if (jQuery('#wah-gdpr-popup').length) {


            jQuery('#wah-gdpr-popup').css('display', 'block');


        }


    }





    //Accessibility


    if (jQuery('body').hasClass('ie')) {


        console.log('IE browser detected');


        jQuery("#wp_nagish_express_container").prependTo('body');


    } else {


        jQuery("#wp_nagish_express_container").prependTo('body');


    }





    // Add Skiplinks to DOM


    jQuery(".wne-skiplinks-menu").prependTo('body');





    // Open sidebar


    jQuery(".aicon_link").click(function(event) {


        event.preventDefault();


        if (jQuery(this).hasClass('wne-is-active')) {


            if (!jQuery(this).hasClass('layout-magic-sidebar')) {


                wah_close_sidebar();


                jQuery(this).removeClass('wne-is-active');


            } else {


                wnexpress_hide_magic_buttons();


                jQuery(this).removeClass('wne-is-active');


            }





        } else {


            wah_open_sidebar();


            jQuery(this).addClass('wne-is-active');


        }





    });


    // Close sidebar


    jQuery(".close_container, .wne-close-sidebar").click(function(event) {


        event.preventDefault();


        jQuery(".aicon_link.wne-is-active").removeClass('wne-is-active');


        wah_close_sidebar();


    });


    // Close magic sidebar


    jQuery(".close-wah-magic-sidebar").click(function(event) {


        event.preventDefault();


        wnexpress_hide_magic_buttons();


    });





    //FONT SIZE


    if ( jQuery("body").hasClass('wah_fstype_rem') ) {


        jQuery(".smaller").click(function(event) {


            event.preventDefault();


            var fontSize = parseInt(jQuery("html").css("font-size"));


            if (fontSize > 12) {


                fontSize = fontSize - 1 + "px";


                jQuery("html").css({


                    'font-size': fontSize


                });


            }


        });


        jQuery(".larger").click(function(event) {


            event.preventDefault();


            var fontSize = parseInt(jQuery("html").css("font-size"));


            if (fontSize < 24) {


                fontSize = fontSize + 1 + "px";


                jQuery("html").css({


                    'font-size': fontSize


                });


            }


        });


    } else if (jQuery("body").hasClass("wah_fstype_zoom")) {


        jQuery(".larger").click(function() {


            var step;


            if ($body.hasClass('gecko')) {


                step = 0.05;


                currFFZoom += step;


                $body.css('MozTransform', 'scale(' + currFFZoom + ',' + currFFZoom + ')');


                $body.css('transform-origin', '50% 50%');


            } else {


                step = 5;


                currIEZoom += step;


                $body.css('zoom', ' ' + currIEZoom + '%');


            }


        });


        jQuery(".smaller").click(function() {


            var step;


            if ($body.hasClass('gecko')) {


                step = 0.05;


                currFFZoom -= step;


                $body.css('MozTransform', 'scale(' + currFFZoom + ',' + currFFZoom + ')');


                $body.css('transform-origin', '50% 50%');


            } else {


                step = 5;


                currIEZoom -= step;


                $body.css('zoom', ' ' + currIEZoom + '%');


            }


        });


    } else {


        resizable_elements.each(function() {


            jQuery(this).attr('data-wahfont', parseInt(jQuery(this).css('font-size')));


        });


        wne_font_resizer();


    }





    //Remove styles


    jQuery(".wah-call-remove-styles").click(function(event) {


		if( ! jQuery(this).hasClass('is-wah-label') ){


			event.preventDefault();


		}


        jQuery('link:not(#wpah-front-styles-css)').each(function(index, value) {


            if (jQuery(this).attr('disabled')) {


                jQuery(this).removeAttr('disabled');


            } else {


                jQuery(this).attr('disabled', 'disabled');


            }


        });


    });


	// User toggle color sheme


	jQuery('.wah-toggle-color-theme').click( function(e){


		e.preventDefault();


		if( jQuery('.accessability_container').hasClass('dark_theme') ){


			Cookies.set('wah_user_color_sheme', 'light_theme', {


				expires: wnexpress_cookies


			});


		} else {


			Cookies.set('wah_user_color_sheme', 'dark_theme', {


				expires: wnexpress_cookies


			});


		}


		jQuery('.accessability_container').toggleClass('dark_theme light_theme');


	});


    // Mute volume


    jQuery(".wne-set-mute").click(function(e) {


		if( ! jQuery(this).hasClass('is-wah-label') ){


			e.preventDefault();


		}


        if (!jQuery(this).hasClass('active_button')) {


            wah_mute_volume(true);


        } else {


            wah_mute_volume(false);


        }


        jQuery(this).find('span.goi-sound-icon').toggleClass('goi-sound-full goi-sound-off');


        toggleCookiesClasses("wah-mute-on");


    });





    //Greyscale images


    jQuery(".wne-call-greyscale").click(function(event) {


		if( ! jQuery(this).hasClass('is-wah-label') ){


			event.preventDefault();


		}


        toggleCookiesClasses("active_greyscale");


    });





	//Hide images


	jQuery(".wne-set-hide-images").click(function(event) {


		if( ! jQuery(this).hasClass('is-wah-label') ){


			event.preventDefault();


		}


		toggleCookiesClasses("active_hide_images");


	});





    //Underline links


    jQuery(".wne-call-underline-links").click(function(event) {


		if( ! jQuery(this).hasClass('is-wah-label') ){


			event.preventDefault();


		}


        toggleCookiesClasses("is_underline");


    });





    //wp-nagish-express #contrast


    jQuery("#contrast_trigger").click(function(event) {


        event.preventDefault();


		jQuery(".color_selector").toggleClass('is_visible');


		jQuery(".color_selector").attr('aria-hidden', 'false');


    });





	/**************************************


		Adjust Title colors


	**************************************/


	jQuery('.titles_color_selector button').click( function(e){


		e.preventDefault();


		var button = jQuery(this);


		var id     = button.attr('id');


		var color  = button.attr('data-color');





		if( ! button.hasClass('is-active') ){





			jQuery('.titles_color_selector button').removeClass('is-active');


			button.addClass('is-active');





			//Append styles


			wnexpress_title_elements.each( function(){


				var item_style = '';


				if( ! jQuery(this).hasClass('wahout')  ){


					if( typeof jQuery(this).attr('style') != 'undefined' ){


						var def_txt_style = jQuery(this).attr('data-nagishx-titles-style');


						item_style        = def_txt_style + ' color: '+ color + ' !important;';


					} else {


						item_style = 'color: '+ color + ' !important;';


					}


					jQuery(this).attr('style', item_style);


				}


			});





			jQuery('body').addClass('nagishx-custom-title-colors-on');


			Cookies.set('wahc_nagishx-custom-title-colors-on', 'on', {


				expires: wnexpress_cookies


			});





			jQuery('body').removeClass('tci-1 tci-2 tci-3 tci-4 tci-5 tci-6 tci-7 tci-8 tci-9 tci-10');


			Cookies.remove('wahc_tci-1');


			Cookies.remove('wahc_tci-2');


			Cookies.remove('wahc_tci-3');


			Cookies.remove('wahc_tci-4');


			Cookies.remove('wahc_tci-5');


			Cookies.remove('wahc_tci-6');


			Cookies.remove('wahc_tci-7');


			Cookies.remove('wahc_tci-8');


			Cookies.remove('wahc_tci-9');


			Cookies.remove('wahc_tci-10');





			jQuery('body').addClass(id);


			Cookies.set('wahc_'+id, 'on', {


				expires: wnexpress_cookies


			});





		} else {





			jQuery('body').removeClass('nagishx-custom-title-colors-on');


			Cookies.remove('wahc_nagishx-custom-title-colors-on');





			jQuery('body').removeClass('tci-1 tci-2 tci-3 tci-4 tci-5 tci-6 tci-7 tci-8 tci-9 tci-10');


			Cookies.remove('wahc_'+id);





			// Clear styles


			wnexpress_title_elements.each( function(){


				var item_style = '';


				if( ! jQuery(this).hasClass('wahout')  ){


					var def_txt_style = jQuery(this).attr('data-nagishx-titles-style');


					jQuery(this).attr('style', def_txt_style);


				}


			});





			button.removeClass('is-active');


		}





	});





	/**************************************


		Adjust Text colors


	**************************************/


	jQuery('.text_color_selector button').click( function(e){


		e.preventDefault();


		var button = jQuery(this);


		var id     = button.attr('id');


		var color  = button.attr('data-color');





		if( ! button.hasClass('is-active') ){





			jQuery('.text_color_selector button').removeClass('is-active');


			button.addClass('is-active');





			//Append styles


			wnexpress_txt_elements.each( function(){


				var item_style = '';


				if( ! jQuery(this).hasClass('wahout')  ){


					if( typeof jQuery(this).attr('style') != 'undefined' ){


						var def_txt_style = jQuery(this).attr('data-nagishx-txt-style');


						jQuery(this).attr('style', def_txt_style + ' color: '+ color + ' !important;' );


					} else {


						item_style = 'color: '+ color + ' !important;';


						jQuery(this).attr('style', item_style );


					}


				}


			});





			jQuery('body').addClass('nagishx-custom-text-colors-on');


			Cookies.set('wahc_nagishx-custom-text-colors-on', 'on', {


				expires: wnexpress_cookies


			});





			jQuery('body').removeClass('txtci-1 txtci-2 txtci-3 txtci-4 txtci-5 txtci-6 txtci-7 txtci-8 txtci-9 txtci-10');


			Cookies.remove('wahc_txtci-1');


			Cookies.remove('wahc_txtci-2');


			Cookies.remove('wahc_txtci-3');


			Cookies.remove('wahc_txtci-4');


			Cookies.remove('wahc_txtci-5');


			Cookies.remove('wahc_txtci-6');


			Cookies.remove('wahc_txtci-7');


			Cookies.remove('wahc_txtci-8');


			Cookies.remove('wahc_txtci-9');


			Cookies.remove('wahc_txtci-10');





			jQuery('body').addClass(id);


			Cookies.set('wahc_'+id, 'on', {


				expires: wnexpress_cookies


			});





		} else {





			button.removeClass('is-active');





			jQuery('body').removeClass('nagishx-custom-text-colors-on');





			Cookies.remove('wahc_nagishx-custom-text-colors-on');





			jQuery('body').removeClass('txtci-1 txtci-2 txtci-3 txtci-4 txtci-5 txtci-6 txtci-7 txtci-8 txtci-9 txtci-10');


			Cookies.remove('wahc_'+id);





			// Clear styles


			wnexpress_txt_elements.each( function(){


				var item_style = jQuery(this).attr('style');


				if( ! jQuery(this).hasClass('wahout')  ){


					if( typeof item_style != 'undefined' ){


						var def_txt_style = jQuery(this).attr('data-nagishx-txt-style');


						jQuery(this).attr('style', def_txt_style );


					} else {


						jQuery(this).removeAttr('style');


					}


				}


			});





		}





	});





	/**************************************


		Adjust Link colors


	**************************************/


	jQuery('.link_color_selector button').click( function(e){


		e.preventDefault();


		var button = jQuery(this);


		var id     = button.attr('id');


		var color  = button.attr('data-color');





		if( ! button.hasClass('is-active') ){





			jQuery('.link_color_selector button').removeClass('is-active');


			button.addClass('is-active');





			//Append styles


			wnexpress_link_elements.each( function(){


				var item_style = '';


				if( ! jQuery(this).hasClass('wahout')  ){


					if( typeof jQuery(this).attr('style') != 'undefined' ){


						var def_txt_style = jQuery(this).attr('data-nagishx-txt-style');


						jQuery(this).attr('style', def_txt_style + ' color: '+ color + ' !important;' );


					} else {


						item_style = 'color: '+ color + ' !important;';


						jQuery(this).attr('style', item_style );


					}


				}


			});





			jQuery('body').addClass('nagishx-custom-link-colors-on');


			Cookies.set('wahc_nagishx-custom-link-colors-on', 'on', {


				expires: wnexpress_cookies


			});





			jQuery('body').removeClass('linkci-1 linkci-2 linkci-3 linkci-4 linkci-5 linkci-6 linkci-7 linkci-8 linkci-9 linkci-10');


			Cookies.remove('wahc_linkci-1');


			Cookies.remove('wahc_linkci-2');


			Cookies.remove('wahc_linkci-3');


			Cookies.remove('wahc_linkci-4');


			Cookies.remove('wahc_linkci-5');


			Cookies.remove('wahc_linkci-6');


			Cookies.remove('wahc_linkci-7');


			Cookies.remove('wahc_linkci-8');


			Cookies.remove('wahc_linkci-9');


			Cookies.remove('wahc_linkci-10');





			jQuery('body').addClass(id);


			Cookies.set('wahc_'+id, 'on', {


				expires: wnexpress_cookies


			});





		} else {





			button.removeClass('is-active');





			jQuery('body').removeClass('nagishx-custom-link-colors-on');





			Cookies.remove('wahc_nagishx-custom-link-colors-on');





			jQuery('body').removeClass('linkci-1 linkci-2 linkci-3 linkci-4 linkci-5 linkci-6 linkci-7 linkci-8 linkci-9 linkci-10');


			Cookies.remove('wahc_'+id);





			// Clear styles


			wnexpress_link_elements.each( function(){


				var item_style = jQuery(this).attr('style');


				if( ! jQuery(this).hasClass('wahout')  ){


					if( typeof item_style != 'undefined' ){


						var def_txt_style = jQuery(this).attr('data-nagishx-txt-style');


						jQuery(this).attr('style', def_txt_style );


					} else {


						jQuery(this).removeAttr('style');


					}


				}


			});





		}





	});





    /***************************************


		Color variable selector


	****************************************/


    jQuery(".convar").click(function(event) {


        event.preventDefault();


		var convar_btn    = jQuery(this);


        var bg_color      = convar_btn.data("bgcolor");


        var text_color    = convar_btn.data("color");


		var convar_id     = convar_btn.attr('data-id');


		var remove_convar = false;


		if( ! jQuery('body').hasClass('nagishx-wah-modern') ){


			console.log(wnexpress_contrast_elements);


			wnexpress_contrast_elements.each( function(){


				if( ! jQuery(this).hasClass('wahout') ){


					var current_item_style = jQuery(this).attr('style');


					if( typeof current_item_style === 'undefined' ){


						jQuery(this).removeAttr('style');


						jQuery(this).attr('style', 'background-color: '+bg_color+' !important; color: '+ text_color + ' !important;');


					} else {


						jQuery(this).attr('style', jQuery(this).attr('style') + '; background-color: ' + bg_color + ' !important; color: '+text_color+' !important;');


					}


				}


			});





			jQuery('a').removeAttr('style');


			jQuery('a').attr('style', jQuery('a').attr('style') + '; ' + 'color: '+text_color+' !important');


		}





		if( jQuery('body').hasClass('nagishx-wah-modern')){





			if( ! convar_btn.hasClass('nagishx-contrast-property-is-active') ){


				// append styles


				wnexpress_contrast_elements.each( function(){


					if( ! jQuery(this).hasClass('wahout') ){


						var current_item_style = jQuery(this).attr('style');


						if( typeof current_item_style === 'undefined' ){


							jQuery(this).removeAttr('style');


							jQuery(this).attr('style', 'background-color: ' + bg_color + ' !important;');


						} else {


							jQuery(this).attr('style', jQuery(this).attr('style') + '; background-color: ' + bg_color + ' !important;');


						}


					}


				});


				jQuery('.nagishx-contrast-property-is-active').removeClass('nagishx-contrast-property-is-active');


				convar_btn.addClass('nagishx-contrast-property-is-active');


			} else {


				// remove styles


				wnexpress_contrast_elements.each( function(){


					if( ! jQuery(this).hasClass('wahout') ){


						var current_item_style = jQuery(this).attr('style');


						if( typeof current_item_style != 'undefined' ){


							var new_style = current_item_style.replace('background-color: '+bg_color+' !important;', '');


							jQuery(this).attr('style', new_style );


						}


					}


				});


				convar_btn.removeClass('nagishx-contrast-property-is-active');





				Cookies.remove('wahBgColor');


				Cookies.remove('wahFontColor');


				bg_color      = false;


				text_color    = false;


				remove_convar = true;


			}


		}





        setContrastCookie(bg_color, text_color);





        jQuery(".color_selector").removeClass('is_visible');


        jQuery(".color_selector").attr('aria-hidden', 'true');





        if ( jQuery('body').hasClass('wah_custom_color') ) {


			if( ! jQuery('body').hasClass('nagishx-wah-modern') ) {


				jQuery('body').removeClass('wah_custom_color');


				Cookies.remove('wahc_wah_custom_color');


			}


        } else {


			if( ! jQuery('body').hasClass('nagishx-wah-modern') ) {


	            jQuery('body').addClass('wah_custom_color');


	            Cookies.set('wahc_wah_custom_color', 'on', {


	                expires: wnexpress_cookies


	            });


			}





			if( typeof convar_id !='undefined' && convar_id ){


				Cookies.set('wahc_convar_on', convar_id, {


					expires: wnexpress_cookies


				});


			}


        }





		if( jQuery('body').hasClass('nagishx-wah-modern') ) {


			if( remove_convar ){


				Cookies.remove('wahc_convar_on');


			}


		}





    });





    /***************************************


		Enable background image selectors


	****************************************/


    if (typeof wnexpress_Controller != 'undefined' && wnexpress_Controller.wah_greyscale_selectors) {


        jQuery(wnexpress_Controller.wah_greyscale_selectors).each(function() {


            jQuery(this).addClass('wah-greyscale-element');


        });


    }





    //enable rel="link"


    if (typeof wnexpress_Controller != 'undefined' && wnexpress_Controller.roleLink == 1) {


        $body_link.each(function() {


            jQuery(this).attr("role", "link");


        });


    }





    //remove link title attribute


    if (typeof wnexpress_Controller != 'undefined' && wnexpress_Controller.removeLinkTitles == 1) {


        $body_link.each(function() {


            if (jQuery(this).attr("title")) {


                jQuery(this).attr("title", "");


                jQuery(this).removeAttr("title");


            }


        });


    }





    //add header landmark


    if (typeof wnexpress_Controller != 'undefined' && wnexpress_Controller.headerElementSelector) {


        $body.find(wnexpress_Controller.headerElementSelector).attr("role", "banner");


    }





    //add sidebar landmark


    if (typeof wnexpress_Controller != 'undefined' && wnexpress_Controller.sidebarElementSelector) {


        $body.find(wnexpress_Controller.sidebarElementSelector).attr("role", "complementary");


    }





    //add footer landmark


    if (typeof wnexpress_Controller != 'undefined' && wnexpress_Controller.footerElementSelector) {


        $body.find(wnexpress_Controller.footerElementSelector).attr("role", "contentinfo");


    }





    //add main landmark


    if (typeof wnexpress_Controller != 'undefined' && wnexpress_Controller.mainElementSelector) {


        $body.find(wnexpress_Controller.mainElementSelector).attr("role", "main");


    }





    //add navigation landmark


    if (typeof wnexpress_Controller != 'undefined' && wnexpress_Controller.navElementSelector) {


        $body.find(wnexpress_Controller.navElementSelector).attr("role", "navigation");


    }





    //cookies


    if (typeof Cookies.get('wahFontColor') != 'undefined' && typeof Cookies.get('wahBgColor') != 'undefined') {


		jQuery.each( wnexpress_contrast_elements, function(key, item){


			if( ! jQuery(item).hasClass('wahout') ){





				var current_item_style = jQuery(item).attr('style');


				// console.log(item + ' : ' + current_item_style);


				if( typeof current_item_style === 'undefined' ){


					jQuery(item).removeAttr('style');


					jQuery(item).attr('style', 'background-color: '+Cookies.get('wahBgColor')+' !important; color: '+Cookies.get('wahFontColor')+' !important;');


				} else {


					jQuery(item).attr('style', jQuery(item).attr('style') + '; background-color: '+Cookies.get('wahBgColor')+' !important; color: '+Cookies.get('wahFontColor')+' !important;');


				}


			}


		});


		jQuery('a').removeAttr('style');


		jQuery('a').attr('style', jQuery('a').attr('style') + '; ' + 'color: '+Cookies.get('wahFontColor')+' !important;');


    }





    //Lights Off


    if (typeof wnexpress_Controller != 'undefined' && wnexpress_Controller.wah_lights_off_selector) {


        jQuery(".wah-lights-off").click(function(e) {


            e.preventDefault();


            if (!jQuery("body").hasClass("wah-lights-off")) {


                jQuery("body").append('<div class="wah-dark-overlay"></div>');


                jQuery("body").addClass("wah-lights-off");


                jQuery(wnexpress_Controller.wah_lights_off_selector).addClass('wah-lights-selector');


            } else {


                jQuery("body .wah-dark-overlay").remove();


                jQuery("body").removeClass("wah-lights-off");


                jQuery(wnexpress_Controller.wah_lights_off_selector).removeClass('wah-lights-selector');


            }


        });


    }





    jQuery(".wne-call-clear-cookies").click(function(e) {


        e.preventDefault();


        removeAllCookies();


    });





    // Set wah layout [BETA]


    set_wah_layout();





	// wah render table of contents


	jQuery('.wne-call-toc').click( function(e){


		wnexpress_render_toc();


	});





    //highlight_links_setup


    jQuery(".wne-call-highlight-links").click(function(e) {


		if( ! jQuery(this).hasClass('is-wah-label') ){


			e.preventDefault();


		}


        toggleCookiesClasses("highlight_links_on");


    });





    //invert mode


    jQuery(".wne-call-invert").click(function(e) {


		if( ! jQuery(this).hasClass('is-wah-label') ){


			e.preventDefault();


		}


        toggleCookiesClasses("invert_mode_on");


    });





    //monochrome mode


    jQuery(".wne-call-monochrome_mode").click(function(e) {


		if( ! jQuery(this).hasClass('is-wah-label') ){


			e.preventDefault();


		}


        toggleCookiesClasses("wah-enable-monochrome-filter");


    });





    // sepia mode


    jQuery(".wne-call-sepia_mode").click(function(e) {


		if( ! jQuery(this).hasClass('is-wah-label') ){


			e.preventDefault();


		}


        toggleCookiesClasses("wah-enable-sepia-filter");


    });





    //remove animations


    jQuery(".wne-call-remove-animations").click(function(e) {


		if( ! jQuery(this).hasClass('is-wah-label') ){


			e.preventDefault();


		}


        toggleCookiesClasses("remove_animations");


    });





    //active button


    jQuery(".wne-action-button").click(function() {


		// Color adjustment settings


		if( jQuery(this).hasClass('wne-toggle-cas') && jQuery('body').hasClass('nagishx-wah-modern') ){


			if( jQuery('.nagishx-modern-contrast-container').attr('aria-hidden') == 'true' ) {


				jQuery('.nagishx-modern-contrast-container').attr('aria-hidden', 'false');


			} else {


				jQuery('.nagishx-modern-contrast-container').attr('aria-hidden', 'true');


			}


			jQuery('.nagishx-modern-contrast-container').toggle();


			refresh_wnexpress_nicescroll();


		}


		// Text alignment module exception


        if (jQuery(this).hasClass('wne-uniqid') && jQuery('body').hasClass('nagishx-wah-modern') ) {


            var parent_alignment = jQuery(this).parents('.a_module');


            parent_alignment.find('button').removeClass('active_button');


            parent_alignment.find('button').attr('aria-pressed', 'false');


            jQuery(this).addClass('active_button').attr('aria-pressed', 'true');





        } else {





			if( ! jQuery('body').hasClass('nagishx-wah-modern') ){


				if (


					'align-left' == jQuery(this).attr('data-wahaction') ||


					'align-right' == jQuery(this).attr('data-wahaction') ||


					'align-center' == jQuery(this).attr('data-wahaction')


				) {


					setTextAlignmentCookie(jQuery(this).attr('id'));


				}


			}





			if( ! jQuery(this).hasClass('wne-call-toc') && ! jQuery(this).hasClass('wne-toggle-cas') ){


				jQuery(this).toggleClass("active_button");


			}


        }


    });





    //readable font


    jQuery(".readable_fonts .wne-action-button, .wp-block-nagishx-readable-font button.wah-g-action-button").click(function(e) {


        e.preventDefault();


        toggleCookiesClasses("arial_font_on");


    });





    //letter spacing


    jQuery(".wne-set-letter_spacing").click(function(e) {


		if( ! jQuery(this).hasClass('is-wah-label') ){


			e.preventDefault();


		}


        toggleCookiesClasses("wne_letter_spacing");


    });





	//Word spacing


	jQuery(".wne-set-word_spacing").click(function(e) {


		if( ! jQuery(this).hasClass('is-wah-label') ){


			e.preventDefault();


		}


		toggleCookiesClasses("wah_word_spacing");


	});





	//Line height


	jQuery(".wne-set-line_height").click(function(e) {


		if( ! jQuery(this).hasClass('is-wah-label') ){


			e.preventDefault();


		}


		toggleCookiesClasses("wah_line_height");


	});





    //Keyboard Navigation


    jQuery(".wne-call-keyboard-navigation").click(function(e) {


		if( ! jQuery(this).hasClass('is-wah-label') ){


			e.preventDefault();


		}


        toggleCookiesClasses("wah_keyboard_access");


    });





    //ADHD Profile


    jQuery(".wne-set-adhd_profile").click(function(e) {


		if( ! jQuery(this).hasClass('is-wah-label') ){


			e.preventDefault();


		}


        toggleCookiesClasses("wne_adhd_profile");


        if (!jQuery('body').hasClass('wah-adhd_fiendly_profile')) {


            init_adhd_fiendly_profile();


        } else {


            remove_adhd_fiendly_profile();


        }


    });





	// Cognitive Disability Profile


	jQuery(".set-wne_enable_cd_profile").click(function(e) {


		if( ! jQuery(this).hasClass('is-wah-label') ){


			e.preventDefault();


		}


		wne_enable_cd_profile();


	});





    // Highlight titles (h1-h6)


    jQuery(".wah-call-highlight-titles").click(function(e) {


		if( ! jQuery(this).hasClass('is-wah-label') ){


			e.preventDefault();


		}


        toggleCookiesClasses("wah_highlight_titles");


    });





    // Inspector mode


    jQuery(".wah-call-inspector_mode").click(function(e) {


		if( ! jQuery(this).hasClass('is-wah-label') ){


			e.preventDefault();


		}


        toggleCookiesClasses("wah_inspector_mode");


        setTimeout(function() {


            location.reload();


        }, 300);


    });





    // Image alt description


    jQuery('.wne-call-image-alt').click(function(e) {


		if( ! jQuery(this).hasClass('is-wah-label') ){


			e.preventDefault();


		}


        toggleCookiesClasses("wah-image-desc-on");


        if (jQuery('body').hasClass('wah-image-desc-on')) {


            jQuery('img.wahImageTooltip').removeClass('wahImageTooltip');


        } else {


            wah_render_image_alt_description();


        }


    });





    // Call image alts if came from cookies


    if (jQuery('body').hasClass('wah-image-desc-on')) {


        wah_render_image_alt_description();


    }





    // Large mouse cursor


    jQuery(".wne-call-large_cursor").click(function(e) {


		if( ! jQuery(this).hasClass('is-wah-label') ){


			e.preventDefault();


		}


        toggleCookiesClasses("wah_large_white_cursor");


    });





	// Vision impaired profile


	jQuery(".set-vision_impaired_profile").click(function(e) {


		if( ! jQuery(this).hasClass('is-wah-label') ){


			e.preventDefault();


		}


		wah_enable_vision_impaired_profile();


	});





    //Fetch scanner params


    if (typeof wnexpress_Controller != 'undefined' && wnexpress_Controller.wah_target_src) {


        wah_target_element = jQuery("body").find("img[src='" + wnexpress_Controller.wah_target_src + "']");


        wah_target_element.addClass("wah_scanner_element");


    }


    if (typeof wnexpress_Controller != 'undefined' && wnexpress_Controller.wah_target_link) {


        wah_target_element = jQuery('a[href="' + wnexpress_Controller.wah_target_link + '"]');


        wah_target_element.addClass("wah_scanner_link");


    }





    wah_accessibility_minibar();





    wah_accordion();





    // LOAD Font size from cookies when script base font resize enabled


    if (jQuery("body").hasClass("wne_fstype_script")) {


        if (typeof wnexpress_resize_clicks != 'undefined' && wnexpress_resize_clicks != 0) {


			console.log('LOAD Font size from cookies when script base font resize enabled');


            resizable_elements.each(function() {


                var current_font_size = jQuery(this).css('font-size');


                jQuery(this).css('font-size', parseInt(current_font_size + wnexpress_resize_clicks) + 'px');


            });


        }


    }





    wnexpress_load_font_size_from_cookies();





});





/******************************************


	Init default titles style


******************************************/


function wnexpress_init_default_title_styles(){


	jQuery.each( wnexpress_title_elements, function(key, item){


		if( ! jQuery(item).hasClass('wahout') ){


			var current_item_style = jQuery(item).attr('style');


			// console.log(item + ' => ' + current_item_style);


			if( typeof current_item_style != 'undefined' ){


				jQuery(item).attr('data-nagishx-titles-style', current_item_style );


			} else {


				jQuery(item).attr('data-nagishx-titles-style', '' );


			}


		}


	});


}


/**************************************


    ADHD Friendly Profile [START]


**************************************/


function init_adhd_fiendly_profile() {





    // var windowHeight = jQuery(window).height();


	var windowHeight = window.innerHeight;





    jQuery('body').addClass('wah-adhd_fiendly_profile');


    jQuery('.wah-adhd_fiendly_profile').append('<div class="wah-adhd-mask wah-adhd-top-element"></div>');


    jQuery('.wah-adhd_fiendly_profile').append('<div class="wah-adhd-mask wah-adhd-bottom-element"></div>');





    jQuery(window).on('mousemove', function(event) {


        // console.log( event.target.tagName + ': ' + event.type);


        wahCurrentMousePos.x = event.screenX;


        wahCurrentMousePos.y = event.screenY;


        var top_mask = windowHeight - wahCurrentMousePos.y;


        var bottom_mask = windowHeight - top_mask - 120;


        jQuery('.wah-adhd-top-element').height(bottom_mask);


        jQuery('.wah-adhd-bottom-element').height(top_mask);


    });


}





function remove_adhd_fiendly_profile() {


    jQuery('body').removeClass('wah-adhd_fiendly_profile');


    jQuery('.wah-adhd-top-element').remove();


    jQuery('.wah-adhd-bottom-element').remove();


}


/**************************************


    ADHD Friendly Profile [END]


**************************************/





function init_report_problem() {


    if (jQuery('#wah-report-problem-popup').length) {


        jQuery('#wah-report-problem-form').submit(function(e) {


            e.preventDefault();


            var form = jQuery(this).serialize();


            jQuery('#wah-report-problem-popup .wah-report-form-row button[type="submit"]').prop('disabled', true);


            submit_wah_report_form(form);


        });


    }


}





function get_wah_score(page_url) {


    jQuery.ajax({


        type: "post",


        dataType: "json",


        url: wnexpress_settings.ajax_url,


        data: {


            action: "get_wah_score",


            page_url: page_url


        },


        success: function(response) {


            if (response.html) {


                jQuery('body').append('<div class="wah-page-score-popup"><div class="wah-page-score-wrapper"><button class="close-wah-page-score">x</button><div class="wah-page-score-popup-inner"></div></div></div>');


                jQuery('.wah-page-score-popup-inner').html(response.html);


            }


        }


    });


}





jQuery(document).on('click', '.close-wah-page-score', function(e) {


    e.preventDefault();


    jQuery('.wah-page-score-popup').fadeOut(250, function() {


        jQuery(this).remove();


    })


});





function submit_wah_report_form(form) {


    jQuery.ajax({


        type: "post",


        dataType: "json",


        url: wnexpress_settings.ajax_url,


        data: {


            action: "submit_wah_report_form",


            form: form


        },


        success: function(response) {


            if (!response.error) {


                // clear the form


                jQuery('#wah-report-problem-form input[name="wah_report_user_email"], #wah-report-problem-form input[name="wah_report_subject"], #wah-report-problem-form textarea').val('');


                // show response


                jQuery('.wah-report-form-row.ajax-response').html(response.html);


                jQuery('#wah-report-problem-popup .wah-report-form-row button[type="submit"]').prop('disabled', false);


                setTimeout(function() {


                    jQuery('.wah-report-form-row.ajax-response').html('');


                }, 5000);


            }


        }


    });


}





function wnexpress_log() {


    if (typeof wnexpress_settings.wnexpress_log != 'undefined' && wnexpress_settings.wnexpress_log) {


        console.log('%c--- WNagish Express ' + wnexpress_settings.plugin_version + ' initialized! ---', 'background: #236478; color: #FFF; font-size: 12px; font-weight:bold;');


        console.log('Images: ', jQuery('img').length);


        console.log('Images wihtout alt tag: ', jQuery('img[alt=""]').length);


        console.log('Heading titles: ', jQuery('h1, h2, h3, h4, h5, h6').length);


        console.log('Links: ', jQuery('a').length);


        console.log('Iframes: ', jQuery('iframe').length);


        console.log('WNagish Express: ', 'https://accessibility-helper.co.il/');


    }


}





function wah_render_image_alt_description() {





    if (jQuery('body').hasClass('wah-image-desc-on')) {


        jQuery('.wah-image-desc-on img').each(function() {


            if (jQuery(this).attr('alt')) {


                jQuery(this).addClass('wahImageTooltip');


            }


        });


    }





    jQuery('.wahImageTooltip').hover(function() {


        // Hover over code


        var title = jQuery(this).attr('alt');


        jQuery(this).data('tipText', title).removeAttr('title');


        jQuery('<p class="wah-tooltip"></p>')


            .text(title)


            .appendTo('body')


            .fadeIn('slow');


    }, function() {


        // Hover out code


        jQuery(this).attr('alt', jQuery(this).data('tipText'));


        jQuery('.wah-tooltip').remove();


    }).mousemove(function(e) {


        var mousex = e.pageX + 20; //Get X coordinates


        var mousey = e.pageY + 10; //Get Y coordinates


        jQuery('.wah-tooltip').css({


            top: mousey,


            left: mousex


        });


    });


}





function load_wah_cookies() {





    var wah_all_cookies = Cookies.get();





    for (var key in wah_all_cookies) {


        if (wah_all_cookies.hasOwnProperty(key)) {


            if (key.substring(0, 5) == "wahc_") {


                var body_class = key.replace("wahc_", "");


				if( body_class ){


					jQuery('body').addClass(body_class);


					// console.log(body_class);


					// console.log(key + " -> " + wah_all_cookies[key] );


				}


            }


        }


    }





	// Load WAH sidebar position


	if( typeof Cookies.get('wah-side') !='undefined' && Cookies.get('wah-side') && jQuery('body').hasClass('nagishx-wah-modern') ){


		var current_wah_side = Cookies.get('wah-side');


		if( current_wah_side == 'left' ) {


			jQuery('body').removeClass('accessibility-location-right').addClass('accessibility-location-left');


		} else {


			jQuery('body').removeClass('accessibility-location-left').addClass('accessibility-location-right');


		}


	}





	// Load WAH user color sheme


	if( typeof Cookies.get('wah_user_color_sheme') !='undefined' && Cookies.get('wah_user_color_sheme') && jQuery('body').hasClass('nagishx-wah-modern') ){


		var wah_user_color_sheme = Cookies.get('wah_user_color_sheme');


		if( wah_user_color_sheme == 'light_theme' ) {


			jQuery('.accessability_container').removeClass('dark_theme').addClass('light_theme');


		} else {


			jQuery('.accessability_container').removeClass('light_theme').addClass('dark_theme');


		}


	}





	if( jQuery('body').hasClass('nagishx-custom-title-colors-on') && jQuery('body').hasClass('nagishx-wah-modern') ){


		if( typeof Cookies.get('wahc_nagishx-custom-title-colors-on') !='undefined' && Cookies.get('wahc_nagishx-custom-title-colors-on') == 'on' ){


			var wnexpress_selected_title_color = '';


			if( typeof Cookies.get('wahc_tci-1') !='undefined' && Cookies.get('wahc_tci-1') == 'on' ){


				jQuery('.titles_color_selector button#tci-1').addClass('is-active');


				wnexpress_selected_title_color = jQuery('.titles_color_selector button#tci-1').attr('data-color');


			}


			if( typeof Cookies.get('wahc_tci-2') !='undefined' && Cookies.get('wahc_tci-2') == 'on' ){


				jQuery('.titles_color_selector button#tci-2').addClass('is-active');


				wnexpress_selected_title_color = jQuery('.titles_color_selector button#tci-2').attr('data-color');


			}


			if( typeof Cookies.get('wahc_tci-3') !='undefined' && Cookies.get('wahc_tci-3') == 'on' ){


				jQuery('.titles_color_selector button#tci-3').addClass('is-active');


				wnexpress_selected_title_color = jQuery('.titles_color_selector button#tci-3').attr('data-color');


			}


			if( typeof Cookies.get('wahc_tci-4') !='undefined' && Cookies.get('wahc_tci-4') == 'on' ){


				jQuery('.titles_color_selector button#tci-4').addClass('is-active');


				wnexpress_selected_title_color = jQuery('.titles_color_selector button#tci-4').attr('data-color');


			}


			if( typeof Cookies.get('wahc_tci-5') !='undefined' && Cookies.get('wahc_tci-5') == 'on' ){


				jQuery('.titles_color_selector button#tci-5').addClass('is-active');


				wnexpress_selected_title_color = jQuery('.titles_color_selector button#tci-5').attr('data-color');


			}


			if( typeof Cookies.get('wahc_tci-6') !='undefined' && Cookies.get('wahc_tci-6') == 'on' ){


				jQuery('.titles_color_selector button#tci-6').addClass('is-active');


				wnexpress_selected_title_color = jQuery('.titles_color_selector button#tci-6').attr('data-color');


			}


			if( typeof Cookies.get('wahc_tci-7') !='undefined' && Cookies.get('wahc_tci-7') == 'on' ){


				jQuery('.titles_color_selector button#tci-7').addClass('is-active');


				wnexpress_selected_title_color = jQuery('.titles_color_selector button#tci-7').attr('data-color');


			}


			if( typeof Cookies.get('wahc_tci-8') !='undefined' && Cookies.get('wahc_tci-8') == 'on' ){


				jQuery('.titles_color_selector button#tci-8').addClass('is-active');


				wnexpress_selected_title_color = jQuery('.titles_color_selector button#tci-8').attr('data-color');


			}


			if( typeof Cookies.get('wahc_tci-9') !='undefined' && Cookies.get('wahc_tci-8') == 'on' ){


				jQuery('.titles_color_selector button#tci-8').addClass('is-active');


				wnexpress_selected_title_color = jQuery('.titles_color_selector button#tci-8').attr('data-color');


			}


			if( typeof Cookies.get('wahc_tci-10') !='undefined' && Cookies.get('wahc_tci-10') == 'on' ){


				jQuery('.titles_color_selector button#tci-10').addClass('is-active');


				wnexpress_selected_title_color = jQuery('.titles_color_selector button#tci-10').attr('data-color');


			}


			jQuery.each( wnexpress_title_elements, function(key, item){


				// console.log(key, '=>', jQuery(item).attr('style') );


				if( ! jQuery(item).hasClass('wahout') ){


					var item_style = jQuery(item).attr('style');


					if( 'undefined' == typeof item_style ){


						jQuery(item).attr('style', 'color: '+ wnexpress_selected_title_color + ' !important;');


					} else {


						jQuery(item).attr('style', item_style + ' color: '+ wnexpress_selected_title_color + ' !important;');


					}


				}


			});


		}


	}





    if (jQuery('body').hasClass('highlight_links_on')) {


        jQuery('.wne-call-highlight-links').addClass('active_button');


		if( jQuery('.wne_highlight_links input[type="checkbox"]').length ){


			jQuery('.wne_highlight_links input[type="checkbox"]').prop('checked', true);


		}


    }





    if (jQuery('body').hasClass('wah-mute-on')) {


        jQuery('#wne_enable_mute').addClass('active_button');


		if( jQuery('.wne_enable_mute input[type="checkbox"]').length ){


			jQuery('.wne_enable_mute input[type="checkbox"]').prop('checked', true);


		}


        jQuery('#wne_enable_mute span.goi-sound-icon').toggleClass('goi-sound-full goi-sound-off');


        wah_mute_volume(true);


    }


    if (jQuery('body').hasClass('arial_font_on')) {


        jQuery('.wne-call-readable-fonts').addClass('active_button');


    }


    if (jQuery('body').hasClass('is_underline')) {


        jQuery('.wne-call-underline-links').addClass('active_button');


		if( jQuery('.wne_underline_links input[type="checkbox"]').length ){


			jQuery('.wne_underline_links input[type="checkbox"]').prop('checked', true);


		}


    }


    if (jQuery('body').hasClass('active_greyscale')) {


        jQuery('.wne-call-greyscale').addClass('active_button');


		if( jQuery('.wah_greyscale input[type="checkbox"]').length ){


			jQuery('.wah_greyscale input[type="checkbox"]').prop('checked', true);


		}


    }


	if (jQuery('body').hasClass('active_hide_images')){


		jQuery('.wne-set-hide-images').addClass('active_button');


		if( jQuery('.wne_enable_hide_images input[type="checkbox"]').length ){


			jQuery('.wne_enable_hide_images input[type="checkbox"]').prop('checked', true);


		}


	}


    if (jQuery('body').hasClass('invert_mode_on')) {


        jQuery('.wne-call-invert').addClass('active_button');


		if( jQuery('.wne_invert input[type="checkbox"]').length ){


			jQuery('.wne_invert input[type="checkbox"]').prop('checked', true);


		}


    }


    if (jQuery('body').hasClass('remove_animations')) {


        jQuery('.wne-call-remove-animations').addClass('active_button');


		if( jQuery('.wne_remove_animations input[type="checkbox"]').length ){


			jQuery('.wne_remove_animations input[type="checkbox"]').prop('checked', true);


		}


    }


    if (jQuery('body').hasClass('wah_highlight_titles')) {


        jQuery('.wah-call-highlight-titles').addClass('active_button');


		if( jQuery('.wah_highlight_titles_setup input[type="checkbox"]').length ){


			jQuery('.wah_highlight_titles_setup input[type="checkbox"]').prop('checked', true);


		}


    }


    if (jQuery('body').hasClass('wah-image-desc-on')) {


        jQuery('.wne-call-image-alt').addClass('active_button');


		if( jQuery('.wne_image_alt_setup input[type="checkbox"]').length ){


			jQuery('.wne_image_alt_setup input[type="checkbox"]').prop('checked', true);


		}


    }


    if (jQuery('body').hasClass('wah_keyboard_access')) {


        jQuery('.wne-call-keyboard-navigation').addClass('active_button');


		if( jQuery('.wne_keyboard_navigation input[type="checkbox"]').length ){


			jQuery('.wne_keyboard_navigation input[type="checkbox"]').prop('checked', true);


		}


    }


    if (jQuery('body').hasClass('wah_custom_color')) {


		jQuery('.wne-call-contrast-trigger').addClass('active_button');


    }


	if (jQuery('body').hasClass('nagishx-wah-modern') ){


		if( jQuery('body').hasClass('convar_on') ){


			if( typeof Cookies.get('wahc_convar_on') !='undefined' && Cookies.get('wahc_convar_on') ){


				jQuery('.color_selector button[data-id="'+Cookies.get('wahc_convar_on')+'"]').addClass('nagishx-contrast-property-is-active');


			}


		}


	}





    if (jQuery('body').hasClass('wah_large_white_cursor')) {


        jQuery('.wne-call-large_cursor').addClass('active_button');


		if( jQuery('.wne_large_cursor input[type="checkbox"]').length ){


			jQuery('.wne_large_cursor input[type="checkbox"]').prop('checked', true);


		}


    }


    if (jQuery('body').hasClass('wah-enable-monochrome-filter')) {


        jQuery('.wne-call-monochrome_mode').addClass('active_button');


		if( jQuery('.wne_enable_monochrome_mode input[type="checkbox"]').length ){


			jQuery('.wne_enable_monochrome_mode input[type="checkbox"]').prop('checked', true);


		}


    }


    if (jQuery('body').hasClass('wah-enable-sepia-filter')) {


        jQuery('.wne-call-sepia_mode').addClass('active_button');


		if( jQuery('.wne_enable_sepia_mode input[type="checkbox"]').length ){


			jQuery('.wne_enable_sepia_mode input[type="checkbox"]').prop('checked', true);


		}


    }


    if (jQuery('body').hasClass('wne_letter_spacing')) {


        jQuery('.wne-set-letter_spacing').addClass('active_button');


		if( jQuery('.wne_enable_letter_spacing_mode input[type="checkbox"]').length ){


			jQuery('.wne_enable_letter_spacing_mode input[type="checkbox"]').prop('checked', true);


		}


    }


	// Word spacing


	if (jQuery('body').hasClass('wah_word_spacing')) {


		jQuery('.wne-set-word_spacing').addClass('active_button');


		if( jQuery('.wne_enable_word_spacing input[type="checkbox"]').length ){


			jQuery('.wne_enable_word_spacing input[type="checkbox"]').prop('checked', true);


		}


	}


	// Line height


	if (jQuery('body').hasClass('wah_line_height')) {


		jQuery('.wne-set-line_height').addClass('active_button');


		if( jQuery('.wne_enable_line_height input[type="checkbox"]').length ){


			jQuery('.wne_enable_line_height input[type="checkbox"]').prop('checked', true);


		}


	}


    // Inspector mode


    if (jQuery('body').hasClass('wah_inspector_mode')) {


        jQuery('.wah-call-inspector_mode').addClass('active_button');


		if( jQuery('.wah_enable_inspector_mode input[type="checkbox"]').length ){


			jQuery('.wah_enable_inspector_mode input[type="checkbox"]').prop('checked', true);


		}


        init_wah_inspector();


    }


    if (jQuery('body').hasClass('wne_adhd_profile')) {


        jQuery('.wne-set-adhd_profile').addClass('active_button');


		if( jQuery('.wne_enable_adhd_profile input[type="checkbox"]').length ){


			jQuery('.wne_enable_adhd_profile input[type="checkbox"]').prop('checked', true);


		}


        init_adhd_fiendly_profile();


    }


	// Text alignment


    if (jQuery('body').hasClass('wne_text_alignment_center')) {


		if( ! jQuery('body').hasClass('nagishx-wah-modern') ){


			jQuery('#wne_text_alignment_center').addClass('active_button').attr('aria-pressed', 'true');


		} else {


			jQuery('.set-wne_text_alignment_center input[type="checkbox"]').prop('checked', true );


		}


    }


    if (jQuery('body').hasClass('wne_text_alignment_left')) {


		if( ! jQuery('body').hasClass('nagishx-wah-modern') ){


			jQuery('#wne_text_alignment_left').addClass('active_button').attr('aria-pressed', 'true');


		} else {


			jQuery('.set-wne_text_alignment_left input[type="checkbox"]').prop('checked', true );


		}


    }


    if (jQuery('body').hasClass('wne_text_alignment_right')) {


		if( ! jQuery('body').hasClass('nagishx-wah-modern') ){


			jQuery('#wne_text_alignment_right').addClass('active_button').attr('aria-pressed', 'true');


		} else {


			jQuery('.set-wne_text_alignment_right input[type="checkbox"]').prop('checked', true );


		}


    }


	// Cognitive Disability Profile


	if (jQuery('body').hasClass('wah_cd_profile')) {


		jQuery('.set-wne_enable_cd_profile').addClass('active_button');


		if( jQuery('.wne_enable_cd_profile input[type="checkbox"]').length ){


			jQuery('.wne_enable_cd_profile input[type="checkbox"]').prop('checked', true);


		}


	}


	// Vision impaired profile


	if( typeof Cookies.get('wahc_vision_impaired_profile') !='undefined' && Cookies.get('wahc_vision_impaired_profile') && jQuery('body').hasClass('nagishx-wah-modern') ){


		if ( jQuery('html').addClass('wah_vision_impaired_profile')) {


			jQuery('.set-vision_impaired_profile').addClass('active_button');


			if( jQuery('.wah_enable_vision_impaired_profile input[type="checkbox"]').length ){


				jQuery('.wah_enable_vision_impaired_profile input[type="checkbox"]').prop('checked', true);


			}


		}


	}


}





function init_wah_inspector() {





    // Alpha : content selector


    jQuery('body').mousemove(function(e) {


        if (


            !jQuery(e.target).closest('.wah_content_selector_popup').length &&


            !jQuery(e.target).closest('#wp_nagish_express_container').length


        ) {


            jQuery(e.target).addClass('wah_content_selector_is_active');


        }


    });





    jQuery('body').mouseout(function(e) {


        jQuery(e.target).removeClass('wah_content_selector_is_active');


    });





    jQuery('body').on('click', function(e) {


        if (


            !jQuery(e.target).closest('.wah_content_selector_popup').length &&


            !jQuery(e.target).closest('#wp_nagish_express_container').length


        ) {


            e.preventDefault();


            jQuery('.wahout.aicon_link').fadeOut(200);


            var element = e.target;


            var content_html = jQuery(element).html();


            jQuery('body').append('<div class="wah_content_selector_popup" aria-live="polite"><button class="close_wah_content_selector_popup" type="button" title="Close window">[x]</button><div class="wah_content_selector_popup_inner"></div></div>');


            jQuery('.wah_content_selector_popup_inner').html(content_html);


            jQuery('.close_wah_content_selector_popup').focus();


        }


    });





    jQuery('body').on('click', '.close_wah_content_selector_popup', function(e) {


        e.preventDefault()


        jQuery('.wah_content_selector_popup').fadeOut(250).remove();


        jQuery('.wahout.aicon_link').fadeIn(200);


    });





}





function toggleCookiesClasses(classname) {





    if (!jQuery('body').hasClass(classname)) {


        jQuery('body').addClass(classname);


        Cookies.set('wahc_' + classname, 'on', {


            expires: wnexpress_cookies


        });


    } else {


        jQuery('body').removeClass(classname);


        Cookies.remove('wahc_' + classname);


    }





}





function setTextAlignmentCookie(current_class) {





    var alignment_classes = ['wne_text_alignment_left', 'wne_text_alignment_center', 'wne_text_alignment_right'];





    jQuery('body').removeClass('wne_text_alignment_left wne_text_alignment_center wne_text_alignment_right');


    Cookies.remove('wahc_wne_text_alignment_left');


    Cookies.remove('wahc_wne_text_alignment_center');


    Cookies.remove('wahc_wne_text_alignment_right');





	if( typeof current_class !='undefined' && current_class ){


		jQuery('body').addClass(current_class);


		Cookies.set('wahc_' + current_class, 'on', {


			expires: wnexpress_cookies


		});


	}





}





function setContrastCookie(bg_color, text_color) {





	console.log('bg_color: ', bg_color);


	console.log('text_color: ', text_color);





	if( typeof text_color !='undefined' && text_color ){


		Cookies.set('wahFontColor', text_color, {


			expires: wnexpress_cookies


		});


	}


	if( typeof bg_color !='undefined' && bg_color ){


	    Cookies.set('wahBgColor', bg_color, {


	        expires: wnexpress_cookies


	    });


	}


}


/*********************************


	REMOVE WAH Cookies


*********************************/


function removeAllCookies() {


    Cookies.remove('wahFontColor');


    Cookies.remove('wahBgColor');


    Cookies.remove('wahc_wah_highlight_titles');


    Cookies.remove('wahc_arial_font_on');


    Cookies.remove('wahc_wah_keyboard_access');


    Cookies.remove('wahc_highlight_links_on');


    Cookies.remove('wahc_remove_animations');


    Cookies.remove('wahc_invert_mode_on');


    Cookies.remove('wahc_is_underline');


    Cookies.remove('wahc_active_greyscale');


	Cookies.remove('wahc_active_hide_images');


    Cookies.remove('wnexpress_resize_clicks');


    Cookies.remove('wahc_wah_custom_color');


    Cookies.remove('wahc_wah-image-desc-on');


    Cookies.remove('wahc_wah-enable-sepia-filter');


    Cookies.remove('wahc_wah-enable-monochrome-filter');


    Cookies.remove('wahc_wah_inspector_mode');


    Cookies.remove('wahc_wah_large_white_cursor');


    Cookies.remove('user_wahstyle');


    Cookies.remove('wahc_wne_letter_spacing');


    Cookies.remove('wahc_wne_adhd_profile');


	Cookies.remove('wahc_wah_cd_profile');


    Cookies.remove('wahc_wne_text_alignment_left');


    Cookies.remove('wahc_wne_text_alignment_center');


    Cookies.remove('wahc_wne_text_alignment_right');


    Cookies.remove('wahc_wah-mute-on');


	Cookies.remove('wahc_convar_on');


	Cookies.remove('wahc_nagishx-custom-title-colors-on');


	Cookies.remove('wahc_tci-1');


	Cookies.remove('wahc_tci-2');


	Cookies.remove('wahc_tci-3');


	Cookies.remove('wahc_tci-4');


	Cookies.remove('wahc_tci-5');


	Cookies.remove('wahc_tci-6');


	Cookies.remove('wahc_tci-7');


	Cookies.remove('wahc_tci-8');


	Cookies.remove('wahc_tci-9');


	Cookies.remove('wahc_tci-10');





	Cookies.remove('wahc_nagishx-custom-text-colors-on');


	Cookies.remove('wahc_txtci-1');


	Cookies.remove('wahc_txtci-2');


	Cookies.remove('wahc_txtci-3');


	Cookies.remove('wahc_txtci-4');


	Cookies.remove('wahc_txtci-5');


	Cookies.remove('wahc_txtci-6');


	Cookies.remove('wahc_txtci-7');


	Cookies.remove('wahc_txtci-8');


	Cookies.remove('wahc_txtci-9');


	Cookies.remove('wahc_txtci-10');





	Cookies.remove('wahc_nagishx-custom-link-colors-on');


	Cookies.remove('wahc_linkci-1');


	Cookies.remove('wahc_linkci-2');


	Cookies.remove('wahc_linkci-3');


	Cookies.remove('wahc_linkci-4');


	Cookies.remove('wahc_linkci-5');


	Cookies.remove('wahc_linkci-6');


	Cookies.remove('wahc_linkci-7');


	Cookies.remove('wahc_linkci-8');


	Cookies.remove('wahc_linkci-9');


	Cookies.remove('wahc_linkci-10');





	Cookies.remove('wah_user_color_sheme');


	Cookies.remove('wahc_vision_impaired_profile');





    location.reload();


}





function wne_font_resizer() {


    //Font++


    jQuery(".font_resizer .larger, .wp-block-nagishx-font-resize .larger").click(function(e) {


        e.preventDefault();


        resizable_elements.each(function() {


            if (!jQuery(this).hasClass('sr screen-reader')) {


                var el_font_size = parseInt(jQuery(this).css('font-size'));


                jQuery(this).css('font-size', parseInt(el_font_size + 1) + 'px');


            }


        });


        wnexpress_resize_clicks++;


        wnexpress_set_resize_clicks(wnexpress_resize_clicks);


    });


    //Font--


    jQuery(".font_resizer .smaller, .wp-block-nagishx-font-resize .smaller").click(function(e) {


        e.preventDefault();


        resizable_elements.each(function() {


            var el_font_size = parseInt(jQuery(this).css('font-size'));


            if (el_font_size > 12) {


                jQuery(this).css('font-size', parseInt(el_font_size - 1) + 'px');


            }


        });


        wnexpress_resize_clicks--;


        wnexpress_set_resize_clicks(wnexpress_resize_clicks);


    });


    //Font reset


    jQuery(".wne-font-reset").click(function(e) {


        e.preventDefault();


        resizable_elements.each(function() {


            var el_font_size = parseInt(jQuery(this).css('font-size'));


            jQuery(this).css('font-size', parseInt(jQuery(this).data("wahfont")) + 'px');


        });


		// reset active button state fof + and - fonts buttons


		if( jQuery('.font-size-settings-inner').length ){


			jQuery('.font-size-settings-inner .separate_small_font_size .wne-action-button').removeClass('active_button');


			jQuery('.font-size-settings-inner .separate_large_font_size .wne-action-button').removeClass('active_button');


		}


        wnexpress_resize_clicks = 0;


        wnexpress_set_resize_clicks(0);


    });





}





/**************************


    PRO


**************************/


function wnexpress_set_resize_clicks(clicks_number) {


    Cookies.set('wnexpress_resize_clicks', clicks_number, {


        expires: wnexpress_cookies


    });


}





function wnexpress_get_resize_clicks() {


    var clicks = Cookies.get('wnexpress_resize_clicks') ? Cookies.get('wnexpress_resize_clicks') : 0;


    return parseInt(clicks);


}





function wnexpress_load_font_size_from_cookies() {


    var clicks_number = wnexpress_get_resize_clicks();


    resizable_elements.each(function() {


        if (!jQuery(this).hasClass('sr screen-reader')) {


            var el_font_size = parseInt(jQuery(this).css('font-size'));


            if (el_font_size) {


                jQuery(this).css('font-size', (el_font_size + clicks_number) + 'px');


            }


        }


    });


}





// POPUP


(function($) {





    var lastFocus;





    jQuery(".wah-popup-trigger").click(function(e) {


        e.preventDefault();


        var dialog_id = jQuery(this).attr("data-dialogid");


        lastFocus = document.activeElement;


        wahOpenDialog(dialog_id);


    });





    jQuery(".wah-close-dialog").click(function(e) {


        e.preventDefault();


        wahCloseDialog();


    });





    jQuery(document).keyup(function(e) {


        if (jQuery(".wah-dialog-popup.openDialog").length) {


            if (e.keyCode == 27) { // escape key maps to keycode `27`


                wahCloseDialog();


            }


        }


    });





    function wahOpenDialog(dialog_id) {


        var this_dialog = jQuery('.wah-dialog-popup[data-dialogid=' + dialog_id + ']');





        jQuery(".wah-dialog-popup").removeClass('openDialog').attr('aria-hidden', true);





        this_dialog.addClass('openDialog').attr('aria-hidden', false);


        setTimeout( function(){


			this_dialog.find('.wah-close-dialog').focus();


			if( this_dialog.find('#wah-report-problem-form').length ){


				this_dialog.find('.wah-report-form-row button[type="submit"]').on('blur', function(e){


					e.preventDefault();


					this_dialog.find('.wah-close-dialog').focus();


				});


			}


			this_dialog.find('.wah-close-dialog').focus();


		}, 200 );


    }





    function wahCloseDialog() {


        jQuery(".wah-dialog-popup").removeClass('openDialog').attr('aria-hidden', true);


        lastFocus.focus();


    }





}(jQuery));





// MINIBAR


function wah_accessibility_minibar() {





    jQuery(document).on('click', '.wah-access-bar-buttons button', function(event) {


        event.preventDefault();


        var button = jQuery(this);


        var button_name = button.attr('name');


        button.toggleClass('is-active-button');


        switch (button_name) {


            case 'wah-contrast-toggle':


                jQuery('html').toggleClass('wah-minibar-contrast');


                break;


            case 'wah-invert-toggle':


                jQuery('html').toggleClass('wah-minibar-greyscale');


                break;


            default: //wah-fontsize-toggle


                jQuery('html').toggleClass('wah-minibar-fontsize');


        }


    });





}





// ACCORDION


function wah_accordion() {


    jQuery(document).on('click', '.wah-accordion-item a', function(event) {


        event.preventDefault();


        if (!jQuery(this).parents('.wah-accordion-container').hasClass('is-animated')) {


            jQuery('.wah-accordion-item').removeClass('is-active');


            jQuery(this).parent().addClass('is-active');


        } else {


            if (!jQuery(this).parent().hasClass('is-active')) {


                jQuery('.wah-accordion-content').slideUp(100);


                jQuery(this).parent().find('.wah-accordion-content').slideDown(200);


                jQuery('.wah-accordion-item').removeClass('is-active');


                jQuery(this).parent().addClass('is-active');


            } else {


                jQuery(this).parent().find('.wah-accordion-content').slideUp(200);


                jQuery(this).parent().removeClass('is-active');


            }


        }





    });


}





// open sidebar


function wah_open_sidebar() {


    if (!jQuery('body').hasClass('nagishx-magic-sidebar')) {


        jQuery(".accessability_container").addClass("active");


        jQuery("#access_container button, #access_container a, #access_container .wne-action-button").attr("tabindex", "0");


        jQuery("#access_container").attr("aria-hidden", "false");


    } else {


        if (!jQuery('.aicon_link').hasClass('magic-buttons-is-active')) {


            wnexpress_show_magic_buttons();


        } else {


            wnexpress_hide_magic_buttons();


        }


    }


}


// close sidebar


function wah_close_sidebar() {


    if (!jQuery('body').hasClass('nagishx-magic-sidebar')) {


        jQuery(".accessability_container").removeClass("active");


        jQuery("#access_container button, #access_container a, #access_container .wne-action-button").attr("tabindex", "-1");


        jQuery("#access_container").attr("aria-hidden", "true");


    }


}


// show magic buttons


function wnexpress_show_magic_buttons() {





    var animation_speed = 40;





    jQuery("#access_container button").removeAttr("tabindex");





    jQuery('.a_module.wah_magic_skip_links').css('opacity', 0);





    jQuery('.a_module').each(function() {





        jQuery(this).animate({


            top: wnexpress_magic_buttons_top


        }, animation_speed, function() {


            jQuery(this).css('visibility', 'visible');


            jQuery(this).css('width', '240px');


            jQuery(this).css('opacity', 1);


        });





        var button_height = jQuery(this).height();





        wnexpress_magic_buttons_top = wnexpress_magic_buttons_top + button_height + 1;


        animation_speed = animation_speed + 20;


    });





    jQuery('.aicon_link').addClass('magic-buttons-is-active');





}


// hide magic buttons


function wnexpress_hide_magic_buttons() {





    var animation_speed = 40;





    jQuery('.a_module').each(function() {





        var button_height = jQuery(this).height();





        jQuery(this).animate({


            top: 50


        }, animation_speed, function() {


            jQuery(this).css('visibility', 'hidden');


            jQuery(this).css('width', '200px');


            jQuery(this).css('opacity', 0);


        });





        animation_speed = animation_speed + 10;





    });





    wnexpress_magic_buttons_top = jQuery('body').hasClass('admin-bar') ? 80 : 60;





    jQuery('.aicon_link').removeClass('magic-buttons-is-active');





}





function set_wah_layout() {





    if (jQuery('.set-wah-layout').length && jQuery('.wah_set_layout_popup').length) {





        jQuery('.set-wah-layout-popup').click(function(e) {


            jQuery('.wah_set_layout_popup').addClass('active');


            setTimeout(function() {


                jQuery('.close-wah_set_layout_popup').focus();


            }, 100);


        });





        jQuery('.set-wah-layout').click(function(e) {


            e.preventDefault();


            var new_wahstyle = jQuery(this).attr('data-new-wahstyle');


            Cookies.set('user_wahstyle', new_wahstyle, {


                expires: wnexpress_cookies


            });


            location.reload();


        });





        jQuery('.close-wah_set_layout_popup').on('click', function(e) {


            e.preventDefault();


            jQuery('.wah_set_layout_popup').removeClass('active');


        });


    }





}





function wah_mute_volume(state) {


    Array.prototype.slice.call(document.querySelectorAll('audio,video')).forEach(function(audio) {


        audio.muted = state;


    });





    // Youtube iFrame mute


    var youTubeIframes = jQuery('iframe[src^="https://www.youtube.com/embed/"]');


    youTubeIframes.each(function() {


        var src = jQuery(this).attr('src');


        if (state) {


            src = src + '&mute=1';


        } else {


            src = src + '&mute=0';


        }


        jQuery(this).attr('src', src);


    });





    // Vimeo iFrame mute


    var vimeoIframes = jQuery('iframe[src^="https://player.vimeo.com/"]');


    vimeoIframes.each(function() {


        var src = jQuery(this).attr('src');


        if (state) {


            src = src + '&background=1';


        } else {


            src = src + '&background=0';


        }


        jQuery(this).attr('src', src);


    });





}


/***************************************


	WAH Enable Vision Impaired Profile


***************************************/


function wah_enable_vision_impaired_profile(){


	if (!jQuery('html').hasClass('wah_vision_impaired_profile')) {


		jQuery('html').addClass('wah_vision_impaired_profile');


		Cookies.set('wahc_vision_impaired_profile', 'on', {


			expires: wnexpress_cookies


		});


	} else {


		jQuery('html').removeClass('wah_vision_impaired_profile');


		Cookies.remove('wahc_vision_impaired_profile');


	}


}


/************************************


	WAH Enable CD Profile


************************************/


function wne_enable_cd_profile(){


	if (!jQuery('body').hasClass('wah_cd_profile')) {


		jQuery('body').addClass('wah_cd_profile');


		// Font size +1


		jQuery('.wne-action-button.larger').click();


		Cookies.set('wahc_wah_cd_profile', 'on', {


			expires: wnexpress_cookies


		});


	} else {


		jQuery('body').removeClass('wah_cd_profile');


		Cookies.remove('wahc_wah_cd_profile');


		jQuery('.wne-action-button.smaller').click();


	}


	// reset active button state fof + and - fonts buttons


	if( jQuery('.font-size-settings-inner').length ){


		jQuery('.font-size-settings-inner .separate_small_font_size .wne-action-button').removeClass('active_button');


		jQuery('.font-size-settings-inner .separate_large_font_size .wne-action-button').removeClass('active_button');


	}


}


/***************************************


	Setup default text styles


***************************************/


function wnexpress_setup_default_txt_styles(){


	jQuery.each( wnexpress_txt_elements, function(key, item){


		jQuery(item).each( function(){


			var item_style = jQuery(this).attr('style');


			if( ! jQuery(this).hasClass('wahout') ){


				if( 'undefined' != typeof item_style ){


					jQuery(this).attr('data-nagishx-txt-style', item_style );


				} else {


					jQuery(this).attr('data-nagishx-txt-style', '' );


				}


			}


		});


	});


}


/***************************************


	Setup default link styles


***************************************/


function wnexpress_setup_default_link_styles(){


	jQuery.each( wnexpress_link_elements, function(key, item){


		jQuery(item).each( function(){


			var item_style = jQuery(this).attr('style');


			if( ! jQuery(this).hasClass('wahout') ){


				if( 'undefined' != typeof item_style ){


					jQuery(this).attr('data-nagishx-txt-style', item_style );


				} else {


					jQuery(this).attr('data-nagishx-txt-style', '' );


				}


			}


		});


	});


}


/***************************************


	Setup default contrast bg elements


***************************************/


function wnexpress_setup_default_contrast_styles(){


	if( jQuery('body').hasClass('nagishx-modern') ){


		wnexpress_contrast_elements.each( function(){


			if( ! jQuery(this).hasClass('wahout') ){


				var current_item_style = jQuery(this).attr('style');


				if( typeof current_item_style != 'undefined' ){


					jQuery(this).attr('data-nagishx-contrast-style', current_item_style );


				} else {


					jQuery(this).attr('data-nagishx-contrast-style', '' );


				}


			}


		});


	}


}


/***************************************


	Load custom text colors


***************************************/


function wnexpress_load_custom_text_colors(){


	if( jQuery('body').hasClass('nagishx-custom-text-colors-on') && jQuery('body').hasClass('nagishx-wah-modern') ){


		if( typeof Cookies.get('wahc_nagishx-custom-text-colors-on') !='undefined' && Cookies.get('wahc_nagishx-custom-text-colors-on') == 'on' ){


			var wnexpress_selected_text_color = '';


			if( typeof Cookies.get('wahc_txtci-1') !='undefined' && Cookies.get('wahc_txtci-1') == 'on' ){


				jQuery('.text_color_selector button#txtci-1').addClass('is-active');


				wnexpress_selected_text_color = jQuery('.text_color_selector button#txtci-1').attr('data-color');


			}


			if( typeof Cookies.get('wahc_txtci-2') !='undefined' && Cookies.get('wahc_txtci-2') == 'on' ){


				jQuery('.text_color_selector button#txtci-2').addClass('is-active');


				wnexpress_selected_text_color = jQuery('.text_color_selector button#txtci-2').attr('data-color');


			}


			if( typeof Cookies.get('wahc_txtci-3') !='undefined' && Cookies.get('wahc_txtci-3') == 'on' ){


				jQuery('.text_color_selector button#txtci-3').addClass('is-active');


				wnexpress_selected_text_color = jQuery('.text_color_selector button#txtci-3').attr('data-color');


			}


			if( typeof Cookies.get('wahc_txtci-4') !='undefined' && Cookies.get('wahc_txtci-4') == 'on' ){


				jQuery('.text_color_selector button#txtci-4').addClass('is-active');


				wnexpress_selected_text_color = jQuery('.text_color_selector button#txtci-4').attr('data-color');


			}


			if( typeof Cookies.get('wahc_txtci-5') !='undefined' && Cookies.get('wahc_txtci-5') == 'on' ){


				jQuery('.text_color_selector button#txtci-5').addClass('is-active');


				wnexpress_selected_text_color = jQuery('.text_color_selector button#txtci-5').attr('data-color');


			}


			if( typeof Cookies.get('wahc_txtci-6') !='undefined' && Cookies.get('wahc_txtci-6') == 'on' ){


				jQuery('.text_color_selector button#txtci-6').addClass('is-active');


				wnexpress_selected_text_color = jQuery('.text_color_selector button#txtci-6').attr('data-color');


			}


			if( typeof Cookies.get('wahc_txtci-7') !='undefined' && Cookies.get('wahc_txtci-7') == 'on' ){


				jQuery('.text_color_selector button#txtci-7').addClass('is-active');


				wnexpress_selected_text_color = jQuery('.text_color_selector button#txtci-7').attr('data-color');


			}


			if( typeof Cookies.get('wahc_txtci-8') !='undefined' && Cookies.get('wahc_txtci-8') == 'on' ){


				jQuery('.text_color_selector button#txtci-8').addClass('is-active');


				wnexpress_selected_text_color = jQuery('.text_color_selector button#txtci-8').attr('data-color');


			}


			if( typeof Cookies.get('wahc_txtci-9') !='undefined' && Cookies.get('wahc_txtci-8') == 'on' ){


				jQuery('.text_color_selector button#txtci-8').addClass('is-active');


				wnexpress_selected_text_color = jQuery('.text_color_selector button#txtci-8').attr('data-color');


			}


			if( typeof Cookies.get('wahc_txtci-10') !='undefined' && Cookies.get('wahc_txtci-10') == 'on' ){


				jQuery('.text_color_selector button#txtci-10').addClass('is-active');


				wnexpress_selected_text_color = jQuery('.text_color_selector button#txtci-10').attr('data-color');


			}


			jQuery.each( wnexpress_txt_elements, function(key, item){


				jQuery(item).each( function(){


					var item_style = jQuery(this).attr('style');


					if( ! jQuery(this).hasClass('wahout') ){


						if( 'undefined' != typeof item_style ){


							var def_txt_style = jQuery(this).attr('data-nagishx-txt-style');


							item_style =  def_txt_style + ' color: '+ wnexpress_selected_text_color + ' !important;';


							jQuery(item).attr('style', item_style );


						} else {


							item_style = 'color: '+ wnexpress_selected_text_color + ' !important;';


							jQuery(this).attr('style', item_style );


						}


					}


				});


			});


		}


	}


}





/***************************************


	Load custom link colors


***************************************/


function wnexpress_load_custom_link_colors(){


	if( jQuery('body').hasClass('nagishx-custom-link-colors-on') && jQuery('body').hasClass('nagishx-wah-modern') ){


		if( typeof Cookies.get('wahc_nagishx-custom-link-colors-on') !='undefined' && Cookies.get('wahc_nagishx-custom-link-colors-on') == 'on' ){


			var wnexpress_selected_link_color = '';


			if( typeof Cookies.get('wahc_linkci-1') !='undefined' && Cookies.get('wahc_linkci-1') == 'on' ){


				jQuery('.link_color_selector button#linkci-1').addClass('is-active');


				wnexpress_selected_link_color = jQuery('.link_color_selector button#linkci-1').attr('data-color');


			}


			if( typeof Cookies.get('wahc_linkci-2') !='undefined' && Cookies.get('wahc_linkci-2') == 'on' ){


				jQuery('.link_color_selector button#linkci-2').addClass('is-active');


				wnexpress_selected_link_color = jQuery('.link_color_selector button#linkci-2').attr('data-color');


			}


			if( typeof Cookies.get('wahc_linkci-3') !='undefined' && Cookies.get('wahc_linkci-3') == 'on' ){


				jQuery('.link_color_selector button#linkci-3').addClass('is-active');


				wnexpress_selected_link_color = jQuery('.link_color_selector button#linkci-3').attr('data-color');


			}


			if( typeof Cookies.get('wahc_linkci-4') !='undefined' && Cookies.get('wahc_linkci-4') == 'on' ){


				jQuery('.link_color_selector button#linkci-4').addClass('is-active');


				wnexpress_selected_link_color = jQuery('.link_color_selector button#linkci-4').attr('data-color');


			}


			if( typeof Cookies.get('wahc_linkci-5') !='undefined' && Cookies.get('wahc_linkci-5') == 'on' ){


				jQuery('.link_color_selector button#linkci-5').addClass('is-active');


				wnexpress_selected_link_color = jQuery('.link_color_selector button#linkci-5').attr('data-color');


			}


			if( typeof Cookies.get('wahc_linkci-6') !='undefined' && Cookies.get('wahc_linkci-6') == 'on' ){


				jQuery('.link_color_selector button#linkci-6').addClass('is-active');


				wnexpress_selected_link_color = jQuery('.link_color_selector button#linkci-6').attr('data-color');


			}


			if( typeof Cookies.get('wahc_linkci-7') !='undefined' && Cookies.get('wahc_linkci-7') == 'on' ){


				jQuery('.link_color_selector button#linkci-7').addClass('is-active');


				wnexpress_selected_link_color = jQuery('.link_color_selector button#linkci-7').attr('data-color');


			}


			if( typeof Cookies.get('wahc_linkci-8') !='undefined' && Cookies.get('wahc_linkci-8') == 'on' ){


				jQuery('.link_color_selector button#linkci-8').addClass('is-active');


				wnexpress_selected_link_color = jQuery('.link_color_selector button#linkci-8').attr('data-color');


			}


			if( typeof Cookies.get('wahc_linkci-9') !='undefined' && Cookies.get('wahc_linkci-8') == 'on' ){


				jQuery('.link_color_selector button#linkci-8').addClass('is-active');


				wnexpress_selected_link_color = jQuery('.link_color_selector button#linkci-8').attr('data-color');


			}


			if( typeof Cookies.get('wahc_linkci-10') !='undefined' && Cookies.get('wahc_linkci-10') == 'on' ){


				jQuery('.link_color_selector button#linkci-10').addClass('is-active');


				wnexpress_selected_link_color = jQuery('.link_color_selector button#linkci-10').attr('data-color');


			}


			jQuery.each( wnexpress_link_elements, function(key, item){


				jQuery(item).each( function(){


					var item_style = jQuery(this).attr('style');


					if( ! jQuery(this).hasClass('wahout') ){


						if( 'undefined' != typeof item_style ){


							var def_txt_style = jQuery(this).attr('data-nagishx-txt-style');


							item_style =  def_txt_style + ' color: '+ wnexpress_selected_link_color + ' !important;';


							jQuery(item).attr('style', item_style );


						} else {


							item_style = 'color: '+ wnexpress_selected_text_color + ' !important;';


							jQuery(this).attr('style', item_style );


						}


					}


				});


			});


		}


	}


}





function wnexpress_render_toc() {





	jQuery('.wne-call-toc').prop('disabled', true);





	var ToC =


	"<nav role='navigation' class='table-of-contents'>" +


	"" +


	"<ul data-nagishx-list='toc-list'>";





	var newLine, el, title, link;


	var index = 0;


	var header_id = '';


	var header_level = '';





	jQuery("body h1, body h2, body h3, body h4").each(function() {


		el    = jQuery(this);


		if( el.is(':visible') ){


			title = el.text();


			index++;


			if( typeof el.attr('id') == 'undefined' ){


				header_id = 'wah-header-index-'+index;


			} else {


				header_id = el.attr('id');


			}


			el.attr('id', header_id);


			link = "#" + header_id;





			if( el.is("h1") ){


				header_level = 'h1';


			} else if( el.is("h2") ){


				header_level = 'h2';


			} else if ( el.is("h3") ) {


				header_level = 'h3';


			} else if ( el.is("h4") ) {


				header_level = 'h4';


			}





			newLine =


			"<li data-level='"+header_level+"'>" +


				"<a href='" + link + "' data-header-level='" + header_level + "' class='nagishx-header-level-" + header_level + "' title='"+title+"'>" + title + "</a>" +


			"</li>";





			ToC += newLine;


		}


	});





	if ( ! jQuery('#nagishx-toc-list .table-of-contents').length ){


		jQuery(ToC).appendTo('#nagishx-toc-list');


	}





	jQuery('.nagishx-toc-popup').attr('aria-hidden', 'false').attr('tabindex', '0').addClass('active');


	setTimeout( function(){


		jQuery('#nagishx-close-toc-popup').focus();


		jQuery('#nagishx-toc-list nav ul li:last-child a').on('blur', function(){


			jQuery('#nagishx-close-toc-popup').focus();


		});


		// Close TOC popup


		jQuery('#nagishx-close-toc-popup').on('click', function(){


			jQuery('.nagishx-toc-popup').removeClass('active');


			jQuery('.nagishx-toc-popup').attr('aria-hidden', 'true').attr('tabindex', '-1');


			jQuery('#nagishx-toc-list').html('');


			jQuery('.wne-call-toc').prop('disabled', false);


		});


	}, 200);





	// Highlight selected header from TOC


	jQuery('#nagishx-toc-list nav ul li a').on('click', function(){


		var link_el = jQuery(this);


		jQuery(link_el.attr('href')).addClass('wah-anchor-highlight');


		setTimeout( function(){


			jQuery(link_el.attr('href')).removeClass('wah-anchor-highlight');


		}, 4000);


	});


}





function wnexpress_switch_i18n(lang){





	if( wnexpress_i18n[lang].direction === 'rtl' ){


		jQuery('body').addClass('wnexpress_i18n-rtl');


	} else {


		jQuery('body').removeClass('wnexpress_i18n-rtl');


	}





	jQuery.each( wnexpress_i18n[lang], function(index, property){


		// update button text


		jQuery(property.selector).find('.wne-button-title').text(property.title);


		// update title and aria-label attrs


		if( typeof property.aria_label !='undefined' ) {


			jQuery(property.selector).attr('aria-label', property.aria_label );


			jQuery(property.selector).attr('title', property.aria_label );


		} else {


			jQuery(property.selector).attr('aria-label', property.title );


			jQuery(property.selector).attr('title', property.title );


		}


		// update descriptions


		if( typeof property.selector_description !='undefined' && jQuery(property.selector_description).length ){


			jQuery(property.selector_description).text(property.description);


		}


	});


}





function wnexpress_close_sidebar_overlay(){


	jQuery('.nagishx-sidebar-overlay').removeClass('active');


}


function wnexpress_open_sidebar_overlay(){


	jQuery('.nagishx-sidebar-overlay').addClass('active');


}


function wnexpress_set_current_language(lang_code, lang_name){


	jQuery('.current-nagishx-language .wne-flag-icon img').attr('src', wnexpress_settings.wah_flag_icon_url + lang_code + '.png');


	jQuery('.current-nagishx-language .wne-flag-name').text(lang_name);


	Cookies.set('wnexpress_current_lang_code', lang_code, {


		expires: 30


	});


	Cookies.set('wnexpress_current_lang_name', lang_name, {


		expires: 30


	});


}


function wnexpress_init_accessibility_statement(){


	jQuery('#nagishx-accessibility-statement').on('click', function(e) {


		e.preventDefault();


		jQuery(this).attr('aria-expanded', 'true');


		jQuery('.nagishx-accessibility-statement-popup').addClass('active').attr('aria-hidden', 'false').attr('tabindex', '0');


		jQuery('#nagishx-close-statement-popup').focus();


		jQuery('.wne-nicescroll-box .nagishx-accessibility-statement-content').niceScroll({


			cursorcolor: "#18a1b7",


			cursorwidth: "5px",


			cursorborderradius: "5px"


		});


	});


	jQuery('#nagishx-close-statement-popup').on('click', function(e) {


		e.preventDefault();


		jQuery('.nagishx-accessibility-statement-popup').removeClass('active').attr('aria-hidden', 'true').attr('tabindex', '1');


		jQuery('#nagishx-accessibility-statement').attr('aria-expanded', 'false');


		setTimeout( function(){


			jQuery('#nagishx-accessibility-statement').focus();


		}, 300);


	});


	// Loop back to close button


	jQuery('.nagishx-accessibility-statement-popup .nagishx-accessibility-statement-outhandler').on('blur', function(){


		jQuery('#nagishx-close-statement-popup').focus();


	});


}


function refresh_wnexpress_nicescroll(){


	jQuery('.access_container_inner').getNiceScroll().resize();


}


