function pushDataLayer(displayName,sKU,monthlyPrice,homeOrBusiness,serviceType){dataLayer.push({ecommerce:null});dataLayer.push({event:"add_to_cart",ecommerce:{items:[{item_name:displayName,item_id:sKU,price:parseFloat(monthlyPrice),item_brand:"Wildanet",item_category:"Broadband",item_category2:homeOrBusiness,item_category3:serviceType,quantity:1}]}});};;
$(function(){$(document).on("click",".cookie-consent .btn.dismiss",function(e){e.preventDefault();$(".cookie-consent").remove();setCookie("cookie-consent","false",365);_manageExistingScripts();dataLayer.push({'event':'processCookies','variable - cookie consent':"false"})});$(document).on("click",".cookie-consent .btn.save",function(e){e.preventDefault();var consentOptions=document.getElementById("consentOptions");var consentCheckboxes=consentOptions.getElementsByTagName("input");saveCookiePrefs(consentCheckboxes);});$(document).on("click",".cookie-preferences .btn.save",function(e){e.preventDefault();var consentOptions=document.getElementById("consentPreferences");var consentCheckboxes=consentOptions.getElementsByTagName("input");saveCookiePrefs(consentCheckboxes);alert("Cookie Preferences Saved")});function saveCookiePrefs(consentCheckboxes){var consentSelected=new Array();for(var i=0;i<consentCheckboxes.length;i++){if(consentCheckboxes[i].checked){consentSelected.push(consentCheckboxes[i].value);}else{consentSelected.push("false");}}
$(".cookie-consent").remove();setCookie("cookie-consent",consentSelected.join(","),365);_manageExistingScripts();dataLayer.push({'event':'processCookies','variable - cookie consent':consentSelected.join(",")})}
$(document).on("click",".cookie-consent .btn.all",function(e){e.preventDefault();consentAll();});var cookie=getCookie("cookie-consent");var legacyCookie=getCookie("viewed_cookie_policy");if(legacyCookie!=""){$(".cookie-consent").removeClass("hide--important");consentLegacy();}else{if(cookie==""){$(".cookie-consent").removeClass("hide--important");}else{var consentPreferences=document.getElementById("consentPreferences");if(consentPreferences!=null){var consentCheckboxes=consentPreferences.getElementsByTagName("input");var cookiePrefs=cookie.split(",");for(var i=0;i<consentCheckboxes.length;i++){if(cookiePrefs[i]!="false"){consentCheckboxes[i].checked=true;}}}
_manageExistingScripts();}}});function consentLegacy(){var consentValues=new Array();var cookieAnalytics=getCookie("cookielawinfo-checkbox-analytics");if(cookieAnalytics=="yes"){consentValues.push("analytics");}
var cookieAdvertisement=getCookie("cookielawinfo-checkbox-advertisement");if(cookieAdvertisement=="yes"){consentValues.push("marketing");}
var cookiePerformance=getCookie("cookielawinfo-checkbox-performance");if(cookiePerformance=="yes"){consentValues.push("performance");}
$(".cookie-consent").remove();setCookie("cookie-consent",consentValues.join(","),365);_manageExistingScripts();dataLayer.push({'event':'processCookies','variable - cookie consent':consentValues.join(",")})}
function consentAll(){var consentValues=new Array();var consentOptions=document.getElementById("consentOptions");var consentCheckboxes=consentOptions.getElementsByTagName("input");for(var i=0;i<consentCheckboxes.length;i++){consentValues.push(consentCheckboxes[i].value);}
$(".cookie-consent").remove();setCookie("cookie-consent",consentValues.join(","),365);_manageExistingScripts();dataLayer.push({'event':'processCookies','variable - cookie consent':consentValues.join(",")})}
function setCookie(cname,cvalue,exdays){var d=new Date();d.setTime(d.getTime()+(exdays*24*60*60*1000));var expires="expires="+d.toUTCString();document.cookie=cname+"="+cvalue+";"+expires+";path=/";}
function getCookie(cname){var name=cname+"=";var decodedCookie=decodeURIComponent(document.cookie);var ca=decodedCookie.split(';');for(var i=0;i<ca.length;i++){var c=ca[i];while(c.charAt(0)==' '){c=c.substring(1);}
if(c.indexOf(name)==0){return c.substring(name.length,c.length);}}
return"";}
function getAcceptedCategories(){var categories=[];var cookie=getCookie("cookie-consent");if(cookie){var values=cookie.split(",");values.forEach(c=>{if(c){categories.push(c);}})}
return categories;}
function _manageExistingScripts(){var _config={'script_selector':'data-cookiecategory'}
var scripts=document.querySelectorAll('script['+_config.script_selector+']');var accepted_categories=getAcceptedCategories()||[];var _loadScripts=function(scripts,index){if(index<scripts.length){var curr_script=scripts[index];var curr_script_category=curr_script.getAttribute(_config.script_selector);if(_inArray(accepted_categories,curr_script_category)>-1){curr_script.type='text/javascript';curr_script.removeAttribute(_config.script_selector);var src=curr_script.getAttribute('data-src');src&&curr_script.removeAttribute('data-src');var fresh_script=_createNode('script');fresh_script.textContent=curr_script.innerHTML;(function(destination,source){var attributes=source.attributes;var len=attributes.length;for(var i=0;i<len;i++){var attr_name=attributes[i].nodeName;destination.setAttribute(attr_name,source[attr_name]||source.getAttribute(attr_name));}})(fresh_script,curr_script);src?(fresh_script.src=src):(src=curr_script.src);if(src){if(fresh_script.readyState){fresh_script.onreadystatechange=function(){if(fresh_script.readyState==="loaded"||fresh_script.readyState==="complete"){fresh_script.onreadystatechange=null;_loadScripts(scripts,++index);}};}else{fresh_script.onload=function(){fresh_script.onload=null;_loadScripts(scripts,++index);};}}
curr_script.parentNode.replaceChild(fresh_script,curr_script);if(src)return;}
_loadScripts(scripts,++index);}}
_loadScripts(scripts,0);}
var _inArray=function(arr,value){return arr.indexOf(value);}
var _createNode=function(type){var el=document.createElement(type);if(type==='button'){el.setAttribute('type',type);}
return el;};;
