function showGlobalModal(n){var r,t,i;$("body").append("<div id='globalModal'><div id='globalModalInner'><div class='modalContent'<\/div><\/div><div class='modalFooter'><button class='closePopup cancel'>Close<\/button><\/div><\/div>");typeof n.attr("data-content-source")!="undefined"?(r=n.attr("data-content-source"),$("#globalModalInner .modalContent").empty().append($(r).html()),setTimeout(function(){$("#globalModalInner .modalContent").scrollTop(0)},500)):(t=n.attr("data-target"),i=n.attr("data-scroll-to"),typeof ga!="undefined"&&ga("send",{hitType:"event",eventCategory:"modal pop-up",eventAction:"click",eventLabel:t}),$("#globalModalInner .modalContent").empty().load(t,function(){var n=$(this),r=0,t;i!=undefined&&(t=n.find("#"+i),t.length>0&&(r=t.offset().top-n.offset().top));n.find(".document-section").length>0&&(n.find(".document-section:not(.always-visible)").hide(),n.find(".document-section:not(:visible)").each(function(){if($(this).prev(".content-trigger").length==0){var n=$(this);$(this).before($("<a class='content-trigger' style='display:inline' href='#'>+ Expand section<\/a>").click(function(t){t.preventDefault();n.is(":visible")?$(this).text("+ Expand section"):$(this).text("- Hide section");n.slideToggle()}))}}))}));$("#globalModal").show()}function setSectorCompanies(){ajaxUtilities.getSectorCompanies(function(n){var i=$(".sector-preferencesEmail"),t;i.length>0&&i.append(n.email);t=$(".sector-preferencesTelephone");t.length>0&&t.append(n.telephone);$(".js-show-companies").click(function(n){n.preventDefault();var t=$(this),i=t.closest(".js-sector");t.text()==="[Show]"?t.text("[Hide]"):t.text("[Show]");i.find(".js-companies").toggle()});$(".telephone-categories").html(n.telephoneSectorNames.join(", "));$(".email-categories").html(n.emailSectorNames.join(", "))})}var RootPath,respondToSizingMessage,ajaxUtilities;window.Modernizr=function(n,t,i){function w(n){nt.cssText=n}function e(n,t){return typeof n===t}function g(){u.input=function(i){for(var u=0,f=i.length;u<f;u++)o[i[u]]=i[u]in r;return o.list&&(o.list=!!t.createElement("datalist")&&!!n.HTMLDataListElement),o}("autocomplete autofocus list placeholder max min multiple pattern required step".split(" "));u.inputtypes=function(n){for(var e=0,u,o,s,h=n.length;e<h;e++)r.setAttribute("type",o=n[e]),u=r.type!=="text",u&&(r.value=k,r.style.cssText="position:absolute;visibility:hidden;",/^range$/.test(o)&&r.style.WebkitAppearance!==i?(f.appendChild(r),s=t.defaultView,u=s.getComputedStyle&&s.getComputedStyle(r,null).WebkitAppearance!=="textfield"&&r.offsetHeight!==0,f.removeChild(r)):/^(search|tel)$/.test(o)||(u=/^(url|email)$/.test(o)?r.checkValidity&&r.checkValidity()===!1:r.value!=k)),d[n[e]]=!!u;return d}("search tel url email datetime date month week time datetime-local number range color".split(" "))}var u={},c=!0,f=t.documentElement,b=t.createElement("modernizr"),nt=b.style,r=t.createElement("input"),k=":)",tt={}.toString,l={},d={},o={},a=[],v=a.slice,s,y={}.hasOwnProperty,p,h;p=!e(y,"undefined")&&!e(y.call,"undefined")?function(n,t){return y.call(n,t)}:function(n,t){return t in n&&e(n.constructor.prototype[t],"undefined")};Function.prototype.bind||(Function.prototype.bind=function(n){var t=this,i,r;if(typeof t!="function")throw new TypeError;return i=v.call(arguments,1),r=function(){var f,e,u;return this instanceof r?(f=function(){},f.prototype=t.prototype,e=new f,u=t.apply(e,i.concat(v.call(arguments))),Object(u)===u?u:e):t.apply(n,i.concat(v.call(arguments)))},r});for(h in l)p(l,h)&&(s=h.toLowerCase(),u[s]=l[h](),a.push((u[s]?"":"no-")+s));return u.input||g(),u.addTest=function(n,t){if(typeof n=="object")for(var r in n)p(n,r)&&u.addTest(r,n[r]);else{if(n=n.toLowerCase(),u[n]!==i)return u;t=typeof t=="function"?t():t;typeof c!="undefined"&&c&&(f.className+=" "+(t?"":"no-")+n);u[n]=t}return u},w(""),b=r=null,function(n,t){function v(n,t){var i=n.createElement("p"),r=n.getElementsByTagName("head")[0]||n.documentElement;return i.innerHTML="x<style>"+t+"<\/style>",r.insertBefore(i.lastChild,r.firstChild)}function s(){var n=r.elements;return typeof n=="string"?n.split(" "):n}function u(n){var t=a[n[l]];return t||(t={},o++,n[l]=o,a[o]=t),t}function h(n,r,f){if(r||(r=t),i)return r.createElement(n);f||(f=u(r));var e;return e=f.cache[n]?f.cache[n].cloneNode():b.test(n)?(f.cache[n]=f.createElem(n)).cloneNode():f.createElem(n),e.canHaveChildren&&!w.test(n)?f.frag.appendChild(e):e}function y(n,r){if(n||(n=t),i)return n.createDocumentFragment();r=r||u(n);for(var e=r.frag.cloneNode(),f=0,o=s(),h=o.length;f<h;f++)e.createElement(o[f]);return e}function p(n,t){t.cache||(t.cache={},t.createElem=n.createElement,t.createFrag=n.createDocumentFragment,t.frag=t.createFrag());n.createElement=function(i){return r.shivMethods?h(i,n,t):t.createElem(i)};n.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+s().join().replace(/\w+/g,function(n){return t.createElem(n),t.frag.createElement(n),'c("'+n+'")'})+");return n}")(r,t.frag)}function c(n){n||(n=t);var f=u(n);return r.shivCSS&&!e&&!f.hasCSS&&(f.hasCSS=!!v(n,"article,aside,figcaption,figure,footer,header,hgroup,nav,section{display:block}mark{background:#FF0;color:#000}")),i||p(n,f),n}var f=n.html5||{},w=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,b=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,e,l="_html5shiv",o=0,a={},i,r;(function(){try{var n=t.createElement("a");n.innerHTML="<xyz><\/xyz>";e="hidden"in n;i=n.childNodes.length==1||function(){t.createElement("a");var n=t.createDocumentFragment();return typeof n.cloneNode=="undefined"||typeof n.createDocumentFragment=="undefined"||typeof n.createElement=="undefined"}()}catch(r){e=!0;i=!0}})();r={elements:f.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",shivCSS:f.shivCSS!==!1,supportsUnknownElements:i,shivMethods:f.shivMethods!==!1,type:"default",shivDocument:c,createElement:h,createDocumentFragment:y};n.html5=r;c(t)}(this,t),u._version="2.6.2",f.className=f.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(c?" js "+a.join(" "):""),u}(this,this.document),function(n,t,i){function h(n){return"[object Function]"==y.call(n)}function c(n){return"string"==typeof n}function l(){}function w(n){return!n||"loaded"==n||"complete"==n||"uninitialized"==n}function e(){var n=a.shift();v=1;n?n.t?s(function(){("c"==n.t?u.injectCss:u.injectJs)(n.s,0,n.a,n.x,n.e,1)},0):(n(),e()):v=0}function ut(n,i,f,h,c,l,y){function k(t){if(!nt&&w(p.readyState)&&(tt.r=nt=1,!v&&e(),p.onload=p.onreadystatechange=null,t)){"img"!=n&&s(function(){g.removeChild(p)},50);for(var u in r[i])r[i].hasOwnProperty(u)&&r[i][u].onload()}}var y=y||u.errorTimeout,p=t.createElement(n),nt=0,b=0,tt={t:f,s:i,e:c,a:l,x:y};1===r[i]&&(b=1,r[i]=[]);"object"==n?p.data=i:(p.src=i,p.type=n);p.width=p.height="0";p.onerror=p.onload=p.onreadystatechange=function(){k.call(this,b)};a.splice(h,0,tt);"img"!=n&&(b||2===r[i]?(g.insertBefore(p,d?null:o),s(k,y)):r[i].push(p))}function ft(n,t,i,r,u){return v=0,t=t||"j",c(n)?ut("c"==t?et:nt,n,t,this.i++,i,r,u):(a.splice(this.i++,0,n),1==a.length&&e()),this}function b(){var n=u;return n.loader={load:ft,i:0},n}var f=t.documentElement,s=n.setTimeout,o=t.getElementsByTagName("script")[0],y={}.toString,a=[],v=0,k="MozAppearance"in f.style,d=k&&!!t.createRange().compareNode,g=d?f:o.parentNode,f=n.opera&&"[object Opera]"==y.call(n.opera),f=!!t.attachEvent&&!f,nt=k?"object":f?"script":"img",et=f?"script":nt,tt=Array.isArray||function(n){return"[object Array]"==y.call(n)},p=[],r={},it={timeout:function(n,t){return t.length&&(n.timeout=t[0]),n}},rt,u;u=function(n){function a(n){for(var n=n.split("!"),f=p.length,t=n.pop(),e=n.length,t={url:t,origUrl:t,prefixes:n},u,r,i=0;i<e;i++)r=n[i].split("="),(u=it[r.shift()])&&(t=u(t,r));for(i=0;i<f;i++)t=p[i](t);return t}function f(n,t,u,f,e){var o=a(n),s=o.autoCallback;o.url.split(".").pop().split("?").shift();o.bypass||(t&&(t=h(t)?t:t[n]||t[f]||t[n.split("/").pop().split("?")[0]]),o.instead?o.instead(n,t,u,f,e):(r[o.url]?o.noexec=!0:r[o.url]=1,u.load(o.url,o.forceCSS||!o.forceJS&&"css"==o.url.split(".").pop().split("?").shift()?"c":i,o.noexec,o.attrs,o.timeout),(h(t)||h(s))&&u.load(function(){b();t&&t(o.origUrl,e,f);s&&s(o.origUrl,e,f);r[o.url]=2})))}function s(n,t){function a(n,o){if(n){if(c(n))o||(i=function(){var n=[].slice.call(arguments);s.apply(this,n);u()}),f(n,i,t,0,e);else if(Object(n)===n)for(r in v=function(){var t=0,i;for(i in n)n.hasOwnProperty(i)&&t++;return t}(),n)n.hasOwnProperty(r)&&(!o&&!--v&&(h(i)?i=function(){var n=[].slice.call(arguments);s.apply(this,n);u()}:i[r]=function(n){return function(){var t=[].slice.call(arguments);n&&n.apply(this,t);u()}}(s[r])),f(n[r],i,t,r,e))}else o||u()}var e=!!n.test,o=n.load||n.both,i=n.callback||l,s=i,u=n.complete||l,v,r;a(e?n.yep:n.nope,!!o);o&&a(o)}var e,t,o=this.yepnope.loader;if(c(n))f(n,0,o,0);else if(tt(n))for(e=0;e<n.length;e++)t=n[e],c(t)?f(t,0,o,0):tt(t)?u(t):Object(t)===t&&s(t,o);else Object(n)===n&&s(n,o)};u.addPrefix=function(n,t){it[n]=t};u.addFilter=function(n){p.push(n)};u.errorTimeout=1e4;null==t.readyState&&t.addEventListener&&(t.readyState="loading",t.addEventListener("DOMContentLoaded",rt=function(){t.removeEventListener("DOMContentLoaded",rt,0);t.readyState="complete"},0));n.yepnope=b();n.yepnope.executeStack=e;n.yepnope.injectJs=function(n,i,r,f,h,c){var a=t.createElement("script"),v,y,f=f||u.errorTimeout;a.src=n;for(y in r)a.setAttribute(y,r[y]);i=c?e:i||l;a.onreadystatechange=a.onload=function(){!v&&w(a.readyState)&&(v=1,i(),a.onload=a.onreadystatechange=null)};s(function(){v||(v=1,i(1))},f);h?a.onload():o.parentNode.insertBefore(a,o)};n.yepnope.injectCss=function(n,i,r,u,f,h){var u=t.createElement("link"),c,i=h?e:i||l;u.href=n;u.rel="stylesheet";u.type="text/css";for(c in r)u.setAttribute(c,r[c]);f||(o.parentNode.insertBefore(u,o),s(i,0))}}(this,document);Modernizr.load=function(){yepnope.apply(window,[].slice.call(arguments,0))};RootPath="";$(function(){Global.init()});Global={rootPath:"",init:function(){var n,t;if(this.rootPath="/",n=this,this.doBrowserCompatibilityCorrections(),Timers.init(),this.SelectCurrentNavigationItem(),$(".language").click(function(){$("#fldLanguage").val($(this).next().val())}),$("#CookieNotification").length>0&&$("#CookieConsentTrigger").click(function(){n.WebMethods.recordCookieConsent(function(){$("#CookieNotification").slideUp("slow",function(){$("#CookieNotification").remove()})})}),$(".s-banner-wrap").length>0&&($(".s-banner-wrap").hover(function(){$(".s-banner-wrap .social-close").css("display","block")},function(){$(".s-banner-wrap .social-close").hide()}),t=this,$(".social-close").click(function(n){n.preventDefault();t.CallServer("/WebMethods.ashx/DisableSocialMedia",null,null);$(".s-banner-wrap").hide()})),$(".menu-trigger").click(function(n){n.preventDefault();$("header nav").toggleClass("visible-xs")}),$(window).resize(function(){parseInt($(window).width())>650&&$("header nav").removeClass("visible-xs")}),$(".js-show-companies").click(function(n){n.preventDefault();var t=$(this),i=t.closest(".js-sector");t.text()==="[Show]"?t.text("[Hide]"):t.text("[Show]");i.find(".js-companies").toggle()}),$(".email-master-optin,.telephone-master-optin").length>0){$(document).on("change",".email-master-optin",function(){this.checked?($("#sectorPreferencesEmail").find(".sponsor-optout input[type='checkbox'],.sector-preferences-selectall,.sector-preferences-sector-optin, .sector-preferences-company-optin").removeAttr("disabled"),$("#sectorPreferencesEmail").find(".sector-preferences-selectall").prop("checked",!1),$("#sectorPreferencesEmail").find(".sector-preferences-selectall").click(),$("#sectorPreferencesEmail").find(".sponsor-optout input[type='checkbox']").prop("checked",!0),$("#sectorPreferencesEmailDisabled").hide()):($("#sectorPreferencesEmail").find(".sector-preferences-selectall").prop("checked",!0),$("#sectorPreferencesEmail").find(".sector-preferences-selectall").click(),$("#sectorPreferencesEmail").find(".sponsor-optout input[type='checkbox']").prop("checked",!1),$("#sectorPreferencesEmailDisabled").show(),$("#sectorPreferencesEmail").find(".sponsor-optout input[type='checkbox'],.sector-preferences-selectall,.sector-preferences-sector-optin, .sector-preferences-company-optin").attr("disabled","disabled"))});$(document).on("change",".telephone-master-optin",function(){this.checked?($("#sectorPreferencesTelephone").find(".sponsor-optout input[type='checkbox'],.sector-preferences-selectall,.sector-preferences-sector-optin, .sector-preferences-company-optin").removeAttr("disabled"),$("#sectorPreferencesTelephone").find(".sector-preferences-selectall").prop("checked",!1),$("#sectorPreferencesTelephone").find(".sector-preferences-selectall").click(),$("#sectorPreferencesTelephone").find(".sponsor-optout input[type='checkbox']").prop("checked",!0),$("#sectorPreferencesTelephoneDisabled").hide()):($("#sectorPreferencesTelephone").find(".sector-preferences-selectall").prop("checked",!0),$("#sectorPreferencesTelephone").find(".sector-preferences-selectall").click(),$("#sectorPreferencesTelephone").find(".sponsor-optout input[type='checkbox']").prop("checked",!1),$("#sectorPreferencesTelephoneDisabled").show(),$("#sectorPreferencesTelephone").find(".sponsor-optout input[type='checkbox'],.sector-preferences-selectall,.sector-preferences-sector-optin, .sector-preferences-company-optin").attr("disabled","disabled"))});$("#Preferences_TelephoneSector_MasterOptIn,#Preferences_EmailSector_MasterOptIn").change()}$("#sectorPreferencesTelephone").find(".sector-preferences-selectall").prop("checked",$("#sectorPreferencesTelephone .sector-preferences-sector-optin:not(:checked)").length==0);$("#sectorPreferencesEmail").find(".sector-preferences-selectall").prop("checked",$("#sectorPreferencesEmail .sector-preferences-sector-optin:not(:checked)").length==0);$(document).on("change",".sector-preferences-selectall",function(){$(this).closest(".modal-sector-preferences").find(".sector-preferences-sector-optin").prop("checked",this.checked);$(this).closest(".modal-sector-preferences").find(".sector-preferences-company-optin").prop("checked",this.checked)});$(document).on("change",".sector-preferences-sector-optin",function(){$(this).closest(".modal-sector-preferences").find(".sector-preferences-selectall").prop("checked",!1);$(this).closest(".js-sector").find(".sector-preferences-company-optin").prop("checked",this.checked)});$(document).on("change",".sector-preferences-company-optin",function(){this.checked||$(this).closest(".modal-sector-preferences").find(".sector-preferences-selectall").prop("checked",!1)})},doBrowserCompatibilityCorrections:function(){var n=-1,t,i;navigator.appName=="Microsoft Internet Explorer"&&(t=navigator.userAgent,i=new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})"),i.exec(t)!=null&&(n=parseFloat(RegExp.$1)),n<9&&$("*:last-child").addClass("last-child"));Modernizr.input.placeholder||($("[placeholder]").focus(function(){var n=$(this);n.val()==n.attr("placeholder")&&(n.val(""),n.removeClass("placeholder"))}).blur(function(){var n=$(this);(n.val()==""||n.val()==n.attr("placeholder"))&&(n.addClass("placeholder"),n.val(n.attr("placeholder")))}).blur(),$("[placeholder]").parents("form").submit(function(){$(this).find("[placeholder]").each(function(){var n=$(this);n.val()==n.attr("placeholder")&&n.val("")})}))},SelectCurrentNavigationItem:function(){$.extend($.expr[":"],{currentPage:function(n){return n.href&&(n.href===window.location.href||n.href.match(/-competitions$/)&&window.location.href.match(/-competitions$/))}});$("nav a:currentPage").addClass("selected")},ModalWindow:{settings:"",modalActive:!1,show:function(n){var t,i,r;this.settings=$.extend({keepInsideForm:!0,scrolling:!1,resizeable:!1,frameborder:!1,pageSrc:"",containerID:"",modalID:"#modal-wrap",width:800,height:452,showCloseHeading:!0,verticalAlign:"default",customClass:null},n);t=$(this.settings.modalID);t.length==0&&(t=$("<div id='"+this.settings.modalID.replace(/#/g,"").replace(/\./g,"")+"'><\/div>"),t.appendTo("body"));this.settings.customClass==null||t.hasClass(this.settings.customClass)||t.addClass(this.settings.customClass);this.settings.showCloseHeading&&t.find(".close").length==0?t.append($("<div class='close'><\/div>").append($("<a href='#'><img  src='/im/ox6-1/global/close-icon.png' width='21' height='21' alt='close' /><\/a>").click(function(n){Global.ModalWindow.close(n)}))):this.settings.showCloseHeading?$("#modal-wrap .close").show():$("#modal-wrap .close").hide();this.modalActive||(this.settings.containerID==""?(i=$(document.createElement("iframe")),i.attr("src",this.settings.pageSrc),i.attr("scrolling",this.settings.scrolling?"auto":"no"),i.attr("frameborder",this.settings.frameborder?1:0),i.addClass("modal-frame"),i.css("height",this.settings.height-38+"px"),$(this.settings.modalID).append(i)):(r=$(this.settings.containerID),t.append(r),r.show()),this.center())},close:function(n){return n&&n.preventDefault(),this.modalActive&&($("#modal-filter").remove(),$(this.settings.containerID).hide(),$(this.settings.modalID).hide(),this.modalActive=!1,this.settings.customClass!=null&&$(this.settings.modalID).removeClass(this.settings.customClass),$(this.settings.modalID+" iframe").remove(),this.settings.keepInsideForm&&$(this.settings.containerID).appendTo($("form").first())),!1},center:function(){var r=$(document.body).width(),u=document.documentElement.clientHeight,n,t,i;$(this.settings.modalID).show();this.modalActive=!0;window.scrollTo(0,150);n=0;switch(this.settings.verticalAlign){case"middle":n=u/2-this.settings.height/2;break;default:n=200}t=this.settings.width;$(this.settings.modalID).css({position:"absolute",width:t,height:Global.ModalWindow.settings.height,top:n+"px",left:r/2-t/2});i=$("<div id='modal-filter'><\/div>");i.css({width:r,height:$(document).height()});$(document.body).append(i)}},autoComplete:function(n,t,i){n!==undefined&&n!=="SearchWinnerTestimonials"&&(n="SearchWinnerTestimonials");$(t).autocomplete({source:function(t,r){i||(i=r);Global.WebMethods.doSearchForAutoComplete(n,t.term,i)},minLength:0,select:function(){}})},WebMethods:{recordCookieConsent:function(n){Global.CallServer(Global.rootPath+"webmethods.ashx/RecordCookieConsent",null,function(t){n(t)})},doSearchForAutoComplete:function(n,t,i){Global.CallServer(Global.rootPath+"webmethods.ashx/"+n+"?term="+t,null,function(n){i(n.d)})}},CallServer:function(n,t,i,r,u){r||(r="POST");u||(u=function(){});$.ajax({type:r,url:n,data:t,contentType:"application/json; charset=utf-8",dataType:"json",success:i,error:u})},registerErrorHandler:function(){window.onerror=function(n,t,i){(t==undefined||t==""||t==null)&&(t=window.location.href);Global.logException(n+" Line: "+i,t,"onerror")}},logException:function(n,t,i,r,u){r===undefined&&(r=null);u===undefined&&(u=null);this.CallServer("/WebMethods.ashx/LogException",JSON.stringify({url:t,type:i,description:r,stackTrace:u,message:n}),function(){})},getScrollableRoot:function(){var n=document.body,t=n.scrollTop;return n.scrollTop++,n.scrollTop===t?document.documentElement:(n.scrollTop--,n)}};Timers={timeRemaining:{hh:0,mm:0,ss:0},setTimeRemaining:function(n,t,i){this.timeRemaining={hh:n,mm:t,ss:i}},init:function(){var n=!1;$("#DailyPrizeClock").length>0&&(this.UpdateDailyPrizeClock(),setInterval("Timers.UpdateDailyPrizeClock();",1e3),n=!0);n&&(this.DecrementTime(),setInterval("Timers.DecrementTime();",1e3))},DecrementTime:function(){this.timeRemaining.ss-=1;this.timeRemaining.ss<0&&(this.timeRemaining.ss=59,this.timeRemaining.mm-=1);this.timeRemaining.mm<0&&(this.timeRemaining.mm=59,this.timeRemaining.hh-=1);this.timeRemaining.hh<0&&(this.timeRemaining.hh=23)},UpdateDailyPrizeClock:function(){var n=$("#DailyPrizeClock .hours")[0],t=$("#DailyPrizeClock .minutes")[0],i=$("#DailyPrizeClock .seconds")[0];n!=undefined&&(this.timeRemaining.hh<10?(n.innerHTML="0",n.innerHTML+=this.timeRemaining.hh):n.innerHTML=this.timeRemaining.hh,this.timeRemaining.mm<10?(t.innerHTML="0",t.innerHTML+=this.timeRemaining.mm):t.innerHTML=this.timeRemaining.mm,this.timeRemaining.ss<10?(i.innerHTML="0",i.innerHTML+=this.timeRemaining.ss):i.innerHTML=this.timeRemaining.ss)},getNumber:function(n,t){var i=parseInt(n),r;return t==0&&i<10?0:i<10?i:(r=parseInt((n+" ").substr(t,1)),isNaN(r)?0:r)}};Login={init:function(){var n=this;$(".submit").click(function(){return n.validate()})},validate:function(){var i,r,n,t,u;if(validationErrors=[],typeof Page_ClientValidate=="function"){for(i=Page_ClientValidate(),r=$(".errorContainer"),r.find("ul li:not(.complete-all-fields)").remove(),n=0;n<Page_Validators.length;n++)t=Page_Validators[n],u=$("#"+Page_Validators[n].controltovalidate),t.isvalid?u.parent().removeClass("val"):(u.parent().addClass("val"),t.id.indexOf("rqr")==0?$(".complete-all-fields").show():r.find("ul").append("<li>"+t.errormessage+"<\/li>"));return i?$(".error-intro").hide():$(".error-intro").show(),i}}};Winners={showPage:function(n){window.location=n!==""?RootPath+"winners/"+n.toLowerCase():RootPath+"recent-winners"}};PrizeCalendar={init:function(){$(".calendar").removeAttr("style");$(".calendar th").removeAttr("style");$(".calendar td").removeAttr("style");$(".calendar").removeAttr("title");this.showMonth(".this");$("#aShowThisMonth").click(function(n){n.preventDefault();PrizeCalendar.showMonth(".this")});$("#aShowNextMonth").click(function(n){n.preventDefault();PrizeCalendar.showMonth(".next")})},showMonth:function(n){$(".this-months-calendar").hide();$(".next-months-calendar").hide();$("#aShowThisMonth").hide();$("#aShowNextMonth").hide();$(n+"-months-calendar").show();n===".this"?$("#aShowNextMonth").show():$("#aShowThisMonth").show()}};YourEntries={init:function(){var n=this;return $("#ulYourEntries a").click(function(t){t.preventDefault();n.showPanel(this.id.substring(2))}),this},showPanel:function(n){$("#your-competition-entries > div").hide();$("#"+n).show();$("#ulYourEntries li").removeClass("selected");$("#a-"+n).parent().addClass("selected")}};$(document).on("click","a[data-toggle='modal']",function(){typeof ga!="undefined"&&ga("send",{hitType:"event",eventCategory:"modal pop-up",eventAction:"click",eventLabel:$(this).attr("data-target")})});$(document).on("click",".modalPopup",function(n){n.preventDefault();n.stopPropagation();var t=$(this);showGlobalModal(t)});$(document).on("click",".closePopup",function(n){n.preventDefault();$("#globalModal").fadeOut().remove()});$(document).on("change","#globalModalInner .sponsor-optout input[type=checkbox]",function(){var i=$(this),t=i.prop("checked")==!0,n=$("form .sponsor-optout input[id='"+i.attr("id")+"']");console.log(n.length);n.val(t).prop("checked",t);t||n.removeAttr("checked");console.log(n.val())});respondToSizingMessage=function(n){n.data==="pagesize?"&&n.source.postMessage("pagesize:"+document.body.scrollWidth+","+document.body.scrollHeight,n.origin)};window.addEventListener("message",respondToSizingMessage,!1);$(function(){$("#sector-template").length>0&&setSectorCompanies()});$(function(){$(".language").click(function(n){var r,t,i;if(n.preventDefault(),r=$(this),t=window.location.search,t!=""&&(i=new URLSearchParams(t),i.has("lang"))){t="";const n=i.entries();for(const n of n)n[0]!="lang"&&(t+=t==""?"?"+n[0]+"="+n[1]:"&"+n[0]+"="+n[1])}t+=(t?"&":"?")+$.param({lang:r.next().val()});window.location.href=window.location.protocol+"//"+window.location.host+window.location.pathname+t})});ajaxUtilities=function(){var n="/AjaxUtilities",r=function(t){return $.ajax({type:"POST",url:n+"/IsValidEmailAddress",data:{email:t},async:!1})},u=function(t,i,r){return $.ajax({type:"POST",url:n+"/IsValidAge",data:{day:t,month:i,year:r},cache:!1,async:!1})},f=function(t,i,r){var u=function(n){var i={options:0,html:null},u,t;if(n.errored)r(null);else if(n===undefined||n===""||n.result.length===0)r(i);else{for(u="",t=0;t<n.result.length;t++)u+="<option value='"+t+"' data-address1='"+n.result[t].Address1+"' data-address2='"+n.result[t].Address2+"' data-posttown='"+n.result[t].PostTown+"' data-county='"+n.result[t].County+"' data-postcode='"+n.result[t].Postcode+"' data-singlelineaddress='"+n.result[t].SingleAddressLine+"'>"+n.result[t].SingleAddressLine+"<\/option>";i.options=n.results;i.html=u;r(i)}};parseInt($.fn.jquery)>=3?$.post(n+"/GetAddressesFromPostcode",{postcode:t,auth:i}).then(function(n){u(n)}).catch(function(){r(null)}):$.post(n+"/GetAddressesFromPostcode",{postcode:t,auth:i}).done(function(n){u(n)}).error(function(){r(null)})},e=function(t,i,r,u,f,e){return $.ajax({type:"POST",url:n+"/LogContactEnquiry",data:{isUnsubscribe:t,category:i,name:r,email:u,subject:f,description:e},async:!1})},t=function(n,t){for(var y=$("#sector-template").html(),p=$("#subsector-template").html(),w=$("#company-template").html(),a="",v=0,u,e,c,o,s,l,h,r,i,f=0;f<n.length;f++){for(u=n[f],e=y.replace(/{{sector}}/g,u.SectorName),e=e.replace(/{{checked}}/g,u.OptIn?"checked":""),c="",o=0;o<u.SubSectors.length;o++){for(s=u.SubSectors[o],l=p.replace(/{{subsectorname}}/g,s.SectorSubName),h=0;h<s.Companies.length;h++)r=s.Companies[h],i=w.replace(/{{companyname}}/g,"&bull; "+r.CompanyName),i=i.replace(/{{index}}/g,v),i=i.replace(/{{companyid}}/g,r.Pkid),i=i.replace(/{{disclaimer}}/g,r.Disclaimer),i=r.Disclaimer?i.replace(/{{disclaimer-display}}/g,"block"):i.replace(/{{disclaimer-display}}/g,"none"),i=i.replace(/{{checked}}/g,r.OptIn?"checked":""),i=i.replace(/{{optin}}/g,r.OptIn?"true":"false"),v++,l+=i;c+=l}a+=e.replace(/{{subsectors}}/g,c).replace(/{{type}}/g,t)}return a},i=function(n){for(var i=[],t=0;t<n.length;t++)i.indexOf(n[t].SectorName)===-1&&i.push(n[t].SectorName);return i},o=function(r){if(parseInt($.fn.jquery)>=3)$.get(n+"/CompanySectors").then(function(n){r({email:t(n.email,"Email"),telephone:t(n.telephone,"Telephone"),telephoneSectorNames:i(n.telephone),emailSectorNames:i(n.email)})}).catch(function(){r(null)});else return $.ajax({type:"GET",url:n+"/CompanySectors"}).done(function(n){r({email:t(n.email,"Email"),telephone:t(n.telephone,"Telephone"),telephoneSectorNames:i(n.telephone),emailSectorNames:i(n.email)})}).error(function(){r(null)})};return{isValidEmailAddress:r,isValidAge:u,getAddressesFromPostcode:f,logContactEnquiry:e,getSectorCompanies:o}}()