function inputClickSubmit(n){if(n.keyCode=="13"){var t=$(".btn-div a");window.location=t.attr("href");t.click()}}function showProgress(){$('[id$="Loading1_udProgress"]').css("display","block");setTimeout("hideProgress();",1e4)}function hideProgress(){$('[id$="Loading1_udProgress"]').css("display","none")}function stopLoaderIfInvalid(){var n=$(".QuickRequiredMessage:visible").first().get(0)==undefined?!0:!1;n||hideProgress()}function showLoaderIfValid(){try{window.setTimeout(function(){showProgress()},40);window.setTimeout(stopLoaderIfInvalid,50);setTimeout("hideProgress();",1e4)}catch(n){}}function mobileAdapt(){IsMobileJS()&&($(".UserIdValidators").insertAfter(".UserIdTxt"),$(".UserYearOfBirthValidators").insertAfter(".UserYearOfBirthTxt"))}function persistStorage(){(window.isAppMode===!0||localStorage.getItem("isAppMode"))&&localStorage.setItem("isAppMode",!0)}function setBottomMenuPosition(){$(".main-content-wrapper").length>0?$(".main-content-wrapper").css("min-height",$(window).height()-$(".top_menu_wrapper").height()-80):$(".WidthMax").length>0&&$(".WidthMax").first().css("min-height",$(window).height()-$(".top_menu_wrapper").height()-80)}function TytoLoginWT(){webTrendsObj.SendElementWTParams(WT_TytoLogin.loginLoaded);$(".QuickContinue a").click(function(){webTrendsObj.SendElementWTParams(WT_TytoLogin.loginContinueClick)});var n=$(".errorSummaryContainer");n.attr("style")!=undefined&&webTrendsObj.SendElementWTParams(WT_TytoLogin.loginFailed,["error_message",n.text()])}function QuickTytoOTPSendWT(){webTrendsObj.SendElementWTParams(WT_TytoLogin.OTPSendLoaded);$(".btn-div-nvgo a:first-of-type").click(function(){webTrendsObj.SendElementWTParams(WT_TytoLogin.OTPSendApproveClick)})}function QuickTytoOTPVerifyWT(){webTrendsObj.SendElementWTParams(WT_TytoLogin.OTPVerifyLoaded);$(".QuickContinue a:first-of-type").click(function(){webTrendsObj.SendElementWTParams(WT_TytoLogin.OTPVerifyApproveClick)});var n=$(".UserIdValidators").text().trim();n!=""&&webTrendsObj.SendElementWTParams(WT_TytoLogin.OTPVerifyFailed,["error_message",n])}function DayTwoLoginWT(){try{webTrendsObj.SendElementWTParams(WT_DayTwo.LoginPageLoaded);var n=$(".QuickRequiredMessage:visible").text();n.length>0&&webTrendsObj.SendElementWTParams(WT_DayTwo.LoginFailedContinueClick,["error_message",n]);$('[id$="btnLogin_lnkSubButton"]').click(function(){if(n.length>0){var t=parseInt($('[id$="userYearOfBirth"]').val()),i=(new Date).getFullYear();i-t<18&&webTrendsObj.SendElementWTParams(WT_DayTwo.LoginSuccessForClientAge18ContinueClick,["error_message","Login succeeded but the client is under the age of 18"])}})}catch(t){oLError("Error on WT_DataTytoAndDayTwo.js at DayTwoLoginWT(): ",t)}}function DayTwoOTPSendWT(){webTrendsObj.SendElementWTParams(WT_DayTwo.LoginSuccessContinueClick)}function DayTwoOTPVerifyWT(){}function DayTwoApproveWT(){var t=$(".lblDayTwoUnderAge:visible").text(),n;t!=""?webTrendsObj.SendElementWTParams(WT_DayTwo.LoginSuccessForClientAge18ContinueClick,["error_message",t]):webTrendsObj.SendElementWTParams(WT_DayTwo.TermOfServiceLoaded);n=$('[id$="cbDayTwo_lnkSubButton"]');n.length>0&&n.click(function(){webTrendsObj.SendElementWTParams(WT_DayTwo.TermsOfServiceContinueClick)})}function TermsOfUseContinueWT(){webTrendsObj.SendElementWTParams(WT_DayTwo.TermsOfUseContinueClick)}function TermOfUsePopupLoadedWT(){webTrendsObj.SendElementWTParams(WT_DayTwo.TermOfUseLoaded)}function QuickTytoOTPSendRunWT(){$(".daytwo-page-name").text()=="DayTwo"?DayTwoOTPSendWT():QuickTytoOTPSendWT()}function QuickTytoOTPVerifyRunWT(){$(".daytwo-page-name").text()=="DayTwo"?DayTwoOTPVerifyWT():QuickTytoOTPVerifyWT()}var WT_TytoLogin,WT_DayTwo;setBottomMenuPosition();$(document).ready(function(){try{$(".UserIdTxt").length>0&&($(".UserIdTxt").get(0).focus(),$(".UserIdTxt").keydown(function(n){inputClickSubmit(n)}));$(".UserYearOfBirthTxt").length>0&&$(".UserYearOfBirthTxt").keydown(function(n){inputClickSubmit(n)});SetFocusOnFirstError("a.online_blue_button:first",null);mobileAdapt();persistStorage()}catch(n){IsConsoleActive()&&console.log("error on QuickTytoPurchase load:",n)}});$(".btn-tooltip").click(function(){top.ShowHelpBoxTrans($(this).attr("id"),-23,2)});WT_TytoLogin={loginLoaded:{service:"tyto",action:"tyto purchase",stage:"login page loaded",status:"success"},loginContinueClick:{service:"tyto",action:"tyto purchase",stage:"click to login",status:"success",error_message:"none"},loginFailed:{service:"tyto",action:"tyto purchase",stage:"click to login",status:"failed"},OTPSendLoaded:{service:"tyto",action:"tyto purchase",stage:"approve to get otp page loaded",status:"success",error_message:"none"},OTPSendApproveClick:{service:"tyto",action:"tyto purchase",stage:"approve to get otp",status:"success",error_message:"none"},OTPVerifyLoaded:{service:"tyto",action:"tyto purchase",stage:"fill otp page loaded",status:"success",error_message:"none"},OTPVerifyApproveClick:{service:"tyto",action:"tyto purchase",stage:"click to verify otp",status:"success",error_message:"none"},OTPVerifyFailed:{service:"tyto",action:"tyto purchase",stage:"click to verify otp",status:"failed"}};WT_DayTwo={LoginPageLoaded:{service:"day two",action:"login page loaded",status:"success"},LoginSuccessForClientAge18ContinueClick:{service:"day two",action:"click to login",status:"failed"},LoginFailedContinueClick:{service:"day two",action:"click to login",status:"failed"},LoginSuccessContinueClick:{service:"day two",action:"click to login",status:"success",error_message:"none"},TermOfServiceLoaded:{service:"day two",action:"term of service loaded",status:"success",error_message:"none"},TermsOfServiceContinueClick:{service:"day two",action:"continue from terms of service",status:"success",error_message:"none"},TermOfUseLoaded:{service:"day two",action:"term of use loaded",status:"success",error_message:"none"},TermsOfUseContinueClick:{service:"day two",action:"continue from terms of use",status:"success",error_message:"none"}};$(document).ready(function(){try{var n=location.pathname;location.pathname!=n.replace("QuickTytoPurchase","")?TytoLoginWT():location.pathname!=n.replace("QuickTytoOTPSend","")?QuickTytoOTPSendRunWT():location.pathname!=n.replace("QuickTytoOTPVerify","")?QuickTytoOTPVerifyRunWT():location.pathname!=n.replace("NVGT/DayTwo","")?DayTwoLoginWT():location.pathname!=n.replace("ServicesDigital/DayTwo/DayTwo","")?DayTwoApproveWT():undefined}catch(t){oLError("Error on WT_DataTytoAndDayTwo.js at document ready: ",t)}})