function stringDateToDOB(n){if(n.match(/\d{8}/)){var t=new Date(parseInt(n.substr(0,4))-1900,parseInt(n.substr(4,2))-1,n.substr(6,2));return kendo.toString(t,"dd MMM yyyy")}return"-"}function toDOB(n){var t=dateRegExp.exec(n);return(t&&(t=parseInt(t[1])),!t)?"-":(t=new Date(t),kendo.toString(new Date(t.getTime()+(t.getTimezoneOffset()+660)*6e4),"dd MMM yyyy"))}function toDate(n){var t=dateRegExp.exec(n);return(t&&(t=parseInt(t[1])),!t)?"":(t=new Date(t),kendo.toString(new Date(t.getTime()+(t.getTimezoneOffset()+660)*6e4),"dd/MM/yyyy"))}function toDateOrNA(n){var t=dateRegExp.exec(n);return(t&&(t=parseInt(t[1])),!t)?" &nbsp; &nbsp; n/a":(t=new Date(t),kendo.toString(new Date(t.getTime()+(t.getTimezoneOffset()+660)*6e4),"dd/MM/yyyy"))}function toUnits(n){return n?kendo.toString(n,"#,##0.0000"):""}function toUnitPrice(n){return n?kendo.toString(n,"$#,##0.0000"):""}function toCurrency(n){return n?kendo.toString(n,"C"):"$0.00"}function toCurrencyOrNA(n){return n?kendo.toString(n,"C"):"n/a &nbsp; &nbsp;"}function handleAjaxError(n,t,i){return i&&($("body").append(n.responseText),typeof i.Message!="undefined"?$("body").append(i.message):$("body").append(i)),n.responseText.length>2?phoenix.showMessage("Error",n.responseText):typeof i!="undefined"&&phoenix.showMessage("Error",i),!1}function Phoenix(){this.disallowedpasswordsymbols="<>";this.message=null;this.modalIsOpen=!1;this.commonReady=function(){var n=$("input[type=text]").filter(":visible:enabled:first");n&&n.focus()};this.GetAntiForgeryQueryString=function(){return"?__RequestVerificationToken="+$("input[name=__RequestVerificationToken]").val()};this.GetAntiForgeryPostData=function(){return"&__RequestVerificationToken="+$("input[name=__RequestVerificationToken]").val()};this.track=function(n){var t=s_gi(s_account);t.eVar21=t.prop21=n;t.linkTrackVars="prop21,eVar21,events";t.linkTrackEvents="event5";t.events="event5";t.tl(!0,"o","Button/Link Usage");this.trackSitecore("Button - Link Usage",{data:n,dataKey:"buttonName",xEvent:"event5"});t.linkTrackEvents="None";t.linkTrackVars="";t.eVar21=t.prop21="";t.events=""};this.trackFile=function(n,t){var i=s_gi(s_account);i.eVar21=i.prop21=n;i.eVar4=i.prop20=t;i.linkTrackVars="prop20,prop21,eVar4,eVar21,events";i.linkTrackEvents="event5";i.events="event5";i.tl(!0,"d",n);this.trackSitecore(n,{data:t,dataKey:"buttonParameter",xEvent:"event5"});i.linkTrackEvents="None";i.linkTrackVars="";i.eVar21=i.prop21="";i.eVar4=i.prop20="";i.events=""};this.trackSitecore=function(n,t){SCBeacon&&SCBeacon.trackGoal?SCBeacon.trackGoal(n,t):console.error("FXM failed to load. No SCBeacon found")};this.ajaxGet=function(n){return n.type="GET",n.data=null,n.cache=!1,n.error==null&&(n.error=handleAjaxError),$.ajax(n),!1};this.ajaxForm=function(n,t){t.type="POST";t.cache=!1;t.error==null&&(t.error=handleAjaxError);$(n).ajaxForm(t)};this.getJson=function(n,t,i){$.getJSON(n,t,i)};this.ajaxSubmitAndShowWait=function(n,t){t.type="POST";t.cache=!1;t.error==null&&(t.error=handleAjaxError);$(n).ajaxSubmit(t)};this.ajaxPost=function(n){n.type="POST";n.cache=!1;n.error==null&&(n.error=handleAjaxError);$.ajax(n)};this.ajaxPostAndShowWait=function(n){n.type="POST";n.cache=!1;n.error==null&&(n.error=handleAjaxError);this.ajaxPost(n)};this.redirect=function(n){window.location.href=n};this.download=function(n){navigator.userAgent.match(/iPad/i)?window.open(n,"NewDownloadWindow"):window.location.href=n};this.setJavaScript=function(n){$("#message").html(n)};this.queryStrings=function(){for(var t={},i=location.search.substring(1),r=/([^&=]+)=([^&]*)/g,n;n=r.exec(i);)t[decodeURIComponent(n[1])]=decodeURIComponent(n[2]);return t};this.handleAjaxError=function(n,t,i){return i&&($("body").append(n.responseText),$("body").append(i.message)),n.statusText.length>2&&alert(n.statusText),!1};this.showMessage=function(n,t){$(".k-window").remove();$(document.body).append('<div style="display: none;"><div id="message"><\/div><\/div>');n&&(t="<h2>"+n+"<\/h2>"+t);$("#message").html(t);this.message=$("#message").kendoWindow({actions:["Close"],draggable:!1,resizable:!1,modal:!0,title:"",width:540,height:"auto",activate:function(){$(".k-default").select()}}).data("kendoWindow");this.message.center();this.message.open();var i=this.message;return $(".k-overlay").show().click(function(){i.close()}),!1};this.showModalAction=function(n){return $(".k-window").remove(),$(document.body).append('<div style="display: none;"><div id="message"><\/div><\/div>'),$("#message").html(n),this.message=$("#message").kendoWindow({actions:[""],draggable:!1,resizable:!1,modal:!0,title:"",width:540,height:"auto"}).data("kendoWindow"),this.message.center(),this.message.open(),$(".k-overlay").show(),!1};this.showModalSurveyAction=function(n){return $(".k-window").remove(),$(document.body).append('<div style="display: none;"><div id="message"><\/div><\/div>'),$("#message").html(n),this.message=$("#message").kendoWindow({actions:[""],draggable:!1,resizable:!1,modal:!0,title:"",width:800,height:"auto"}).data("kendoWindow"),this.message.center(),this.message.open(),$(".k-overlay").show(),!1};this.showModal=function(n){return $(".k-window").remove(),$(document.body).append('<div style="display: none;"><div id="message"><\/div><\/div>'),$("#message").html(n),this.message=$("#message").kendoWindow({actions:["Close"],draggable:!1,modal:!0,resizable:!1,width:540,height:"auto",title:""}).data("kendoWindow"),this.message.center(),this.message.open(),$(".k-overlay").show(),!1};this.showWait=function(n){$(".k-window").remove();$(document.body).append('<div style="display: none;"><div id="message"><\/div><p>hi<\/div>');$("#message").html('<h2 style="text-align: center;">'+(n||"Please wait")+'&hellip;<\/h2><p style="text-align: center;"><img src="/static/img/loading.gif" width=54 height=55 /><\/p>');this.message=$("#message").kendoWindow({actions:[],draggable:!1,modal:!0,resizable:!1,height:"auto",width:300,title:""}).data("kendoWindow");this.message.center();this.message.open();$(".k-overlay").show()};this.closeMessage=function(){this.message!=null&&(this.message.close(),delete this.message)};this.bindDatePickers=function(){$("#datesFrom, #datesTo").kendoDatePicker({min:new Date(1990,11,1),max:new Date(2020,12,31),format:"dd/MM/yyyy"});$("#monthFrom, #monthTo").kendoDatePicker({min:new Date(1990,11,1),max:new Date(2020,12,31),start:"year",depth:"year",format:"MMM yyyy",parseFormats:["MMM yyyy"],readonly:!0})};this.bindDropDowns=function(){$(".dropdownlist").kendoDropDownList()};this.bindExpandCollapseToggler=function(){$(".expand").click(function(){$(this).next().is(":hidden")!=!0?($(this).removeClass("active"),$(this).next().slideUp(500)):($(".expand").removeClass("active"),$(".collapse").slideUp(500),$(this).next().is(":hidden")==!0&&($(this).addClass("active"),$(this).next().slideDown(500)))});$(".collapse").hide();$(".expall").click(function(){$(".collall").removeClass("close");$(".expall").addClass("open");$(".expand").next().slideDown(500);$(".expand").addClass("active")});$(".collall").click(function(){$(".collall").addClass("close");$(".expall").removeClass("open");$(".expand").next().slideUp(500);$(".expand").removeClass("active")})}}var dateRegExp=/^\/Date\((.*?)\)\/$/,alertFallback=!0,phoenix;(typeof console=="undefined"||typeof console.log=="undefined")&&(console={},console.log=alertFallback?function(){}:function(){});phoenix=new Phoenix;$(document).ready(function(){if($("#utility-head ul a, .menu ul a").each(function(){$(this).focus(function(){var n=$(this).closest("ul").parent();$(n).addClass("hover")});$(this).blur(function(){var n=$(this).closest("ul").parent();$(n).removeClass("hover");$(this).removeClass("hover")})}),$.browser.msie&&parseInt($.browser.version,10)<8){var n=1e3;$("div, .menu li").each(function(){$(this).css("zIndex",n);n-=10})}$(".clientProfile td strong span, .inlineTooltip, .cmBalanceTooltip").each(function(){var n=$(this),t=n.html(),i=n.attr("title");n.attr("title","");n.tooltip({delay:500,showURL:!1,fade:250,top:10,left:10,bodyHandler:function(){return t+'<div class="tooltipContent">'+i+"<\/div>"}})});phoenix.commonReady();$(".my-account a").on("click",function(n){if(this.href.substr(-1)==="#")return n.preventDefault(),!1});$("#changePasswordLink").on("click",function(){var n={};return n.__RequestVerificationToken=$("input[name=__RequestVerificationToken]").val(),phoenix.ajaxGet({url:"/Login/ChangePassword",headers:n,success:function(n){phoenix.showMessage("",n)},error:function(){phoenix.showMessage("Cannot change password","Sorry, you cannot change your password at this time. ")}}),!1});$(".printTop").on("click",function(){return window.print(),!1});$(".bgCover").css("z-index",0)});var ClientIndex={grid:null,dataSource:null,getAnnuityUri:function(){return"/Secure/Client/GetAnnuitySummary/?includeClosedAccounts="+$("#includeClosedAccounts").is(":checked")},getManagedFundUri:function(){return"/Secure/Client/GetManagedFundSummary/?includeClosedAccounts="+$("#includeClosedAccounts").is(":checked")},summaryTabChange:function(n){n.item.id=="tabAnnuities"?$("#managedFundPanel").slideUp(250,function(){$("#annuityPanel").slideDown(400)}):$("#annuityPanel").slideUp(250,function(){$("#managedFundPanel").slideDown(400)})},openConditionsOfUse:function(){window.open("/Secure/Client/ConditionsOfUse","Print","toolbars=no,menubar=no,location=no,scrollbars=yes,resizable=yes,status=no,height=600,width=800")},UpdateSurveyLinkCookie:function(n,t,i,r,u){var f=new Date,e,o;f.setTime(f.getTime()+i*864e5);u==1?(document.cookie=n+"=; expires=Fri, 31 Dec 1999 23:59:59 GMT;path=/;",e=n+"="+t+";expires="+f.toUTCString()+";path=/;"):(document.cookie=n+"=; expires=Fri, 31 Dec 1999 23:59:59 GMT;path=/;secure",e=n+"="+t+";expires="+f.toUTCString()+";path=/;secure");document.cookie=e;r&&(o=window.open(r,"_blank"),o!==null&&o.focus());phoenix.redirect("/secure/Client/")},init:function(){$(".tabstrip").kendoTabStrip();$("#includeClosedAccounts").is(":checked")?$("#leftSidebar").addClass("showAllAccounts").removeClass("showActiveAccounts"):$("#leftSidebar").addClass("showActiveAccounts").removeClass("showAllAccounts");$("#SummaryOfInvestmentsTabStrip").kendoTabStrip({select:ClientIndex.summaryTabChange});ClientIndex.dataSourceAnnuity=new kendo.data.DataSource({transport:{read:{url:ClientIndex.getAnnuityUri(),datatype:"JSON"},type:"JSON"},schema:{data:function(n){return n==null?0:n.Result||n},total:function(n){var t=0;return n&&(t=n.PageSize||n.length||0),t==0?$("#noAnnutiyAccounts").show():($("#noAnnutiyAccounts").hide(),t>ClientIndex.resultsPerPage?$(".k-grid-pager").show():$(".k-grid-pager").hide()),t}},change:function(n){console.log("dataSource change ",n)},serverPaging:!1,serverSorting:!1,pageSize:ClientIndex.resultsPerPage});ClientIndex.grid=$("#annuityGrid").kendoGrid({dataSource:ClientIndex.dataSourceAnnuity,autobind:!1,height:"auto",pageable:!1,sortable:{mode:"single",allowUnsort:!1},scrollable:!1,rowTemplate:kendo.template($("#annuityRowTemplate").html()),columns:[{title:"Product",field:"ProductName"},{title:"Account",field:"AccountNo"},{title:"Maturity&nbsp;date",field:"MaturityDate"},{title:"Next&nbsp;payment",field:"NextPaymentAmount"},{title:"Date",field:"NextPaymentOrClosedDate"}]});ClientIndex.dataSourceManagedFund=new kendo.data.DataSource({transport:{read:{url:ClientIndex.getManagedFundUri(),datatype:"JSON"},type:"JSON"},schema:{data:function(n){return n==null?0:n.Result||n},total:function(n){var t=0;return n&&(t=n.PageSize||n.length||0),t==0?$("#noManagedFundAccounts").show():$("#noManagedFundAccounts").hide(),t}},change:function(n){console.log("dataSource change ",n)},serverPaging:!1,serverSorting:!1,pageSize:ClientIndex.resultsPerPage});ClientIndex.grid=$("#managedFundGrid").kendoGrid({dataSource:ClientIndex.dataSourceManagedFund,autobind:!1,height:"auto",pageable:!1,sortable:{mode:"single",allowUnsort:!1},scrollable:!1,rowTemplate:kendo.template($("#managedFundRowTemplate").html()),columns:[{title:"Product",field:"ProductName"},{title:"Account",field:"AccountNo"},{title:"Unit&nbsp;price",field:"UnitPrice"},{title:"Units",field:"Units"},{title:"Balance",field:"FundsUnderManagement"}],dataBound:function(){$(".cmBalanceTooltip").each(function(){var n=$(this),t=n.html(),i;t&&(i=n.attr("title"),n.attr("title",""),n.tooltip({delay:500,showURL:!1,fade:250,top:10,left:10,bodyHandler:function(){return t+'<div class="tooltipContent">'+i+"<\/div>"}}))})}});$("#annuityGrid thead tr th").each(function(n){$(this).bind("click",function(){$("#annuityGrid thead tr th a").each(function(){$(this).removeClass("active")});$(this).children("a").addClass("active")}).children("a").bind("mouseover",function(){$(this).addClass("hover")}).bind("mouseout",function(){$(this).removeClass("hover")});n==1?$(this).children("a").addClass("active"):n==3&&$(this).addClass("txtright")});$("#managedFundGrid thead tr th").each(function(n){$(this).bind("click",function(){$("#managedFundGrid thead tr th a").each(function(){$(this).removeClass("active")});$(this).children("a").addClass("active")}).children("a").bind("mouseover",function(){$(this).addClass("hover")}).bind("mouseout",function(){$(this).removeClass("hover")});n==1?$(this).children("a").addClass("active"):n>=2&&$(this).addClass("txtright")});$(".k-grid-pager").hide();$("#includeClosedAccounts").on("change",function(){$("#includeClosedAccounts").is(":checked")?$("#leftSidebar").addClass("showAllAccounts").removeClass("showActiveAccounts"):$("#leftSidebar").addClass("showActiveAccounts").removeClass("showAllAccounts");ClientIndex.dataSourceAnnuity.options.transport.read.url=ClientIndex.getAnnuityUri();ClientIndex.dataSourceAnnuity.read();ClientIndex.dataSourceManagedFund.options.transport.read.url=ClientIndex.getManagedFundUri();ClientIndex.dataSourceManagedFund.read()});$(".maturityInstructionsBtn").click(function(n){return n.preventDefault(),document.location="/Secure/Maturity/Index/"+$(this).attr("investmentoptionid"),!1})}},ClientNavigator={accountId:null,investorId:null,init:function(){$(".commutationLink").on("click",function(n){var t,i;return n.preventDefault(),t=$(this).attr("accountId"),ClientNavigator.accountId=t.value,i="/secure/account/CalculateCommutation/?accountId="+ClientNavigator.accountId,phoenix.ajaxGet({url:i,success:function(n){phoenix.showMessage("Calculated commutation value",n);ClientNavigator.bindButtons()}}),!1});$(".centrelinkScheduleRequest").on("click",function(n){n.preventDefault();phoenix.showWait("Requesting Centrelink schedule");return phoenix.ajaxGet({url:"/secure/account/GenerateCentrelinkSchedule/",success:function(n){phoenix.showMessage("Centrelink schedule requested",n)},error:function(){phoenix.showMessage("Centrelink schedule not requested","Due to a system issue your request to generate Centrelink schedule could not be completed. Try again later or contact Investor Services. ")}}),!1})},bindButtons:function(){$("#createCommutationLetter").on("click",function(){var n="/secure/account/GenerateCommutationLetter/?accountId="+ClientNavigator.accountId;phoenix.ajaxGet({url:n,success:function(n){phoenix.closeMessage();phoenix.showModal(n)}})})}},transactionListRendered=!1,AccountIndex={TransactionsPerPage:20,init:function(n){phoenix.bindExpandCollapseToggler();$("#showFullTransactionList").bind("click",function(){return $("#transactionHeader").html("Full transaction list"),transactionListRendered?$("#recentTransactionPanel").slideUp(750,function(){$("#fullTransactionPanel").slideDown(1e3,function(){$("#fullTransactionPanel .k-icon").css("top","-3px")})}):(transactionListRendered=!0,$("#recentTransactionPanel").slideUp(750),$("#transactsionsLoading").slideDown(500),$.ajax({url:"/secure/Account/TransactionList/"+n,success:function(n){$("#transactionGrid").kendoGrid({dataSource:{schema:{model:AccountIndex.transactionModel},data:n,pageSize:AccountIndex.TransactionsPerPage},autobind:!1,height:"auto",pageable:!0,pageSize:AccountIndex.TransactionsPerPage,sortable:{mode:"single",allowUnsort:!1},serverPaging:!1,serverFiltering:!1,scrollable:!1,rowTemplate:kendo.template($("#transactionRowTemplate").html()),schema:{model:AccountIndex.transactionModel}});n.length>AccountIndex.TransactionsPerPage?$(".k-grid-pager").show():$(".k-grid-pager").hide();$("#transactionGrid thead tr th").each(function(n){$(this).bind("click",function(){$("#transactionGrid thead tr th a").each(function(){$(this).removeClass("active")});$(this).children("a").addClass("active")}).children("a").bind("mouseover",function(){$(this).addClass("hover")}).bind("mouseout",function(){$(this).removeClass("hover")});n==0&&$(this).children("a").addClass("active").html('Date<span class="k-icon k-arrow-down"><\/span>')});$("#transactsionsLoading").slideUp(500);$("#fullTransactionPanel").slideDown(1e3,function(){$("#fullTransactionPanel .k-icon").css("top","-3px")})}})),!1});$("#hideFullTransactionList").bind("click",function(){return $("#transactionHeader").html("Recent transactions"),$("#fullTransactionPanel").slideUp(1e3,function(){$("#recentTransactionPanel").slideDown(500)}),!1});$(".transactionListDownloadToExcel").bind("click",function(){return document.location="/secure/Download/TransactionListDownload/"+n,!1})},transactionModel:kendo.data.Model.define({fields:{BankingDate:{type:"date"},TransactionDescription:{type:"string"},GrossAmount:{type:"number"},TaxAmount:{type:"number"},NetAmount:{type:"number"},UnitPrice:{type:"number"},Units:{type:"number"}}})},ReportStatementAndCorrespondenceSearch={grid:null,dataSource:null,resultsPerPage:20,currentSearchTerm:"",searchModel:kendo.data.Model.define({id:"AccountId",fields:{DocumentID:{type:"integer"},Date:{type:"date"},AccountId:{type:"integer"},AccountName:{type:"string"},Product:{type:"string"},Type:{type:"string"}}}),getSearchUri:function(){var n=$("#accountNumber").val(),t=$("#datesFrom").val(),i=$("#datesTo").val();return"/secure/report/performstatementsearch/?searchAccountNumber="+n+"&dateFrom="+t+"&dateTo="+i},validateSearchParams:function(){var n=$("#datesFrom").data("kendoDatePicker").value(),t=$("#datesTo").data("kendoDatePicker").value();return n==null||t==null?(phoenix.showMessage("Invalid date","Please ensure the dates you have entered are valid"),!1):(n.setHours(0,0,0,0),t.setHours(0,0,0,0),n>t)?(phoenix.showMessage("Invalid date range","Please ensure the <b>From<\/b> date is before the <b>To<\/b> date"),!1):!0},init:function(){ReportStatementAndCorrespondenceSearch.dataSource=new kendo.data.DataSource({transport:{read:{url:this.getSearchUri(),datatype:"JSON"},type:"JSON"},parameterMap:function(n){return{page:n.page,pageSize:n.pageSize,skip:n.skip,take:n.take,filter:JSON.stringify(n.filter)}},schema:{model:this.searchModel,data:function(n){return n==null?0:n.Result||n},total:function(n){$("#searchError").hide();var t=0;return n&&(t=n.PageSize||n.length||0),t==0?($("#noResults").show(),$("#totalResults").html("")):($("#noResults").hide(),$("#totalResults").html("Results: "+t),t>ReportStatementAndCorrespondenceSearch.resultsPerPage?$(".k-grid-pager").show():$(".k-grid-pager").hide()),t}},error:function(){$(".k-grid-pager").hide();$("#noResults").hide();$("#searchError").show()},serverPaging:!1,serverSorting:!1,pageSize:ReportStatementAndCorrespondenceSearch.resultsPerPage});ReportStatementAndCorrespondenceSearch.grid=$("#searchGrid").kendoGrid({dataSource:ReportStatementAndCorrespondenceSearch.dataSource,autobind:!1,height:"auto",pageable:!0,pageSize:ReportStatementAndCorrespondenceSearch.resultsPerPage,sortable:{mode:"single",allowUnsort:!1},serverPaging:!1,serverFiltering:!1,scrollable:!1,rowTemplate:kendo.template($("#rowTemplate").html()),schema:{model:ReportStatementAndCorrespondenceSearch.searchModel},columns:[{title:"&nbsp;",field:null,sortable:"false",width:4},{title:"Date",field:"Date",width:60},{title:"Acc&nbsp;#",field:"AccountId",width:60},{title:"Account&nbsp;name",field:"AccountName",width:200},{title:"Product",field:"Product",width:195},{title:"Type",field:"Type",width:130}],dataBound:function(){$(".downloadLink").on("click",function(n){navigator.userAgent.match(/iPad/i)&&(n.preventDefault(),window.open($(this).attr("href"),"NewDownloadWindow"))})}});$("#searchGrid thead tr th").each(function(n){n==0?$(this).attr("data-field",null).html("").unbind("click"):$(this).bind("click",function(){$("#searchGrid thead tr th a").each(function(){$(this).removeClass("active")});$(this).children("a").addClass("active")}).children("a").bind("mouseover",function(){$(this).addClass("hover")}).bind("mouseout",function(){$(this).removeClass("hover")});n==1?$(this).children("a").addClass("active"):n==6&&$(this).addClass("lastcol")});$("#searchButton").click(function(){ReportStatementAndCorrespondenceSearch.validateSearchParams()&&(ReportStatementAndCorrespondenceSearch.grid==null&&(ReportStatementAndCorrespondenceSearch.grid=$("#searchGrid").data('"kendoGrid')),ReportStatementAndCorrespondenceSearch.dataSource.options.transport.read.url=ReportStatementAndCorrespondenceSearch.getSearchUri(),ReportStatementAndCorrespondenceSearch.dataSource.read(),$(".k-grid-pager ul li:first a").trigger("click"),console.log(ReportStatementAndCorrespondenceSearch.dataSource.view()))});$("#ReportStatementsHelp").tooltip({delay:0,showURL:!1,fade:250,top:10,left:10,bodyHandler:function(){return $("#ReportStatementsHelpTooltip").html()}});phoenix.bindDatePickers();phoenix.bindDropDowns()}},UpdatePassword={validate:function(){var f=$("#oldPassword"),s=$("#oldPasswordValidation"),t=$("#newPassword1"),i=$("#newPassword1Validation"),u=$("#newPassword"),e=$("#newPasswordValidation"),h=f.val(),r=t.val(),c=u.val(),n,o;return f.removeClass(),s.removeClass().attr("title",""),t.removeClass(),i.removeClass().attr("title",""),u.removeClass(),e.removeClass().attr("title",""),n=0,h==""&&(f.addClass("formFieldError"),s.addClass("formErrorIcon").attr("title","Please enter your current password or call 1800 621 009."),n++),h==r&&(t.addClass("formFieldError"),i.addClass("formErrorIcon").attr("title","Your new password must be different to the current password."),n++),r.length<8&&(t.addClass("formFieldError"),i.addClass("formErrorIcon").attr("title","Your new password must be 8 or more characters."),n++),o=0,$.each([/\d/,/[A-Z]/,/[a-z]/,new RegExp("[^\\dA-Za-z"+phoenix.disallowedpasswordsymbols+"]")],function(n,t){(r.match(t)||[]).length>0&&o++}),o<3&&(t.addClass("formFieldError"),i.addClass("formErrorIcon").attr("title","New password must contain at least one uppercase letter, one lowercase letter and one number or symbol."),n++),new RegExp("["+phoenix.disallowedpasswordsymbols+"]").test(r)&&(t.addClass("formFieldError"),i.addClass("formErrorIcon").attr("title","New password contains invalid characters."),n++),n==0&&(t.addClass("formFieldSuccess"),i.addClass("formSuccessIcon")),r!=c&&(u.addClass("formFieldError"),e.addClass("formErrorIcon").attr("title","Please ensure your passwords match."),n++),n==0&&(u.addClass("formFieldSuccess"),e.addClass("formSuccessIcon")),n==0},update:function(){var t,n;UpdatePassword.validate()&&(t="oldPassword="+encodeURIComponent($("#oldPassword").val())+"&newPassword="+encodeURIComponent($("#newPassword").val()),$("#message").html('<h2 style="text-align: center;">Updating password&hellip;<\/h2><p style="text-align: center;"><img src="/static/img/loading.gif" width=54 height=55 /><\/p>'),$(".k-window").css("height","auto"),n={},n.__RequestVerificationToken=$("input[name=__RequestVerificationToken]").val(),$.ajax({url:"/Secure/Login/ChangePassword",headers:n,type:"POST",data:t,success:function(n){$("#message").html(n)},error:function(n,t,i){phoenix.showMessage("Error",i)}}));phoenix.track("PasswordChange")},init:function(){$("#oldPassword").focus();$("#changePasswordBack").unbind("click").on("click",function(){$.ajax({url:"/Secure/Login/ChangePassword",type:"GET",success:function(n){$("#message").html(n)},error:function(n,t,i){phoenix.showMessage("Error",i)}})});$("#changePasswordSubmit").unbind("click").on("click",function(){UpdatePassword.update()});$("#oldPassword").keyup(UpdatePassword.validate);$("#newPassword1").keyup(UpdatePassword.validate);$("#newPassword").keyup(UpdatePassword.validate);$("#changePassword").keypress(function(n){if(n.which==13)return $("#changePasswordSubmit").click(),!1})}},MaturityIndex={currentPanel:"",currentWithdrawPanel:"",accountInvestmentOptionId:"",init:function(n,t){MaturityIndex.accountInvestmentOptionId=n;$("input[name=MaturityInstruction]").change(function(){var t=$(this).attr("value"),n=$("#"+t+"OptionPanel");if(MaturityIndex.currentPanel){if(MaturityIndex.currentPanel.attr("id")==n.attr("id"))return;MaturityIndex.currentPanel.slideUp(500,function(){n.slideDown(500)})}else n.slideDown(500);t=="Reinvest"&&$("#ReinvestmentYearsField").focus();MaturityIndex.currentPanel=n});$(".maturityOptionRow").click(function(){var n=$(this).attr("maturityoptionid");$("#"+n+":enabled").attr("checked","checked").change()});$("input[name=WithdrawType]").change(function(){var t=$(this).attr("value"),n=$("#WithdrawType"+t+"Panel");MaturityIndex.currentWithdrawPanel?MaturityIndex.currentWithdrawPanel.slideUp(500,function(){n.slideDown(500)}):n.slideDown(500);MaturityIndex.currentWithdrawPanel=n});$("#ReinvestSelectYearsPanelConfirm").click(function(){var i=$("#ReinvestmentYearsField"),n=i.val(),u,r;if(n=n.replace(/[^\d]/,""),$("#ReinvestmentYearsField").val(n),n=n==""?0:parseInt(n,10),n<1||n>t){i.addClass("formFieldError");$("#ReinvestmentYearsFieldValidation").show();$("#ReinvestmentYearsField").focus().select();return}i.removeClass("formFieldError");$("#ReinvestmentYearsFieldValidation").hide();$("input[name=MaturityInstruction]").attr("disabled","disabled");$("#ReinvestSelectYearsPanel").slideUp(500);$("#ReinvestCalculatingQuotePanel").slideDown(250);u="accountInvestmentOptionId="+MaturityIndex.accountInvestmentOptionId+"&reinvestmentYears="+n;r={};r.__RequestVerificationToken=$("input[name=__RequestVerificationToken]").val();$.ajax({url:"/Secure/Maturity/GetReinvestmentQuote",headers:r,type:"POST",data:u,success:function(n){$("#ReinvestCalculatingQuotePanel").slideUp(250,function(){$("#ReinvestConfirmPanel").html(n).slideDown(500)})},error:function(){phoenix.showMessage("Cannot get reinvestment quote","Sorry, you cannot get reinvestment quote at this time.  Please call Investor Services.");$("input[name=MaturityInstruction]").removeAttr("disabled");$("#ReinvestConfirmPanel").slideUp(500,function(){$("#ReinvestSelectYearsPanel").slideDown(500)})}})})},bindReinvesmentQuoteButtons:function(){$("#ReinvestConfirmPanelChange").click(function(){$("input[name=MaturityInstruction]").removeAttr("disabled");$("#ReinvestConfirmPanel").slideUp(500,function(){$("#ReinvestSelectYearsPanel").slideDown(500)})});$("#RateInformationLightbox").click(function(n){return n.preventDefault(),phoenix.showMessage(this.innerHTML,$("#RateInformationLightboxContent").html()),$(".RateInformationLightboxClose").click(function(){phoenix.closeMessage()}),!1})}};$(document).ready(function(){Modernizr.borderradius||($('<div class="atr"><\/div><div class="atl"><\/div><div class="abl"><\/div><div class="abr"><\/div>').appendTo(".wrapperfull, .wrapperthirds"),$('<div class="bbl"><\/div><div class="bbr"><\/div>').appendTo("#utility-head"),$('<div class="ctr"><\/div><div class="ctl"><\/div><div class="cbl"><\/div><div class="cbr"><\/div>').appendTo(".innerPanelLight, .innerPanelSmall"),$('<div class="dtr"><\/div><div class="dtl"><\/div><div class="dbl"><\/div><div class="dbr"><\/div>').appendTo("h3.expand"),$('<div class="tl"><\/div><div class="tr"><\/div><div class="bl"><\/div><div class="br"><\/div>').appendTo("ul.clientopen, li.primary, li.primaryFull, li.primary a.active"),$('<div class="tl"><\/div><div class="tr">').appendTo("ul.hasSub"))})