function toggleButtonState(n){$(document).ready(function(){$("input[type=radio]").click(function(){"1"===$(this).attr("value")?$(n).prop("disabled",!0):$(n).prop("disabled",!1)})})}function pickADate(n,t,i){$(document).ready(function(){jQuery.extend(jQuery.validator.methods,{date:function(n,t){var r=window.chrome,u=navigator.userAgent.indexOf("Safari")>-1,i;return r||u?(i=new Date,this.optional(t)||!/Invalid|NaN/.test(new Date(i.toLocaleDateString(n)))):this.optional(t)||!/Invalid|NaN/.test(new Date(n))}}),$(".date").datepicker({showOn:"button",buttonImage:n,buttonImageOnly:!0,dateFormat:t,showOtherMonths:!0,selectOtherMonths:!0,showAnim:"fadeIn",changeYear:!0,yearRange:i,changeMonth:!0})})}function pickADate2(n,t,i){$(document).ready(function(){jQuery.extend(jQuery.validator.methods,{date:function(n,t){var r=window.chrome,u=navigator.userAgent.indexOf("Safari")>-1,i;return r||u?(i=new Date,this.optional(t)||!/Invalid|NaN/.test(new Date(i.toLocaleDateString(n)))):this.optional(t)||!/Invalid|NaN/.test(new Date(n))}}),$(".date").datepicker({showOn:"button",buttonImage:n,buttonImageOnly:!0,dateFormat:t,showOtherMonths:!0,selectOtherMonths:!0,showAnim:"fadeIn",minDate:0,maxDate:i})})}function pickAColor(n,t,i,r){$(document).ready(function(){$(n).spectrum({color:$(n)[0].value,showInput:!0,className:t,showInitial:!0,showPalette:!0,showSelectionPalette:!0,maxPaletteSize:i,preferredFormat:r,localStorageKey:"spectrum.demo",move:function(){},show:function(){},beforeShow:function(){this.color=$(n)[0].value},hide:function(){},change:function(t){$(n).val(t.toHexString())},palette:[["rgb(0, 0, 0)","rgb(67, 67, 67)","rgb(102, 102, 102)","rgb(204, 204, 204)","rgb(217, 217, 217)","rgb(255, 255, 255)"],["rgb(152, 0, 0)","rgb(255, 0, 0)","rgb(255, 153, 0)","rgb(255, 255, 0)","rgb(0, 255, 0)","rgb(0, 255, 255)","rgb(74, 134, 232)","rgb(0, 0, 255)","rgb(153, 0, 255)","rgb(255, 0, 255)"],["rgb(230, 184, 175)","rgb(244, 204, 204)","rgb(252, 229, 205)","rgb(255, 242, 204)","rgb(217, 234, 211)","rgb(208, 224, 227)","rgb(201, 218, 248)","rgb(207, 226, 243)","rgb(217, 210, 233)","rgb(234, 209, 220)","rgb(221, 126, 107)","rgb(234, 153, 153)","rgb(249, 203, 156)","rgb(255, 229, 153)","rgb(182, 215, 168)","rgb(162, 196, 201)","rgb(164, 194, 244)","rgb(159, 197, 232)","rgb(180, 167, 214)","rgb(213, 166, 189)","rgb(204, 65, 37)","rgb(224, 102, 102)","rgb(246, 178, 107)","rgb(255, 217, 102)","rgb(147, 196, 125)","rgb(118, 165, 175)","rgb(109, 158, 235)","rgb(111, 168, 220)","rgb(142, 124, 195)","rgb(194, 123, 160)","rgb(166, 28, 0)","rgb(204, 0, 0)","rgb(230, 145, 56)","rgb(241, 194, 50)","rgb(106, 168, 79)","rgb(69, 129, 142)","rgb(60, 120, 216)","rgb(61, 133, 198)","rgb(103, 78, 167)","rgb(166, 77, 121)","rgb(91, 15, 0)","rgb(102, 0, 0)","rgb(120, 63, 4)","rgb(127, 96, 0)","rgb(39, 78, 19)","rgb(12, 52, 61)","rgb(28, 69, 135)","rgb(7, 55, 99)","rgb(32, 18, 77)","rgb(76, 17, 48)"]]})})}function showStatement(){$(document).ready(function(){$("div.show-border").show()})}function hideStatement(){$("div.show-border").hide()}function populateStatementNamesForPortion(n,t,i){$(n).change(function(){var n=$(this).val();null!==n&&""!==n&&$.getJSON(i,{portion:n},function(n){var i=$(t);i.empty(),$.each(n,function(n,t){i.append($("<option/>",{value:t.value,text:t.text}))}),hideStatement()})})}function populateBPayFieldsFromBiller(n,t){$(n).change(function(){var i=$(n+" option:selected").text();null!==i&&"Select Existing Biller Details"!==i&&$.getJSON(t,{billerToPay:i},function(n){$("#BillerId").val(n.BillerId),$("#BillerCode").val(n.BillerCode),$("#BillerName").val(n.BillerName),$("#CustomerReferenceNumber").val(n.CustomerReferenceNumber),$("#BillNickName").val(n.BillNickName)})})}function populateAccountFieldsFromPayee(n,t){$(n).change(function(){var i=$(n+" option:selected").text();$.getJSON(t,{payeeToPay:i},function(n){$("#PayeeId").val(n.PayeeId),$("#AccountBSB").val(n.AccountBSB),$("#AccountNumber").val(n.AccountNumber),$("#AccountName").val(n.AccountName),$("#AccountSuffix").val(n.AccountSuffix),$("#NickName").val(n.NickName),$("#PayeeEmailAddress").val(n.PayeeEmailAddress),$("#SavePayee").prop("checked",n.SavePayee);var t=0!==n.PayeeId;setReadonlyState("#AccountBSB",t),setReadonlyState("#AccountNumber",t),setReadonlyState("#AccountName",t),setReadonlyState("#AccountSuffix",t),setReadonlyState("#NickName",t),setDisabledState("#SavePayee",t)})})}function populateNominatedAccountsForPortion(n,t,i){$(n).change(function(){var n=$(this).val();null!==n&&""!==n&&$.getJSON(i,{portion:n},function(n){var i=$(t);i.empty(),$.each(n,function(n,t){i.append($("<option/>",{value:t.value,text:t.text}))})})})}function googleAnalytics(n){!function(n,t,i,r,u,f,e){n.GoogleAnalyticsObject=u,n[u]=n[u]||function(){(n[u].q=n[u].q||[]).push(arguments)},n[u].l=1*new Date,f=t.createElement(i),e=t.getElementsByTagName(i)[0],f.async=1,f.src=r,e.parentNode.insertBefore(f,e)}(window,document,"script","//www.google-analytics.com/analytics.js","ga"),ga("create",n,"auto"),ga("send","pageview")}function setDisabledState(n,t){t===!0?$(n).attr("disabled","disabled"):$(n).removeAttr("disabled")}function setReadonlyState(n,t){t===!0?$(n).attr("readonly","readonly"):$(n).removeAttr("readonly")}function disableKeys(){$(function(){var n={8:":not(input:text, textarea, input:file, input:password)",13:"input:text, input:password",end:null};$(document).bind("keydown",function(t){var i=n[t.which];return void 0!==i&&$(t.target).is(i)&&t.preventDefault(),!0})})}function sendSecurityCode(n,t){return $(n).length?void $(function(){$(n).dialog({modal:!0,dialogClass:"no-close",title:"Send Security Code Option",width:450,buttons:[{text:"Cancel",click:function(){return $(this).dialog("close"),!1}}]})}):(window.location.href=t,!0)}function securityCodeSentDialog(n){$(n).length&&$(function(){$(n).dialog({modal:!0,dialogClass:"no-close",title:"Security Code Sent",buttons:[{text:"OK",click:function(){$(this).dialog("close")}}]})})}function securityCodeErrorDialog(n){$(n).length&&$(function(){$(n).dialog({modal:!0,dialogClass:"no-close",title:"*** Security Code Error ***",width:700,buttons:[{text:"OK",click:function(){$(this).dialog("close")}}]})})}