function isIOS(){var n=["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"];if(!navigator.platform)while(n.length)if(navigator.platform===n.pop())return!0;return!1}function polarToCartesian(n,t,i,r){var u=(r-90)*Math.PI/180;return{x:n+i*Math.cos(u),y:t+i*Math.sin(u)}}function describeArc(n,t,i,r,u){var f=polarToCartesian(n,t,i,u),e=polarToCartesian(n,t,i,r),o=u-r<=180?"0":"1";return["M",f.x,f.y,"A",i,i,0,o,0,e.x,e.y].join(" ")}function pulseSidebar(){$("#progress-icons").children().each(function(n){var t=$(this).css("opacity");t<1&&$(this).delay(80*n).fadeTo(400,1,function(){$(this).fadeTo(400,t)})})}function transitionCenterIcons(n){$("#middle-circle-icon").fadeOut(300,function(){$("#middle-circle-icon").attr("src",n).fadeIn(300)})}function changePercentage(n){var t=Math.round(180+n*1.8),i;if($("#green-arc").css("transform","rotate("+t+"deg)"),$("#green-arc").css("-ms-transform","rotate("+t+"deg)"),(isIE||isEdge)&&$("#green-arc").attr("transform","rotate("+t+" 100 100)"),$("#ie-progress-arc-green-bar").css("transform","rotate("+t+"deg)"),i=$("#outer-middle-circle-container").css("-webkit-transform")||$("#outer-middle-circle-container").css("-moz-transform")||$("#outer-middle-circle-container").css("-ms-transform")||$("#outer-middle-circle-container").css("-o-transform")||$("#outer-middle-circle-container").css("transform"),i!=="none"){var r=i.split("(")[1].split(")")[0].split(","),u=r[0],f=r[1];t=Math.round(Math.atan2(f,u)*(180/Math.PI))}else t=0;t!==90?($("#outer-middle-circle-container").css({transform:"rotate(-270deg)"}),$("#inner-middle-circle-container").css({transform:"rotate(270deg)"})):($("#outer-middle-circle-container").css({transform:"rotate(0deg)"}),$("#inner-middle-circle-container").css({transform:"rotate(-0deg)"}));$("#fallback-progress-bar").animate({width:n+"%"},300)}function initialisePageUI(n){var t,i,r;if($(".ajaxLoading").fadeOut(50),typeof n.percentage!="undefined"&&changePercentage(n.percentage),typeof n.sideIcon!="undefined"){for($(".prog-nav-flyout").remove(),hideNavFlyout(),t=1;t<=10;t++)if(t<=n.sideIcon){if(t>1){$("#Prog_bar_H").show();switch(t){case 2:$(".progress-step-"+t).removeClass("current-step").addClass("current-step");break;case 5:$(".progress-step-2").removeClass("current-step");$(".progress-step-"+t).removeClass("current-step").addClass("current-step");break;case 6:$(".progress-step-5").removeClass("current-step");$(".progress-step-"+t).removeClass("current-step").addClass("current-step");break;case 7:$(".progress-step-6").removeClass("current-step");$(".progress-step-"+t).removeClass("current-step").addClass("current-step");break;case 9:$(".progress-step-7").removeClass("current-step");$(".progress-step-"+t).removeClass("current-step").addClass("current-step");break;case 10:$(".progress-step-9").removeClass("current-step");$(".progress-step-"+t).removeClass("current-step").addClass("current-step")}}else $("#Prog_bar_H").hide(),$(".progress-step-2").removeClass("current-step"),$(".progress-step-5").removeClass("current-step"),$(".progress-step-6").removeClass("current-step"),$(".progress-step-7").removeClass("current-step"),$(".progress-step-9").removeClass("current-step"),$(".progress-step-10").removeClass("current-step"),hideNavFlyout();if($(".progress-step-"+t).css("opacity","1.0"),$(".progress-step-"+t).removeClass("achieved-step").addClass("achieved-step"),t>1&&t<n.sideIcon)switch(!0){case typeof n.applicationType!="undefined"&&t===4&&n.applicationType==="3":break;case t>4&&typeof n.pageHash!="undefined"&&(n.pageHash==="ConfirmationSuccess"||n.pageHash==="ConfirmationError"):break;default:$(".progress-icon.progress-step-"+t).addClass("active").off("click").on("click",function(){$(".progress-icon").removeClass("selectedNav");var n=$(this).hasClass("remove-selectedNav");n?$(this).removeClass("remove-selectedNav"):sideIconNavFlyout(!0,this)});i=n.isVOUser=="undefined"||n.isVOUser==null?!1:n.isVOUser=="True"?!0:!1;r=t===5&&n.applicationType==="3"?$(".progress-step-3").attr("data-onclick-address"):$(".progress-step-"+t).attr("data-onclick-address");$(".progress-step-"+t).append('<div class="prog-nav-flyout"><div class="nav-flyout-overlay"><div class="nav-flyout-inner"><p>Save the progress of your application to navigate to '+$(".progress-step-"+t).attr("title")+' page?<\/p><button class="btn rsa-button rsa-darkblue hide-NavFlyout" onclick="hideNavFlyout()">No<\/button><button class="btn rsa-button rsa-orange" onclick="sideIconNavigation(\''+r+"',"+i+')">Yes<\/button><\/div>')}}else $(".progress-step-"+t).css("opacity","0.3"),$(".progress-step-"+t).removeClass("active").off("click"),$(".progress-step-"+t).removeClass("achieved-step");pulseSidebar();n.sideIcon===10&&($(".progress-icon.progress-step-9").removeClass("active").off("click"),$(".progress-icon.progress-step-8").removeClass("active").off("click"),$(".progress-icon.progress-step-7").removeClass("active").off("click"),$(".progress-icon.progress-step-6").removeClass("active").off("click"),$(".progress-icon.progress-step-5").removeClass("active").off("click"),$(".progress-icon.progress-step-4").removeClass("active").off("click"),$(".progress-icon.progress-step-3").removeClass("active").off("click"),$(".progress-icon.progress-step-2").removeClass("active").off("click"))}typeof n.pageHash!="undefined"&&(window.location.hash!="#!/"+n.pageHash+"/"&&changeHash("!/"+n.pageHash+"/"),gtag("config","UA-120403230-1",{page_path:"/Application/index#!/"+n.pageHash+"/"}));typeof n.iconSrc!="undefined"&&transitionCenterIcons(n.iconSrc);typeof n.pageTitle!="undefined"&&(document.title=n.pageTitle+" - NDLS Online");$("input,select").change(function(){progressSaved=!1})}function sideIconNavFlyout(n,t){var i=$(t).attr("class"),r=$(t).attr("id");$(".prog-nav-flyout").fadeOut("fast");n&&($(this).addClass("selectedNav"),$("#"+r).addClass("selectedNav"),$(i+".prog-nav-flyout").fadeIn("fast"))}function hideNavFlyout(){$("#progress-icons .selectedNav").addClass("remove-selectedNav");$(".progress-icon").removeClass("selectedNav");$("#nav_overlay").removeClass("show-overlay")}function sideIconNavigation(n,t){var i;$(".progress-icon").removeClass("selectedNav");$(".progress-icon").removeClass("achieved-step");$("#nav_overlay").removeClass("show-overlay");$(".nav-flyout").fadeOut("fast");switch(n.toLowerCase()){case"personaldetails":t?window.location.href="VOPersonalDetails?isBack=true":(i="!/"+n+"/",changeHash(i,!1));break;default:window.location.hash!=="#!/"+n+"/"&&(i="!/"+n+"/",changeHash(i,!1))}}function postData(n,t,i,r){$(".ajaxLoading").fadeTo(50,.5);var u={url:n,type:"POST",contentType:"application/json; charset=utf-8",data:t,success:i};typeof r!="undefined"&&(u.headers={__RequestVerificationToken:antiForgeryToken});$.ajax(u).done(function(){$(".ajaxLoading").fadeOut(50)}).fail(function(n,t,i){$("#view-container").html("<h2>An error has occurred<\/h2><p>"+t+" - "+i+"<\/p>");$(".ajaxLoading").fadeOut(50)})}function ShowDialog(n,t,i,r){var u=BootstrapDialog.show({type:n,title:t,message:i,buttons:r,closeByBackdrop:!1,closeByKeyboard:!1})}function ShowDialogLogOutOnClose(n,t,i,r,u){var f=u=="undefined"||u==null?!1:u=="True"?!0:!1,e=BootstrapDialog.show({type:n,title:t,message:i,buttons:r,onhide:function(){progressSaved=!0;window.location.href=f?"/Application/VOIndex/":"/Account/LogOut/"}})}function RenderAlerts(n){var t='<div class="alert alert-dismissable alert-'+n.type+'"><a class="close" data-dismiss="alert" aria-label="close">×<\/a>'+n.message+"<\/div>";$("#alerts").html(t)}function saveApplication(){indicateSaveInProgress(!0);var n=window.location.hash;$.post("/Application/SaveApplication/",{stepName:n}).done(function(n){indicateSaveInProgress(!1);progressSaved=!0;n.isSuccess?ShowDialog(BootstrapDialog.TYPE_PRIMARY,"Application save","Successfully saved your application progress.",[{label:"OK",cssClass:"rsa-button rsa-orange",action:function(n){n.close();userSavedApplications=1}}]):ShowDialog(BootstrapDialog.TYPE_PRIMARY,"Application save","Could not save your application at this time.",[{label:"OK",cssClass:"rsa-button rsa-orange",action:function(n){n.close()}}])}).fail(function(){ShowDialog(BootstrapDialog.TYPE_PRIMARY,"Application save","Sorry, could not save your application at this time.",[{label:"OK",cssClass:"rsa-button rsa-orange",action:function(n){n.close()}}]);indicateSaveInProgress(!1)})}function indicateSaveInProgress(n){$("#saveProgressButton").attr("disabled",n);$("#saveProgressLink").attr("disabled",n);n?($(".save-spinning-loader").css("display","inline-block"),$("#saveProgressText").html("Saving progress..."),$("#saveProgressButtonText").html("Saving")):($(".save-spinning-loader").css("display","none"),$("#saveProgressButtonText").html("Save"),$("#saveProgressText").html("Save progress"))}function confirmLogoff(n){n?window.location.href="/Account/VOLogOut/":progressSaved?window.location.href="/Account/LogOut/":ShowDialog(BootstrapDialog.TYPE_PRIMARY,"Unsaved details:","Do you wish to save this application? If you do, you may restart your application within 20 days provided you are still eligible",[{label:"No, don't save",cssClass:"rsa-button rsa-blue",action:function(t){t.close();window.location.href=n?"/Account/VOLogOut/":"/Account/LogOut/"}},{label:"Yes, save",cssClass:"rsa-button rsa-orange",action:function(){var t=window.location.hash;progressSaved=!0;$.post("/Application/SaveApplication/",{stepName:t}).done(function(){window.location.href=n?"/Account/VOLogOut/":"/Account/LogOut/"})}}])}function navigateToMainMenu(n){$("#menuBoxCloseButton").click();n?window.location.href="/Application/VOIndex/":window.location.hash="!/MainMenu/"}function navigateToSavedApplication(n){if(n>0)$("#menuBoxCloseButton").click(),window.location.hash="!/RestartApplication/";else return!1}function toggleHamburgerMenuItems(){var n=window.location.href.toUpperCase();n.indexOf("PersonalDetails".toUpperCase())>=0?$(".togglemenuitem").hide():$(".togglemenuitem").show()}function navigateToPersonalDetails(){$("#menuBoxCloseButton").click();window.location.hash="!/PersonalDetails/"}function navigateHome(n){window.location.href=n?"/Application/VOIndex":"/Application/Index"}function isCapslock(n,t){const u=/Mac/.test(navigator.platform),i=n.charCode,r=n.shiftKey;i>=97&&i<=122?capsLock=r:i>=65&&i<=90&&!(r&&u)&&(capsLock=!r);capsLock?jQuery("#divCapsLock"+t).show():jQuery("#divCapsLock"+t).hide()}function setButtonAsLoading(n,t){if(t){var i=$('<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true" style="margin-right: 5px;"><\/span>');$("#"+n).prepend(i);$("#"+n).prop("disabled",!0)}else $("#"+n+" .spinner-border").remove(),$("#"+n).prop("disabled",!1)}var globalProgressArcAngle=270,isIE=/*@cc_on!@*/!1||!!document.documentMode,isEdge=!isIE&&!!window.StyleMedia,progressSaved;window.onload=function(){document.getElementById("grey-arc").setAttribute("d",describeArc(100,100,90,270,90));document.getElementById("green-arc").setAttribute("d",describeArc(100,100,90,270,90));isIE&&$("#green-arc").attr("transform","rotate(180 100 100)")};$(document).ready(function(){$("#nav_overlay").on("click",function(){$(this).removeClass("show-overlay");$(".progress-icon").removeClass("selectedNav")});$(".progress-label").on("click",function(){$(".progress-icon").removeClass("selectedNav");$(this).parent().toggleClass("selectedNav")})});progressSaved=!1;$(window).resize(function(){$('[data-toggle="popover"]').popover("hide").blur()});$(document).mouseup(function(){$("#Bar").hasClass("show")&&$(".collapse").collapse("hide")})