/* hide land rover event special items from search and related products */
//window.setInterval(function(){ jQuery('.product-name a:contains("rover")').closest('.item.product').remove(); }, 800);
/*
100%
BEFORE TURNING ON
- test all pages
*/
jQuery('.top-menu .cart-inner').attr("aria-hidden",true);
// handle windows narrator intercepting enter key and spacebar
function HandleWindowsNarrator(){
//jQuery('[role="alert"]').removeAttr("role");
//jQuery('#product-variants .header+div').html(jQuery('#product-variants .header+div').html().replace(/div/g,'a'));
// jQuery('#product-variants .header+div a').each(function(){
// jQuery(this).attr('href','javascript:SelectOptionLink("'+jQuery(this).attr("data-value")+'");');
// });
jQuery('#product-variants [data-value]').each(function(){
jQuery(this).wrap("");
//jQuery(this).attr('onclick',"SelectOptionLink('"+jQuery(this).attr("data-value")+"');");
// jQuery(this).on('click',function(){
// SelectOptionLink(jQuery(this).attr("data-value"));
// });
});
// jQuery('#product-form [data-value]').on("click",function(e){
// e.stopPropagation();
// });
}
function SelectOptionLink(str){
// jQuery('#product-form [data-value="'+str+'"]').closest('a').attr("x-href",jQuery('#product-form [data-value="'+str+'"]').closest('a').attr("href"));
// jQuery('#product-form [data-value="'+str+'"]').closest('a').removeAttr("href");
// window.setTimeout(function(){
jQuery('#product-form [data-value="'+str+'"] input').click();
// var str = 120;
//jQuery('#product-form [data-value="'+str+'"] input').prop("ckecked",true);
//jQuery('#product-form [data-value="'+str+'"] input').trigger("changed");
// },100);
window.setTimeout(function(){
LabelCountsAcs();
// jQuery('#product-form [data-value="'+str+'"]').closest('a').attr("href",jQuery('#product-form [data-value="'+str+'"]').closest('a').attr("x-href"));
},100);
//jQuery('#product-form [data-value="'+str+'"]').closest('a').removeAttr("x-href");
console.log("Selecting option: "+str);
}
jQuery('.item.product:contains("demo)")').remove();
/* jb20200921a - added speak function for screen readers */
function Speak(text){ console.log("acs speak "+text); jQuery("#speakerbox").text(" "); window.setTimeout(function(){ jQuery("#speakerbox").text(text); }, 100); }
AddSpeakers();
function AddSpeakers(){
if (!jQuery("#speakerbox").length){ console.log("acs created speaker box"); jQuery("body").append('
'); }
jQuery(".owl-prev,.nivo-prevNav").not("[speak]").attr("speak","previous").on("click",function(){ Speak("Scroll left"); });
jQuery(".owl-next,.nivo-nextNav").not("[speak]").attr("speak","next").on("click",function(){ Speak("Scroll right"); });
window.setTimeout(function(){ AddSpeakers(); }, 1000);
}
function nmxSiteAccessibility(c, i){
//console.log("acs fixing "+c);
// hide false positives
if (navigator.userAgent.toLowerCase().indexOf("pope") > -1 || jQuery("#wave5topbar").length || jQuery("#wave_sidebar_container").length || top.location.href != self.location.href){
jQuery("noscript, a[href*='pdf']").remove();
// jQuery("a,form,img,button,:header").remove();
// jQuery("body").prepend("not checked
");
// document.title = "(not checked)";
}
jQuery('[name="contact[first-name]"]').attr("id","ContactFormFName");
jQuery('[name="contact[last-name]"]').attr("id","ContactFormLName");
jQuery('.category-products .addtocart .btn-cart').remove();
jQuery('.products-grid .owl-buttons').remove();
jQuery('.logo-footer img').unwrap();
jQuery('.success-stories-bottom-btn h3').remove();
jQuery(".swatch.size").wrap('');
// jQuery(".swatch.size").each(function(index){
// if (!jQuery(this).find("fieldset").length){
// jQuery(this).prepend('');
// jQuery(this).find("*:not([fieldset])").appendTo("[fsid='"+index+"']");
// }
// });
jQuery("fieldset").each(function(){
if (!jQuery(this).find("legend").length){
jQuery(this).prepend('');
}
});
if (!jQuery("#guaranteed caption").length){
jQuery("#guaranteed").prepend('Ingredients');
}
/* fix broken same page links caused by hash links with event listeners */
jQuery('[href*="#"]').not('[href*="javascript"],[href*="maincontent"]').each(function(){
if (!jQuery('[name="'+jQuery(this).attr("href").replace("#","")+'"]').length){
var a = ''+jQuery(this).text()+'';
console.log("creating "+a);
jQuery("body").prepend(a);
}
});
jQuery("[id*='mce-']").each(function(){
jQuery(this).attr("id",jQuery(this).attr("id").replace("[","").replace("]",""));
});
jQuery("[for*='mce-']").each(function(){
jQuery(this).attr("for",jQuery(this).attr("for").replace("[","").replace("]",""));
});
//jQuery('.products-grid.vina-carousel .product-action a > img').unwrap();
jQuery('.product-action img+img').each(function(){
jQuery(this).attr("alt",jQuery(this).prev().attr("alt"));
});
//jQuery('[src*="_back_large"]').remove();
jQuery('.product-link [src*="noimage"]').parent().remove();
// jQuery('.product-name > a').removeAttr("href");
jQuery('label#fc-response').remove();
/* blog fieldset */
jQuery(".filter.animal h4.widget-title").replaceWith("");
jQuery(".filter.category h4.widget-title").replaceWith("");
jQuery(".blog__img > a > img").unwrap();
jQuery(".money span:contains('From')").remove();
jQuery(".quickview:hidden").remove();
jQuery(".filter__blog > .filter, .emailSignup__item.item8>p:first-of-type").each(function(){
if (!jQuery(this).parent("fieldset").length){
jQuery(this).wrap('');
}
});
jQuery(".product-prev, .product-next").remove();
jQuery(".vgsp-button-group").remove();
jQuery(".product-item .actions.vgsp-button-group2:hidden, .product-short-desc:hidden, .actions .action-list a span:hidden, .actions .action-list button span:hidden").remove();
jQuery(".section-block.banner-block.home-banner-top:hidden, .section-block.home-collection-products-2:hidden").remove();
jQuery('#footSource font[color="red"]').css("color","#DB0000");
jQuery('sup:contains("▼"), section>span:contains("▼")').css("color","#DB0000");
jQuery("#footer-disclaimer").prependTo("#footer-copyright");
/* fix device dependancies
jQuery('[onclick]').each(function(){
jQuery(this).attr("xonclick",jQuery(this).attr("onclick")).removeAttr("onclick").on("click",function(){ eval(jQuery(this).attr("xonclick")) });
});
*/
// Add Skip to content link
if(!jQuery('.skip-to-content-link').length){
jQuery( "body" ).prepend( 'Skip to content' );
//jQuery('.skip-to-content-link').attr("aria-label", "Skip to content. Click to skip to content.......................").attr("role","alert").attr("aria-live", "agressive");
jQuery('header') ? jQuery( "header" ).after( '' ) : jQuery("body").children().eq(2).attr("id", "maincontent");
}
//jQuery(".pg-dogs-cosequin-difference .page-tagline").next().find(".wistia_embed").unwrap();
//jQuery(".pg-dogs-cosequin-difference .page-tagline").next().find("span:first").html(jQuery(".pg-dogs-cosequin-difference .page-tagline").next().find("span:first").html().replace("...",""));
//.attr("role","presentation").attr("aria-hidden","true");
jQuery("[title]").each(function(){
if (jQuery(this).text() == jQuery(this).attr("title") || jQuery(this).attr("alt") == jQuery(this).attr("title")){
jQuery(this).removeAttr("title");
}
});
/* remove elemnts from page if hidden */
// jQuery("p:empty").remove();
// jQuery("label.rating-label").remove();
// jQuery('label[for="register-submit"]').remove();
// jQuery(".circleicons-color1 embed").remove();
// jQuery("#right-sidebar:hidden").remove();
// jQuery(".price").remove();
// jQuery(".nmx-section:hidden").remove();
// jQuery(".woo-entry-inner.btn-wrap a:hidden").remove();
// jQuery("#menu-top-bar .menu-link:hidden").remove();
// jQuery(".woocommerce-Tabs-panel--reviews:hidden").remove();
// jQuery(".product-inner .category:hidden").remove();
// jQuery(".additional_information_tab:hidden").remove();
// jQuery(".reviews_tab:hidden").remove();
// if (navigator.userAgent.toLowerCase().indexOf("mobile") < 0){
// jQuery(".description_tab[onclick]").removeAttr("onclick").on("click",function(){ OpenMobileProductPageAccordion(this.id); JumpToTabAccordion(); });
// jQuery(".product-facts_tab[onclick]").removeAttr("onclick").on("click",function(){ OpenMobileProductPageAccordion(this.id); JumpToTabAccordion(); });
// jQuery(".directions-for-use_tab[onclick]").removeAttr("onclick").on("click",function(){ OpenMobileProductPageAccordion(this.id); JumpToTabAccordion(); });
// }
// jQuery(".story .continue-reading-links:hidden").remove();
// jQuery("a.elementor-icon .elementor-screen-only").each(function(){
// jQuery(this).closest("a").attr("aria-label",jQuery(this).text().trim());
// jQuery(this).remove();
// });
// jQuery("a[href*='pdf']").each(function(index){
// if (jQuery(this).attr("href").indexOf("javascript")==-1){
// jQuery(this).attr("href",'javascript:(function(){ var i='+index+'; document.location="'+jQuery(this).attr("href")+'"; })();').attr("aria-hidden","true").attr("role","presentation");
// }
// });
//jQuery('.mobile-searchform [placeholder="Search"]').attr("id","mobilesearch");
jQuery("input,select,textarea").not('[type="submit"],[type="radio"],[type="button"]').each(function(index){
if (!jQuery(this).filter("[id]").length){
jQuery(this).attr("id","fld"+index);
} else {
//console.log("acs id not set: i"+index+" class:"+jQuery(this).attr("class")+" id:"+jQuery(this).attr("id"));
}
if (jQuery(this).filter("[id]").length){
if (!jQuery("[for='"+jQuery(this).attr("id")+"']").length){
if (jQuery(this).parent().is("label") && !jQuery(this).parent().has("[for]")){
jQuery(this).parent().attr("for",jQuery(this).attr("id"));
} else {
jQuery(this).before('');
}
}
}
});
jQuery('[title*="htmlcaption"]').removeAttr("title");
/* this is ridiculous - noscript cannot be used */
jQuery("noscript").remove();
/* empty headers */
jQuery(":header, a").each(function(index){
if (!jQuery(this).find("*").length && jQuery(this).text().trim() == ""){
jQuery(this).remove();
} else if (jQuery(this).text().trim() == ""){
//jQuery(this).append('i'+index+'');
}
});
/* alt tags */
jQuery("img:not([alt])").filter("[src]").each(function(index){
var alt="";
jQuery(this).attr("alt", alt);
console.log("acs no alt - "+jQuery(this).attr("src"));
if (jQuery(this).attr("title") != ""){
alt = jQuery(this).attr("title");
} else {
alt = jQuery(this).attr("src").replace(".png","").replace(".svg","").replace(".jpg","").replace(".gif","").replace(/[-_]/g," ").replace(/^.*[\\\/]/, '');
}
alt = "img "+index;
console.log("acs set alt: "+alt);
jQuery(this).attr("alt", alt);
});
/* empty buttons and links */
jQuery("button").each(function(){
if (jQuery(this).text().trim() == ""){
jQuery(this).append('hidden element');
}
});
jQuery("footer a, a.top").each(function(){
if (jQuery(this).text().trim() == "" && !jQuery(this).find("img").length){
jQuery(this).remove();
}
});
/*
jQuery(':header').each(function(){
var level = jQuery(this).prop("tagName").replace("H","");
if (level > 1 && jQuery(this).parents().find("H"+(level-1))){
if (!jQuery(this).prev("h"+(level-1)).length){
//console.log("acs found heading: "+jQuery(this).prop("tagName"));
jQuery(this).before('>');
//return;
}
}
});
*/
jQuery("[aria-labelledby]").each(function(){
if (!jQuery("#"+jQuery(this).attr("aria-labelledby")+"").length){
jQuery(this).removeAttr("aria-labelledby").attr("aria-hidden","true");
}
});
jQuery(".woocommerce-Tabs-panel span[style*='10px']").removeAttr("style").css("font-size","11px");
jQuery("img[alt]").not("[acs]").each(function(index){
var that = jQuery(this);
var match = "diff";
if (jQuery("[alt='"+jQuery(this).attr("alt")+"']").length > 1 && jQuery(this).not("[acs]")){
//console.log("acs alt dup"+index+": "+jQuery(this).attr("alt")+" / "+jQuery("[alt='"+jQuery(this).attr("alt")+"']").length+" / "+match+" / "+that.filter(":visible").length);
jQuery("[alt='"+jQuery(this).attr("alt")+"']").not(":first").each(function(index){
jQuery(this).attr("alt","");
});
}
});
jQuery("a[href]").not("[acs]").each(function(index){
var that = jQuery(this);
var match = "diff";
if (jQuery("[href='"+jQuery(this).attr("href")+"']").length > 1 && jQuery(this).not("[acs]")){
//jQuery("[href='"+jQuery(this).attr("href")+"']").attr("acs",1).attr("aria-hidden","true").attr("role","presentation");
if (
jQuery(this).parent().prev() == that.parent()
|| jQuery(this).parent() == that.parent()
|| jQuery(this).parent() == that.parent().parent()
){ match = "same"; }
//console.log("acs pg dup"+index+": "+jQuery(this).attr("href")+" / "+match+" / "+that.filter(":visible").length);
}
});
jQuery('[data-original-title="Select Options"]').remove();
jQuery('a.thumb-link[href*="void"]').removeAttr("href");
jQuery("[alt]").each(function(index){
if (jQuery("[alt='"+jQuery(this).attr("alt")+"']").length > 1){
jQuery(this).attr("alt","");
}
});
/* remove orphaned labels */
jQuery("[for]").each(function(index){
if (!jQuery("#"+jQuery(this).attr("for")).length && jQuery(this).attr("for").trim() == jQuery(this).text().trim()){
console.log("acs orphaned label: "+jQuery(this).attr("for"));
jQuery(this).remove();
}
});
/* fix layout table false-pos */
jQuery('#guaranteed tbody').prepend('Contains |
');
//jQuery('#guaranteed tbody').before(''+jQuery('#guaranteed').prev("p").text()+'');
//jQuery('#guaranteed').prev("p").remove();
jQuery('label[for="Quantity"]').remove();
//jQuery(".mc-field-group.input-group").remove();
/* remove redundant titles */
jQuery("[alt][title]").each(function(){
if (jQuery(this).text() == jQuery(this).attr("title") || jQuery(this).attr("alt") == jQuery(this).attr("title")){
jQuery(this).removeAttr("title");
}
});
if (c > 0){
c--;
//console.log("acs "+c);
// window.setTimeout(function(){ nmxSiteAccessibility(c--, i); },i);
}
// jQuery('.detail-price.price-content').attr("aria-live","polite");//.attr("role","alert");
jQuery('.sf-share-fb').attr("aria-label", "Facebook");
jQuery('.sf-share-twit').attr("aria-label", "Twitter");
jQuery('.sf-share-pin').attr("aria-label", "Pinterest");
HandleWindowsNarrator();
//LabelCountsAcs();
jQuery(".product-qty *:not(input)").attr("tabindex", "-1").attr("aria-hidden","true");
jQuery(".box-popup a, .box-popup button").attr("tabindex", "0");
jQuery('.box-popup .box-close').appendTo('.box-popup .box-inner');
jQuery('.box-popup .box-close').attr("href",'javascript:jQuery("button.btn-button.close-box").click();jQuery(".btn-cart.add-to-cart").focus();');
jQuery('.box-popup .box-close').attr("tabindex","0").attr("aria-label", "Close added to cart popup.");
//jQuery('[role="alert"]').removeAttr("role").attr("aria-busy","true");
jQuery('.header-link-search').attr("aria-label", "Search our store").attr("href",'javascript:window.setTimeout(function(){ jQuery(\'.input-group.form-search input\').focus(); }, 100)');
jQuery('.fa-search').closest("button").attr("aria-label", "Search");
jQuery('.fa-close').closest("a").attr("aria-label", "Close search");
jQuery('a.product-image').attr("tabindex", "-1");
jQuery('sup').attr("aria-hidden", true);
jQuery('.short-description li').attr("tabindex", "0");
jQuery('#guaranteed tr, .product-table tr').attr("tabindex", "0");//.attr("role", "listitem");
jQuery('.box-popup a.box-close *').attr("aria-hidden","true").attr("tabindex","-1");
jQuery('img').attr("tabindex", "-1").attr("aria-hidden",true).attr("role", "presentation").removeAttr("alt");
//jQuery('form#product-form').on("submit",function(){
//console.log("SUBMIT!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
// window.setTimeout(function(){
// jQuery('.box-popup.animate-box.show button.btn-button.close-box').focus();
// }, 2000);
//});
}
function LabelCountsAcs(){
var option_count = jQuery('.swatch.size [data-value].available').length;
var option_text = "";
//var option_price = jQuery('.detail-price.price-content .price').text();
jQuery('.swatch.size [data-value].available').each(function(index){
//jQuery(this).find(".acs").remove();
if (jQuery(this).find("input").length && jQuery(this).find("input").prop("checked") == true){
option_text = jQuery(this).find("label").text()+" count. Option "+(index+1)+" of "+option_count+" (selected)";
if (jQuery(this).closest("a").attr("aria-label") != option_text){
jQuery(this).closest("a").attr("aria-label",option_text);
}
//jQuery(this).append(''+jQuery(this).find("label").text()+' count (selected)
');
} else {
option_text = jQuery(this).find("label").text()+" count. Option "+(index+1)+" of "+option_count+" (not selected)";
if (jQuery(this).closest("a").attr("aria-label") != option_text){
jQuery(this).closest("a").attr("aria-label",option_text);
}
//jQuery(this).append(''+jQuery(this).find("label").text()+' count (not selected)
');
//jQuery(this).find("div").on("click",function(){ alert(123); });
}
jQuery(this).attr("aria-hidden","true").find("label").attr("aria-hidden","true").attr("tabindex","-1");
//jQuery(this).attr("tabindex",index).attr("aria-label",""+jQuery(this).text()+" count");
//jQuery(this).find('label').wrap('');
//jQuery(this).find('label > div').unwrap();//.find("img").remove();
});
}
CartTopNavLabel();
function CartTopNavLabel(){
jQuery('input.quantity-selector').attr("aria-label", "Add to cart quantity input.")
//.attr("aria-hidden", "true").attr("role", "presentation").attr("tabindex","-1");//.attr("aria-label", "Quantity");
jQuery('.btn-cart.add-to-cart[role]').removeAttr("role");
jQuery('.detail-price.price-content .price').not("[aria-live]").attr("aria-live","polite");
jQuery('.product-img-box [tabindex="0"]').attr("aria-hidden", "true").attr("role", "presentation").attr("tabindex","-1");
jQuery('.icon-cart-header[aria-hidden]').removeAttr("aria-hidden");
jQuery('.icon-cart-header[role]').removeAttr("role");
var new_aria_label = "";
if (jQuery('.icon-cart-header > .cart-count').length){
if (jQuery('.icon-cart-header > .cart-count').text().replace("0","").trim() == ""){ new_aria_label = "Cart. Your cart is empty."; }
if (jQuery('.icon-cart-header > .cart-count').text().trim() == "1"){ new_aria_label = "Cart. You have 1 item in your cart."; }
if (jQuery('.icon-cart-header > .cart-count').text()*1 > 1){ new_aria_label = "Cart. You have "+jQuery('.icon-cart-header > .cart-count').text()+" items in your cart."; }
} else {
new_aria_label = "Cart. Your cart is empty.";
}
if (jQuery('.icon-cart-header').attr("aria-label") != new_aria_label){
jQuery('.cart-button').closest("a").attr("aria-label", new_aria_label).attr("tabindex","0");//.attr("aria-live", "polite")
jQuery('.cart-button, .owl-prev, .owl-next, .breadcrumbs > li:not(.home)').attr("tabindex","-1").attr("aria-hidden", "true").attr("role","presentation");
jQuery('.icon-cart-header').attr("aria-label", new_aria_label);//.attr("aria-live", "polite");
}
LabelCountsAcs();
if (!jQuery('.box-popup.animate-box.show').length){
jQuery('.box-popup.animate-box button.btn-button.close-box.focused').removeClass("focused");
}
jQuery('.box-popup.animate-box.show button.btn-button.close-box:not(.focused)').focus().addClass("focused");
jQuery('#product-variants .header, .product-type-data .price, .product-more-info .media-body, .product-main .product-name').attr("tabindex","0");
//jQuery('#product-variants .swatch-element.available').attr("role","button");
// jQuery('#product-variants .swatch-element').on("keyup",function(elm){ alert(123); });
//$("#product-variants").attr("role","application");
// $("#product-variants .swatch-element").on("keydown",function(e){
// var code = (e.keyCode ? e.keyCode : e.which);
// console.log("KeyCode: "+code);
// if (code == 13 || code == 32) {
// e.preventDefault();
// //alert(code);
// //jQuery(e.target).find("input").prop("checked",true);
// jQuery(e.target).find("input").click();
// LabelCountsAcs();
// }
// });
$("#product-variants .swatch-element").on("click",function(e){
LabelCountsAcs();
window.setTimeout(function(){ jQuery('[data-value] input:checked').closest("a").focus(); }, 100);
});
//jQuery('#cart-box.show [role="alert"]').attr("role", "dialog");
//jQuery('#cart-box.show [role="alert"]').attr("role", "dialog");
//.attr("aria-live", "assertive");
//jQuery('.product-options-bottom .addtocart *').attr("role", "presentation");
jQuery('.product-options-bottom .addtocart .fa-shopping-cart').attr("tabindex","-1").attr("role", "presentation");
jQuery('.product-options-bottom .product-img').attr("role", "presentation");
jQuery('.product-options-bottom .nmxacs').remove();//.attr("aria-hidden", "true");
//jQuery('#cart-box.show input:first').focus();
jQuery('#wishlist-box+#cart-box').appendTo('.product-options-bottom');
window.setTimeout(function(){ CartTopNavLabel(); }, 2000);
}
function CheckTabNav(){
$("html").off("keyup").on("keyup",function(e) {
var keyCode = e.keyCode;
if (keyCode == 9) {
e.preventDefault();
if (!$("body[tabage]").length){ $("body").attr("tabage",0); }
$("body").attr("tabage", ($("body").attr("tabage")*1)+1);
console.log("acs tabage "+$("body").attr("tabage"));
}
});
}
function CheckMouseNav(){
$("body").unbind("mousemove").on("mousemove",function(e) {
if (!$("body[mouseage]").length){ $("body").attr("mouseage",0); }
$("body").attr("mouseage", ($("body").attr("mouseage")*1)+(e.pageX*1)+(e.pageY*1));
console.log("acs mouseage "+$("body").attr("mouseage"));
});
}
function luminanace(r, g, b){
var a = [r, g, b].map(function (v) {
v /= 255;
return v <= 0.03928 ? v / 12.92 : Math.pow( (v + 0.055) / 1.055, 2.4 );
});
return a[0] * 0.2126 + a[1] * 0.7152 + a[2] * 0.0722;
}
function contrast(rgb1, rgb2){
var lum1 = luminanace(rgb1[0], rgb1[1], rgb1[2]);
var lum2 = luminanace(rgb2[0], rgb2[1], rgb2[2]);
var brightest = Math.max(lum1, lum2);
var darkest = Math.min(lum1, lum2);
return (brightest + 0.05) / (darkest + 0.05);
}
//contrast([255, 255, 255], [255, 255, 0]); // 1.074 for yellow
//contrast([255, 255, 255], [0, 0, 255]); // 8.592 for blue
var hexDigits = new Array("0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f");
function rgb2hex(rgb){
rgb = rgb.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);
return "#" + hex(rgb[1]) + hex(rgb[2]) + hex(rgb[3]);
}
function hex(x) {
return isNaN(x) ? "00" : hexDigits[(x - x % 16) / 16] + hexDigits[x % 16];
}
function invertColor(hex, bw){
if (hex.indexOf('#') === 0) {
hex = hex.slice(1);
}
// convert 3-digit hex to 6-digits.
if (hex.length === 3) {
hex = hex[0] + hex[0] + hex[1] + hex[1] + hex[2] + hex[2];
}
if (hex.length !== 6) {
throw new Error('Invalid HEX color.');
}
var r = parseInt(hex.slice(0, 2), 16),
g = parseInt(hex.slice(2, 4), 16),
b = parseInt(hex.slice(4, 6), 16);
if (bw) {
// http://stackoverflow.com/a/3943023/112731
return (r * 0.299 + g * 0.587 + b * 0.114) > 186 ? '#000000' : '#FFFFFF';
}
// invert color components
r = (255 - r).toString(16);
g = (255 - g).toString(16);
b = (255 - b).toString(16);
// pad each with zeros and return
return "#" + padZero(r) + padZero(g) + padZero(b);
}
window.addEventListener('load',function(){
nmxSiteAccessibility(20, 100);
});
// jQuery(document).ready(function(){
// jQuery("#subscribe_footer").on("submit",function(e){
// e.preventDefault();
// OpenEmailSignupFormPopup();
// jQuery('#mc-embedded-subscribe-form #mce-EMAIL').val(jQuery('#subscribe_footer #fc-email').val());
// });
// jQuery('#subscribe_footer .btn-button.effect').on('click', function(){
// OpenEmailSignupFormPopup();
// jQuery('#mc-embedded-subscribe-form #mce-EMAIL').val(jQuery('#subscribe_footer #fc-email').val());
// });
// });