function subOpen(n){n.open?(n.parentNode.style.height="40px",n.open=!1):(n.parentNode.style.height="auto",n.open=!0)}function hover(n,t){t=="on"?n.previousElementSibling.classList.add("hovered"):n.previousElementSibling.classList.remove("hovered")}function openSub(n){var t=n.nextElementSibling;t.classList.toggle("opened");n.innerHTML=t.className.indexOf("opened")!=-1?"-":"+";document.getElementById("sideMenu").style.height="100%"}function yPos(){return self.pageYOffset?self.pageYOffset:document.documentElement&&document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop?document.body.scrollTop:0}function elYPos(n){for(var i=document.getElementById(n),r=i.offsetTop,t=i;t.offsetParent&&t.offsetParent!=document.body;)t=t.offsetParent,r+=t.offsetTop;return r}function smoothScroll(n){var i=yPos(),t=elYPos(n),s=t>i?t-i:i-t,e,f;if(s<100){scrollTo(0,t);return}e=Math.round(s/100);e>=20&&(e=20);var u=Math.round(s/25),r=t>i?i+u:i-u,o=0;if(t>i){for(f=i;f<t;f+=u)setTimeout("window.scrollTo(0, "+r+")",o*e),r+=u,r>t&&(r=t),o++;return}for(f=i;f>t;f-=u)setTimeout("window.scrollTo(0, "+r+")",o*e),r-=u,r<t&&(r=t),o++}function displayTimer(n,t,i){var r=document.getElementById(n);r&&(r.innerHTML=(i?"":"<span class='counterPart'><span class='counterType'>days<\/span><span class='counterVal'>"+Math.floor(t/86400)+"<\/span><\/span>")+"<span class='counterPart'><span class='counterType'>hours<\/span><span class='counterVal'>"+Math.floor(t%86400/3600)+"<\/span><\/span><span class='counterPart'><span class='counterType'>mins<\/span><span class='counterVal'>"+Math.floor(t%3600/60)+"<\/span><\/span><span class='counterPart'><span class='counterType'>secs<\/span><span class='counterVal'>"+Math.floor(t%60)+"<\/span><\/span>",t>0&&setTimeout(function(){t--;displayTimer(n,t,i)},1e3))}function displayTimerFree(n,t,i){var r=document.getElementById(n);r&&(r.innerHTML=(i?"":"<li>"+Math.floor(t/86400)+"<span>Days<\/span><\/li>")+"<li"+(i?" class='first-elem'":"")+">"+Math.floor(t%86400/3600)+"<span>Hours<\/span><\/li><li>"+Math.floor(t%3600/60)+"<span>Mins<\/span><\/li><li>"+Math.floor(t%60)+"<span>Secs<\/span><\/li>",t>0&&setTimeout(function(){t--;displayTimerFree(n,t,i)},1e3))}function wrapTables(){var t=document.getElementsByTagName("table"),r=document.getElementsByTagName("div"),u=[],o=0,n,e,f;for(i=0;i<r.length;i++)(r[i].className==="main"||r[i].className==="mainwide"||r[i].className==="mainHome")&&(o=r[i].clientWidth);for(i=0;i<t.length;i++)t[i].clientWidth>o&&t[i].parentNode.tagName.toLowerCase()!="td"&&t[i].parentNode.className.indexOf("mobTableContainer")==-1&&t[i].className.indexOf("mobFormat")==-1&&(n=t[i],u[i]=document.createElement("div"),n.parentNode.insertBefore(u[i],n),n.parentNode.removeChild(n),u[i].className="mobTableContainer",u[i].appendChild(n),n.clientHeight<160&&(u[i].className+=" topper"));for(e=document.querySelectorAll(".mobTableContainer"),f=0;f<e.length;f++)e[f].onscroll=function(){this.className=this.className.indexOf("topper")!=-1?"mobTableContainer trans topper":"mobTableContainer trans"}}function promoSlide(n){var t=document.getElementById("jackpotPromo");t&&(n=="up"?t.classList.add("popped"):(t.classList.remove("popped"),t.classList.add("hidden")))}function promoFade(n){var t=document.getElementById("jackpotPromo");t&&(n=="in"?t.classList.add("popped"):(t.classList.remove("popped"),t.classList.add("hidden"),setTimeout(function(){t.style.display="none"},1e3)))}function getCookie(n){for(var r,u,i=document.cookie.split(";"),t=0;t<i.length;t++)if(r=i[t].substr(0,i[t].indexOf("=")),u=i[t].substr(i[t].indexOf("=")+1),r=r.replace(/^\s+|\s+$/g,""),r==n)return unescape(u)}function setCookie(n,t,i){t||(t=n);i||(i=1);var r=new Date;r.setDate(r.getDate()+i);document.cookie=n+"="+t+"; expires="+r.toUTCString()+"; path=/"}function getURL(n){var t=n.getElementsByTagName("a");t[0].getAttribute("href")!==""&&(window.location=t[0].getAttribute("href"))}function showTix(n){for(var i,r=document.querySelectorAll(".ticketsArea"),u=document.querySelectorAll(".lotteryTabs li a"),t=0;t<r.length;t++)r[t].style.display="none";for(t=0;t<u.length;t++)u[t].classList.remove("active");return i=document.getElementById(n.getAttribute("href").replace("#","")),n.classList.add("active"),i&&(i.style.display="block"),!1}function BallOrder(n){n.drawn?(document.getElementById("ballsAscending").style.display="",document.getElementById("ballsDrawn").style.display="none",n.innerHTML="Display balls in drawn order",n.drawn=!1):(document.getElementById("ballsAscending").style.display="none",document.getElementById("ballsDrawn").style.display="",n.innerHTML="Display balls in ascending order",n.drawn=!0)}function checkDetails(n){var s=n?"0":"",i=document.getElementById("Email"+s),r=document.getElementById("Password"+s),t=document.getElementById("NewPassword"),u=document.getElementById("ConfirmNewPassword"),f=document.getElementById("FirstName"),e=document.getElementById("Surname"),h=document.getElementById("AcceptTerms"),o=document.getElementById("Salutation");if(r||(r=document.getElementById("CurrentPassword")),t||(t=document.getElementById("Password")),u||(u=document.getElementById("ConfirmPassword")),!n&&f&&f.value=="")return alert("Please enter your first name."),f.focus(),!1;if(!n&&e&&e.value=="")return alert("Please enter your surname."),e.focus(),!1;if(i){if(i.value=="")return alert("Please enter your email address."),i.focus(),!1;if(apos=i.value.indexOf("@"),dotpos=i.value.lastIndexOf("."),apos<1||dotpos-apos<2)return alert("Please enter a valid email address."),i.focus(),!1}if(!n&&t&&u){if(t.value=="")return alert("Please enter your new password."),t.focus(),!1;if(validPassword(t)){if(u.value!==t.value)return alert("Your new passwords do not match."),u.focus(),!1}else return!1}else if(r&&r.value=="")return alert("Please enter a password."),r.focus(),!1;if(!n&&h&&!h.checked)return alert("Please read and accept the terms & conditions."),!1;if(!n&&o){var c=document.getElementById("GenderMale"),k=document.getElementById("GenderFemale"),d=document.getElementById("GenderNonBinary"),l=document.getElementById("DOBDay"),a=document.getElementById("DOBMonth"),v=document.getElementById("DOBYear"),y=document.getElementById("Address1"),p=document.getElementById("City"),w=document.getElementById("County"),b=document.getElementById("PostCode");if(o.selectedIndex==0)return alert("Please select your salutation from the drop down list."),o.focus(),!1;if(c.checked==!1&&k.checked==!1&&d.checked==!1)return alert("Please enter your gender."),c.focus(),!1;if(l.value=="")return alert("Please enter your date of birth."),l.focus(),!1;if(a.selectedIndex==0)return alert("Please select your date of birth."),a.focus(),!1;if(v.value=="")return alert("Please enter your date of birth."),v.focus(),!1;if(y.value=="")return alert("Please enter your address."),y.focus(),!1;if(p.value=="")return alert("Please enter your city."),p.focus(),!1;if(w.value=="")return alert("Please enter your county."),w.focus(),!1;if(b.value=="")return alert("Please enter your post code or ZIP code."),b.focus(),!1}return!0}function validPassword(n){var t=n.value;return t.length<8?(alert("Passwords should contain at least eight characters"),!1):/^[a-zA-Z0-9!@#$%^|\?*\(\)]{8,}$/.test(t)?!0:(alert("Passwords can only contain letters, numbers and a selection of special characters: ! @ # $ % ^ | ? * ( )"),!1)}addLoadEvent(function(){var r,u,t,i,n,e;document.getElementById("sidebarLeft")&&document.getElementById("siteContainer").clientHeight<=document.getElementById("sidebarLeft").clientHeight+100&&(document.getElementById("topBtn").style.display="none");"ontouchstart"in window&&wrapTables();r=document.getElementById("resultsBottomInner");r&&setInterval(function(){r.classList.toggle("slid")},5e3);u=document.querySelector("#show-winnings");t=document.querySelectorAll(".checkingTable tbody tr");u&&t&&u.addEventListener("click",function(){for(var n=0;n<t.length;n++)t[n].querySelector(".prize-won")||(t[n].style.display=this.checked?"none":"")});var f=document.querySelectorAll(".ticketsArea"),o=document.querySelectorAll(".lotteryTabs li a"),s=document.querySelector(".lotteryTabs li a[href='"+window.location.hash+"']");if(f.length>0)for(n=1;n<f.length;n++)f[n].style.display="none";if(o.length>0&&o[0].classList.add("active"),s&&showTix(s),i=document.querySelectorAll(".collapseWrapper"),i.length>0)for(n=0;n<i.length;n++)e=i[n].querySelector(".collapse"),e&&e.addEventListener("click",function(){this.parentNode.classList.toggle("active")})});addLoadEvent(function(){document.getElementById("quickPick")&&SelectedBalls()})