function escapeRegExp(n){return n.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1")}function replaceAll(n,t,i){return n===null&&(n=""),n.replace(new RegExp(escapeRegExp(t),"g"),i)}function createNavigation(){var i=function(){var n=$(this).parent(),t=n.siblings();return t.size()>0?(n.toggleClass("active"),t.slideToggle(),!1):!1},n,t;$("ul.navigation > li").mouseenter(function(){var n=$(this);n.addClass("hovering");setTimeout(function(){n.hasClass("hovering")&&($("ul.navigation > li > ul").hide(),n.children("ul").show())},300)}).mouseleave(function(){$(this).removeClass("hovering");$("ul.navigation > li > ul").hide()});n=!1;t=function(){var t=$("#navigationContainer").find("ul");if($(".navigation").find(".toggle-icon").off("click",i),window.innerWidth<=784){$("#navigation").find("li").children("a").each(function(){var n=$(this);n.siblings().length>0&&n.append("<span class='toggle-icon'><\/span>")});$(".navigation").find(".toggle-icon").on("click",i);t.find("li").removeAttr("style");n=!1}else n==!1&&(n=!0)};t();$(window).on("resize",t)}function createWindowPopup(){var n=$("a.popupWindow");n.click(function(){var f=$(this),n,t,i=$(window),r=i.width(),e=i.scrollTop(),u;$("#content").prepend('<div id="popupWindow"><\/div>');$(".k-window").remove();switch(!0){case r<520:n=r;t=i.height();$("#popupWindow").addClass("overflow-y");break;case r<798:n=400;t=500;break;default:n=567;t=500}return u=$("#popupWindow").kendoWindow({width:n,height:t,visible:!1,content:f.attr("href"),title:f.attr("title"),iframe:!0,modal:!0,resizable:!1,pinned:!0,draggable:!1,animation:{open:{effects:!1},close:{effects:!1}}}),u.data("kendoWindow").open().center(),u.closest(".k-window").css({position:"fixed",margin:"auto",top:60}),$("html, body").scrollTop(e),!1})}function createToggle(){$("a.slideToggle").click(function(){return $(this).toggleClass("toggle-close").siblings(".hiddenContent").slideToggle(),!1})}function createRetinaIcon(){$("img.retina-icon").each(function(){var n=$(this);n.width(Math.round(n.width()/2)).show()})}function createHeaderToggleClasses(){$("#searchToggle").click(function(){return $(this).parent(".wrapper").toggleClass("tool-fade"),!1})}function createQuoteSelectorClasses(){$(".cover-selector").parent(".sf_colsIn").addClass("cover-selector-padding");$("#stepProcess").parent(".sf_white").addClass("cover-selector-step-padding")}function createSFtemplateClasses(){$(".sf_colsOut.sf_intro").parent(".sf_cols").addClass("sf_cols-intro");$(".sf_colsOut.sf_white").parent(".sf_cols").addClass("sf_cols-white");$(".sf_colsOut.sf_3cols_content").parent(".sf_cols").addClass("sf_3cols-content");$(".sf_colsOut.sf_2cols_content").parent(".sf_cols").addClass("sf_2cols-content");$(".hospital-cover").parent().addClass("hospital-cover-wrap");$(".maintenance").siblings(".searchContainer").addClass("maintenance-sibling")}function createStrikeThroughTitles(){$("strong").parent("h2").addClass("strike-through");$("strong").parent("h3").addClass("strike-through")}function createDatePicker(){$(".datepicker").kendoDatePicker({format:"dd/MM/yyyy"})}function createDateMask(){$(".datemask").mask("99/99/9999");$(".monthmask").mask("99/9999");$(".bsbmask").mask("999-999")}function isNumber(n){n=n?n:window.event;var t=n.which?n.which:n.keyCode;return t>31&&(t<48||t>57)?!1:!0}function createContentSlider(){$("#contentSlider").cycle({timeout:1e4,slides:"div.slide",next:".next",prev:".prev"})}function createEqualHeightColumns(){$(".sf_cols").equalize({children:".contentpanel"}).equalize({children:".homepanel"}).equalize({children:".socialpanel"});$(".cover-selector-panels").equalize({children:".selector-title h2"}).equalize({children:".selector-features"}).equalize({children:"h2"}).equalize({children:".selector-discription"})}function createSiteFinityExpandList(){var n=$(".sfexpandableListWrp h2.sflistTitle");n.click(function(){return $(this).toggleClass("toggle-close").siblings(".sflistList").slideToggle(),!1});$(".sflistList li:first-child a").addClass("sflistListItemExpanded");$(".sflistList li:first-child div").show().removeClass("sflistItemContentExp");$("h3.sflistItemTitle").find("a.sflistItemToggleLnk").addClass("woof");$(".sflistItemToggleLnk").each(function(){var n=$(this),t=n.text(),i=t.match(/\((.*)\)/);i!=null&&n.html(n.html().replace(/\([^\)]*\)/,'<span class="bracket-text">$&<\/span>'))})}function createResponsiveTables(){$("table.responsive").wrap("<div class='resposive-table'><\/div>");$("table.responsive").after("<div class='resposive-table-swipe'><span class='swipe-wrapper'><span class='charfix'>&lsaquo;<\/span> Swipe <span class='charfix'>&rsaquo;<\/span><\/span><\/div>")}function createTruncatedText(){$(".truncated").click(function(){return $(this).parents("li").find(".truncated-short").toggle(),$(this).parents("li").find(".truncated-long").toggle(),!1})}function bingSearchHtml(){if($(".bingSearchContainer")[0]){$('.inputContainer input[type="text"]').val(GetQueryStringByName("q"));$('.inputContainer input[type="text"]').keydown(function(n){n.which==13&&(n.preventDefault(),$('.inputContainer input[type="text"]').val().length>1&&$(this).next('input[type="button"]').trigger("click"))});$('.bingSearchContainer input[type="button"]').on("click",function(n){var t=$(".bingSearchContainer").find('input[type="text"]').val();if(t.replace(/ /g,"")==""){n.preventDefault();return}window.location.href="/search-results?q="+encodeURI(t).replace(/%20/g,"+")})}}function GetQueryStringByName(n,t){t||(t=window.location.href);n=n.replace(/[\[\]]/g,"\\$&");var r=new RegExp("[?&]"+n+"(=([^&#]*)|&|#|$)"),i=r.exec(t);return i?i[2]?decodeURIComponent(i[2].replace(/\+/g," ")):"":null}function createProviderSearchGrid(){var n=$("#providerSearch");$(".k-grid .k-grid-header").hide();n.kendoGrid({dataSource:{transport:{read:{url:"site.resource/json/providerSearch.json",dataType:"Json"}},serverPaging:!1,serverFiltering:!0,serverSorting:!0},filterable:!1,sortable:!1,pageable:{pageSize:10,messages:{first:"",last:"",next:"&raquo;",previous:"&laquo;"}},rowTemplate:kendo.template($("#providerSearchResults").html())})}function isMobile(){return $(window).width()<=520?!0:!1}function getPopupWidth(){var n,t=$(window).width();switch(!0){case t<520:n=t-20;break;case t<798:n=400;break;default:n=567}return n}function formStylingGlobal(){/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent)||$("select:not(#form-control)").kendoDropDownList();$("input[type=checkbox], input[type=radio]").not(".bootstrap").uniform()}function scrollToAnchor(n,t){if(!isMobile()){var i=$(n);i.length==1&&$("body, html").animate({scrollTop:i.offset().top-t},1500)}}function scrollToAnchorForAll(n,t){var i=$(n);i.length==1?$("body, html").animate({scrollTop:i.offset().top-t},1500):$("body, html").animate({scrollTop:0-t},1500)}function scrollToAnchorClaim(n){var t=$(n);t.length==1&&$("body, html").animate({scrollTop:t.offset().top},1500)}function sortJsonData(n,t,i){return n.sort(function(n,r){return i?n[t]>r[t]?1:n[t]<r[t]?-1:0:r[t]>n[t]?1:r[t]<n[t]?-1:0})}function toggleBlueQuote(){$(window).width()>639?($(".cover-selector-container").show(),$(".slideToggle").removeClass("toggle-close")):($(".cover-selector-container").hide(),$(".slideToggle").addClass("toggle-close"));$(window).resize(function(){$(window).width()!==windowWidth&&($("input").is(":focus")||($(window).width()>639?($(".cover-selector-container").show(),$(".slideToggle").removeClass("toggle-close")):($(".cover-selector-container").hide(),$(".slideToggle").addClass("toggle-close"))))})}function mvcAjaxErrorHandler(n){var i=$($.parseHTML(n.responseText)),t;$.each(i,function(n,i){i.rel=="canonical"&&(t=i.href)});t?window.location.replace(t):window.location.replace(window.location.origin+"/500.htm")}function sessionExpireCheck(n){if(n.search("session has expired")>0){var i=$($.parseHTML(n)),t;$.each(i,function(n,i){i.rel=="canonical"&&(t=i.href)});t?window.location.replace(t):window.location.replace(window.location.origin+"/500.htm")}}function replaceSearchElement(){var i=$("#webSearchArea"),t={},n;t.elem=$("#phoneAndSearch");t.pos="prepend";n={};n.elem=$(".header");n.pos="append";elemReplacement(i,784,t,n)}function bingSearchFeature(){if($("#searchPanel")[0]){$('input[type="text"].searchbox').val(this.GetQueryStringByName("q"));$('input[type="text"].searchbox').keydown(function(n){n.which==13&&(n.preventDefault(),$('input[type="text"].searchbox').val().replace(/ /g,"").length>1&&$('input[type = "submit"].searchbutton').trigger("click"))});$('#searchPanel input[type="submit"].searchbutton').on("click",function(n){var t=$("#searchPanel").find("input.searchbox").val();if(t.replace(/ /g,"")==""){n.preventDefault();return}window.location.href="/search-results?q="+encodeURI(t).replace(/%20/g,"+")})}}function elemReplacement(n,t,i,r){var u=$(document).width();u<=t?r.pos=="append"?n.appendTo(r.elem):r.pos=="prepend"&&n.prependTo(r.elem):i.pos=="append"?n.appendTo(i.elem):i.pos=="prepend"&&n.prependTo(i.elem)}function spinLoader(){$(".btnFinalise").click(function(){$(".submitSpinner").remove();$("body").append('<div class="submitSpinner"><div><div><\/div><div><p><\/p><\/div><\/div><\/div>')})}function datePickerInputTypeChanger(n){var t=document.querySelectorAll(".datepicker."+n);t.forEach(function(n){n.setAttribute("type","tel")})}function createSlickSlider(){var i=function(){$newsAndInfoTile.each(function(){var n=$(this);n.slick({dots:!1,arrows:!1,infinite:!1,slidesToShow:4,slidesToScroll:4,responsive:[{breakpoint:1100,settings:{dots:!1,arrows:!1,infinite:!1,slidesToShow:4,slidesToScroll:4}},{breakpoint:1e3,settings:{dots:!0,arrows:!1,infinite:!1,slidesToShow:3.1,slidesToScroll:3}},{breakpoint:700,settings:{dots:!0,arrows:!1,infinite:!1,slidesToShow:2.5,slidesToScroll:1}},{breakpoint:550,settings:{dots:!0,arrows:!1,infinite:!1,slidesToShow:1.7,slidesToScroll:1}},{breakpoint:400,settings:{dots:!0,arrows:!1,infinite:!1,slidesToShow:1.2,slidesToScroll:1}}]})})},t=$(".js-testimonial__slider"),n;if(t.length&&t.each(function(){var n=$(this);n.slick({autoplay:!0,autoplaySpeed:6e3,slidesToShow:1,fade:!0,cssEase:"linear",speed:500,dots:!1,prevArrow:$(".slick-prev"),nextArrow:$(".slick-next"),adaptiveHeight:!0,responsive:[{breakpoint:768,settings:{autoplay:!1}}]})}),$newsAndInfoTile.length&&i(),n=$(".three-cols-gridblock__container > div"),n.length)$(window).on("load resize orientationchange",function(){n.each(function(){var n=$(this);$(window).width()>768?n.hasClass("slick-initialized")&&n.slick("unslick"):n.hasClass("slick-initialized")||n.slick({slidesToShow:1,speed:500,dots:!1,adaptiveHeight:!0,mobileFirst:!0,dots:!0,responsive:[{breakpoint:768,settings:"unslick"}]})})})}function objectFit(){var n=document.querySelectorAll(".object-fit:not(.news__item-thumbnail) > img"),t=document.querySelectorAll(".news__item-thumbnail.object-fit img");n.length&&(objectFitPolyfill(n),objectFitPolyfill(t))}function stepsWizard(){var t=$(".steps-wizard .tab__header a"),i=$(".steps-wizard .tab:not(.option1)"),n=$(".step-wizard__next");t.on("click",function(){$(this).parents(".steps-wizard").find(".tab__header").removeClass("current");$(this).parent().addClass("current")});i.hide();n.on("keydown",function(n){n.which==13&&(n.preventDefault(),$(this).click())});n.on("click",function(){var t=parseInt($(this).data("next"))+1,n;$(this).parents(".steps-wizard").find(".tabMenu .option"+t).click();n=$(this).parents(".steps-wizard").find(".tab__header .option"+t);console.log(n.offset().top);$("html, body").delay(100).animate({scrollTop:n.offset().top},500)});n.on("keydown",function(n){n.which==13&&(n.preventDefault(),$(this).click())})}function showPlaceholder(){displayPlaceholderOnPageLoad($(".sfFormsEditor"))}function validateAddressLogic(){setAddressValidationStatus($residentialAddressWasValidatedHiddenField.val(),1);$validateResidentialAddressButton.click(function(){$("#ResidentialAddressLine1ForLookupRequiredFieldValidator")[0].enabled=!0;$("#ResidentialAddressSuburbForLookupRequiredFieldValidator")[0].enabled=!0;$("#ResidentialAddressStateForLookupCompareValidator")[0].enabled=!0;$("#ResidentialAddressPostCodeForLookupRequiredFieldValidator")[0].enabled=!0;var n=Page_ClientValidate("ResidentialAddressValidation");($("#ResidentialAddressPostCodeForLookupRequiredFieldValidator")[0].enabled=!1,$("#ResidentialAddressSuburbForLookupRequiredFieldValidator")[0].enabled=!1,$("#ResidentialAddressStateForLookupCompareValidator")[0].enabled=!1,$("#ResidentialAddressPostCodeForLookupRequiredFieldValidator")[0].enabled=!1,n)&&($("#changeCoverWrapper").hide(),$.ajax({url:"/handlers/AddressLookupDetailsHandler.ashx",data:{addressline1:$residentialAddressLine1.val(),addressline2:$residentialAddressLine2.val(),suburb:$residentialAddressSuburb.val(),state:$residentialAddressStateDropDownList.val(),postcode:$residentialAddressPostCode.val()},type:"get",dataType:"json",success:function(n){validResidentialAddresses=n;$validResidentialAddressesDropDownList=$("#ValidResidentialAddressesDropDownList").kendoDropDownList({optionLabel:"Please select",dataTextField:"StreetName",dataValueField:"Id",template:addressTemplate,dataBound:function(){setSpanInnerHtml($validResidentialAddressesDropDownList)},change:onChangeValidResidentialAddress}).data("kendoDropDownList");$validResidentialAddressesDropDownList.setDataSource(n);$validResidentialAddressesDropDownList.dataSource.insert(0,{StreetName:"My address is not listed; use address as entered",Id:"0"});$validResidentialAddressesDropDownList.select(0);$validResidentialAddressesPanel.show()}}))});$residentialAddressLine1.change(function(){setAddressValidationStatus(!1,1)});$residentialAddressSuburb.change(function(){setAddressValidationStatus(!1,1)});$residentialAddressStateDropDownList.change(function(){setAddressValidationStatus(!1,1)});$residentialAddressPostCode.change(function(){setAddressValidationStatus(!1,1)});setAddressValidationStatus($postalAddressWasValidatedHiddenField.val(),2);$validatePostalAddressButton.click(function(){$("#PostalAddressLine1ForLookupRequiredFieldValidator")[0].enabled=!0;$("#PostalAddressSuburbForLookupRequiredFieldValidator")[0].enabled=!0;$("#PostalAddressStateForLookupCompareValidator")[0].enabled=!0;$("#PostalAddressPostCodeForLookupRequiredFieldValidator")[0].enabled=!0;var n=Page_ClientValidate("PostalAddressValidation");($("#PostalAddressPostCodeForLookupRequiredFieldValidator")[0].enabled=!1,$("#PostalAddressSuburbForLookupRequiredFieldValidator")[0].enabled=!1,$("#PostalAddressStateForLookupCompareValidator")[0].enabled=!1,$("#PostalAddressPostCodeForLookupRequiredFieldValidator")[0].enabled=!1,n)&&$.ajax({url:"/handlers/AddressLookupDetailsHandler.ashx",data:{addressline1:$postalAddressLine1.val(),addressline2:$postalAddressLine2.val(),suburb:$postalAddressSuburb.val(),state:$postalAddressStateDropDownList.val(),postcode:$postalAddressPostCode.val()},type:"get",dataType:"json",success:function(n){validPostalAddresses=n;$validPostalAddressesDropDownList=$("#ValidPostalAddressesDropDownList").kendoDropDownList({optionLabel:"Please select",dataTextField:"StreetName",dataValueField:"Id",template:addressTemplate,dataBound:function(){setSpanInnerHtml($validPostalAddressesDropDownList)},change:onChangeValidPostalAddress}).data("kendoDropDownList");$validPostalAddressesDropDownList.setDataSource(n);$validPostalAddressesDropDownList.dataSource.insert(0,{StreetName:"My address is not listed; use address as entered",Id:"0"});$validPostalAddressesDropDownList.select(0);$validPostalAddressesPanel.show()}})});$postalAddressLine1.change(function(){setAddressValidationStatus(!1,2)});$postalAddressSuburb.change(function(){setAddressValidationStatus(!1,2)});$postalAddressStateDropDownList.change(function(){setAddressValidationStatus(!1,2)});$postalAddressPostCode.change(function(){setAddressValidationStatus(!1,2)})}function onChangeValidResidentialAddress(){var i=this.value(),t,n;if(i==0)$isResidentialAddressOverridden!=undefined&&$isResidentialAddressOverridden.val(!0);else{for(t=0;t<validResidentialAddresses.length;t++)if(n=validResidentialAddresses[t],n.Id==i){$("#ResidentialAddressLine1TextBox").val(n.StreetName);$("#ResidentialAddressSuburbTextBox").val(n.Suburb);$residentialAddressStateDropDownList.select(n.StateValue);$("#ResidentialAddressPostCodeTextBox").val(n.Postcode);break}$isResidentialAddressOverridden!=undefined&&$isResidentialAddressOverridden.val(!1)}setAddressValidationStatus(!0,1);$validResidentialAddressesPanel.hide();checkForStateChange()}function checkForStateChange(){var i=$residentialAddressStateRebate.text(),t,n;if(i!="")return!1;if(t=$residentialAddressCurrentState.val(),n=$residentialAddressStateDropDownList.val(),t!=n){if((n==1||n==2)&&(t==1||t==2))return!1;$.ajax({url:"/handlers/CoverQuoteHandler.ashx",data:{newState:n},type:"get",dataType:"json",beforeSend:function(){$("#AddressDetailWrapper").addClass("spinner-loader");$("select, input").prop("disabled",!0)},complete:function(){$("#AddressDetailWrapper").removeClass("spinner-loader");$("select, input").prop("disabled",!1)},success:function(n){$currentCoverTextBox.html(n.OldCoverName);$currentContributionTextBox.html(n.OldContribution);$newCoverTextBox.html(n.NewCoverName);$newContributionTextBox.html(n.NewContribution);showDiscount(n.DiscountDescription,n.DiscountEndDate,n.IsNewDiscountRestricted);n.AgeBasedDiscountPercentage!==null&&($currentAgeBasedDiscountSpan.html(n.AgeBasedDiscountPercentage),$newAgeBasedDiscountSpan.html(n.AgeBasedDiscountPercentage));typeof ShowChangeCoverWrapper=="function"&&ShowChangeCoverWrapper()}})}}function showDiscount(n,t,i){var r="";$discountRestrictedHtml.addClass("hide");n&&(r=t?"Includes "+n+"<br />(End Date: "+t+")<br/>":"Includes "+n+"<br/>");$currentDiscountSpan.html(r);i?($newDiscountSpan.html(""),$discountRestrictedHtml.removeClass("hide")):$newDiscountSpan.html(r)}function onChangeValidPostalAddress(){var i=this.value(),t,n;if(i==0)$isPostalAddressOverridden!=undefined&&$isPostalAddressOverridden.val(!0);else{for(t=0;t<validPostalAddresses.length;t++)if(n=validPostalAddresses[t],n.Id==i){$("#PostalAddressLine1TextBox").val(n.StreetName);$("#PostalAddressSuburbTextBox").val(n.Suburb);$postalAddressStateDropDownList.select(n.StateValue);$("#PostalAddressPostCodeTextBox").val(n.Postcode);break}$isPostalAddressOverridden!=undefined&&$isPostalAddressOverridden.val(!1)}setAddressValidationStatus(!0,2);$validPostalAddressesPanel.hide()}function setAddressValidationStatus(n,t){var i=n=="true"||n=="True"||n==!0;parseInt(t,10)==1?($residentialAddressWasValidatedHiddenField.val(n),i?($(".residentialValidatedMessage").show(),$(".residentialNotValidatedMessage").hide()):($(".residentialValidatedMessage").hide(),$(".residentialNotValidatedMessage").show())):($postalAddressWasValidatedHiddenField.val(n),i?($(".postalValidatedMessage").show(),$(".postalNotValidatedMessage").hide()):($(".postalValidatedMessage").hide(),$(".postalNotValidatedMessage").show()))}function ARDRF_ShowAddressValidationStatus(n,t){var i=n=="true"||n=="True"||n==!0;parseInt(t,10)==1?(i?($(".residentialValidatedMessage").removeClass("hidden"),$(".residentialNotValidatedMessage").addClass("hidden")):($(".residentialValidatedMessage").addClass("hidden"),$(".residentialNotValidatedMessage").removeClass("hidden")),$("#IsResidentialAddressOverriddenHiddenField").val("True")):(i?($(".postalValidatedMessage").removeClass("hidden"),$(".postalNotValidatedMessage").addClass("hidden")):($(".postalValidatedMessage").addClass("hidden"),$(".postalNotValidatedMessage").removeClass("hidden")),$("#IsPostalAddressOverriddenHiddenField").val("True"))}function ARDRF_onChangeValidResidentialAddress(){var i=this.value(),t,n;if(i!=0){for($isResidentialAddressOverridden!=undefined&&$isResidentialAddressOverridden.val(!0),t=0;t<validResidentialAddresses.length;t++)if(n=validResidentialAddresses[t],n.Id==i){$("#ResidentialAddressLine1").val(n.StreetName);$("#ResidentialSuburb").val(n.Suburb);$("#dropdownResidentialState").select(n.StateValue);$("#ResidentialAddressPostCodeTextBox").val(n.Postcode);break}}else i==0&&$isResidentialAddressOverridden!=undefined&&$isResidentialAddressOverridden.val(!0);ARDRF_ShowAddressValidationStatus(!0,1);$validResidentialAddressesPanel.hide()}function ARDRF_onChangeValidPostalAddress(){var i=this.value(),t,n;if(i!=0){for($isPostalAddressOverridden!=undefined&&$isPostalAddressOverridden.val(!0),t=0;t<validPostalAddresses.length;t++)if(n=validPostalAddresses[t],n.Id==i){$("#PostalAddressLine1").val(n.StreetName);$("#PostalSuburb").val(n.Suburb);$("#dropdownPostalState").select(n.StateValue);$("#PostalAddressPostCodeTextBox").val(n.Postcode);break}}else i==0&&$isPostalAddressOverridden!=undefined&&$isPostalAddressOverridden.val(!0);ARDRF_ShowAddressValidationStatus(!0,2);$validPostalAddressesPanel.hide()}function getBankDetailsByBSB(n,t){var r=n.val(),i;/^(?!(?:0{6}|000-000))(?:\d{6}|\d\d\d-\d\d\d)$/.test(r)?(i=n.parent("li"),i.append('<div class="loading"><\/div>'),$.ajax({url:"/Handlers/BankBranchDetailsHandler.ashx?rnd="+Math.random(),data:"bsb="+r,type:"get",dataType:"json",success:function(n){n.BankName!=null&&n.BranchName!=null?t.html('<div class="inner col-md-12"><p class="col-md-12"><strong>Bank name:<\/strong><span>'+n.BankName+'<\/span><\/p>                 <p class="col-md-12"><strong>Branch name:<\/strong><span>'+n.BranchName+"<\/span><\/p><\/div>"):t.html('<div class="inner col-md-12"><p class="col-md-12"><strong>Bank name:<\/strong><span>(Invalid BSB number)<\/span><\/p>                 <p class="col-md-12"><strong>Branch name:<\/strong><span>(Invalid BSB number)<\/span><\/p><\/div>');i.find(".loading").remove()}})):t.html("")}function calculateAge(n){if(!n||0===n.length)return 0;var t=moment(n,"DD/MM/YYYY").toDate();return~~((Date.now()-t)/315576e5)}function displayPlaceholderOnPageLoad(n){$(document).ready(function(){var t=n.find("input[type=text], textarea, input[type=tel],input[type=email]");t.each(function(){var n=$(this).val();$(this).attr("placeholder",n);$(this).attr("value","");$(this).val("");$(this).on("focus",function(){var n=$(this).val();n==$(this).attr("placeholder")&&$(this).val("")})})})}function createHistoryGrid(){var n=$("#helperHistory");n.kendoGrid({dataSource:{transport:{read:{url:"/Handlers/HelperHistorySearchHandler.ashx",data:{rnd:Math.random(),datePeriod:$historyDropdown.val()},dataType:"Json"}},serverPaging:!1,serverFiltering:!1,serverSorting:!1},filterable:!1,sortable:!1,pageable:{pageSize:10,messages:{first:"",last:"",next:"&raquo;",previous:"&laquo;"}},columns:[{field:"DATE",title:"Search date",type:"date",template:'#=kendo.toString(DATE,"dd MMM yyyy")#'},{field:"NAME",title:"Patient name",template:'<a href="/handlers/helperdocumenthandler.ashx?view=${DOCUMENT_ID}&datePeriod=${DATE_PERIOD}" target="_blank">#=NAME#<\/a>'},{field:"ADMISSION",title:"Admission date",type:"date",template:'#=kendo.toString(ADMISSION,"dd MMM yyyy")#'},{field:"SEARCHED",title:"Searched by"}]});$historyDropdown.change(function(){var n=$("#helperHistory").data("kendoGrid");n.dataSource.page(1);n.dataSource.read({rnd:Math.random(),datePeriod:$historyDropdown.val()})})}function initializeHelperEligibilitySearch(){function i(){var i=$("#SearchByDropDownList"),t;if(i.length>0){t=parseInt(i.val(),10);switch(t){case 0:n.find("[data-isMemberNumber=false]").addClass(clsHiddenElement);n.find("[data-isMemberNumber=true]").removeClass(clsHiddenElement);break;case 1:n.find("[data-isMemberNumber=true]").addClass(clsHiddenElement);n.find("[data-isMemberNumber=false]").removeClass(clsHiddenElement)}document.getElementById("MembershipNumberRequiredFieldValidator").enabled=t==0;document.getElementById("MembershipNumberCompareValidator").enabled=t==0;document.getElementById("PatientSurnameRequiredFieldValidator").enabled=t==1;document.getElementById("PatientDateOfBirthRequiredFieldValidator").enabled=t==1;document.getElementById("PatientDateOfBirthRegularExpressionValidator").enabled=t==1;document.getElementById("PatientDateOfBirthCompareValidator").enabled=t==1}}function r(){var i=$("#ExpectedLengthOfStayDropDownList"),n=parseInt(i.val(),10);switch(n){case 0:t.find("[data-lengthOfStay=true]").removeClass(clsHiddenElement);break;case 1:t.find("[data-lengthOfStay=true]").addClass(clsHiddenElement)}document.getElementById("NumberOfDaysCompareValidatorDataType").enabled=n==0;document.getElementById("NumberOfDaysCompareValidatorRange").enabled=n==0}var n=$(".patientDetails").find("ul"),t=$(".admissionDetails").find("ul");$("#SearchByDropDownList").change(function(){i()});$("#ExpectedLengthOfStayDropDownList").change(function(){r()});i()}function createKendoGridQuote(){var n=$("#memberDetailsTable");n.kendoGrid({dataSource:{transport:{read:{url:"site.resource/json/coverDetails.json",dataType:"Json"}},schema:{model:{fields:{MEMBER:{type:"string"},GENDER:{type:"string"},RELATIONSHIP:{type:"string"},DOB:{type:"string"}}}},pageSize:10,serverPaging:!1,serverFiltering:!0,serverSorting:!0},filterable:!1,sortable:!1,columns:[{field:"MEMBER",title:"Member"},{field:"GENDER",title:"Gender"},{field:"RELATIONSHIP",title:"Relationship"},{field:"DOB",title:"Date of Birth"},{field:"",title:"Remove",template:'<a href="7.2-getQuoteCover?id=#=MEMBER#" class="remove">Remove<\/a>'}]})}function setupRebateRateTierInformationToggles(){showGovernmentRebateInformation();var n=$("#RebateRateDropDownList");n.change(function(){showGovernmentRebateInformation()})}function showGovernmentRebateInformation(){var n=$(".governmentRebateInformation"),t;n.find("*[data-governmentrebateinformation]").addClass(clsHiddenElement);t=$("#RebateRateDropDownList").val();n.find("[data-governmentrebateinformation='"+t+"']").removeClass(clsHiddenElement)}function coverFeaturesToggles(){var n=$(".selector-features"),t=$(".selector-covered"),i=$(".selector-not-covered"),r=$(".selector-waiting");n.find(".toggle").click(function(t){return $(window).width()<=639?t.target!=null&&($(t.target.parentElement.parentElement).find(".cover-text").toggle().toggleClass("coverSelector-open"),$(t.target).toggleClass("toggle-close")):(n.find(".cover-text").toggle().toggleClass("coverSelector-open"),equalCoverSelectorPanels($(".selector-features .cover-text")),n.find(".toggle").toggleClass("toggle-close")),!1});t.find(".toggle").click(function(n){return $(window).width()<=639?n.target!=null&&($(n.target.parentElement.parentElement).find(".cover-text").toggle().toggleClass("coverSelector-open"),$(n.target).toggleClass("toggle-close")):(t.find(".cover-text").toggle().toggleClass("coverSelector-open"),equalCoverSelectorPanels($(".selector-covered .cover-text")),t.find(".toggle").toggleClass("toggle-close")),!1});i.find(".toggle").click(function(n){return $(window).width()<=639?n.target!=null&&($(n.target.parentElement.parentElement).find(".cover-text").toggle().toggleClass("coverSelector-open"),$(n.target).toggleClass("toggle-close")):(i.find(".cover-text").toggle().toggleClass("coverSelector-open"),equalCoverSelectorPanels($(".selector-not-covered .cover-text")),i.find(".toggle").toggleClass("toggle-close")),!1});r.find(".toggle").click(function(n){return $(window).width()<=639?n.target!=null&&($(n.target.parentElement.parentElement).find(".waiting-content").toggle().toggleClass("coverSelector-open"),$(n.target).toggleClass("toggle-close")):(r.find(".waiting-content").toggle().toggleClass("coverSelector-open"),equalCoverSelectorPanels($(".selector-waiting .waiting-content")),r.find(".toggle").toggleClass("toggle-close")),!1})}function equalCoverSelectorPanels(n){var t=0;n.each(function(){var n=$(this).height();n>t&&(t=n)});t>0&&n.height(t)}function getQuoteLogic(){function o(){var t=f.is(":checked"),i=e.is(":checked"),n=t||i;n?u.addClass(clsHiddenElement):u.removeClass(clsHiddenElement);document.getElementById("ApplicantTwoDateOfBirthRequiredFieldValidator").enabled=!n;document.getElementById("ApplicantTwoDateOfBirthRegularExpressionValidator").enabled=!n;document.getElementById("ApplicantTwoDateOfBirthCompareValidator").enabled=!n;document.getElementById("ApplicantTwoDateOfBirthMinCompareValidator").enabled=!n}function n(){$("#productResults").hide()}function i(){var n=$("#CoverOptionsDropDownList").data("kendoDropDownList"),i,o,v,u,b,k,y;if((n==undefined||n=="")&&($("#CoverOptionsDropDownList").kendoDropDownList(),n=$("#CoverOptionsDropDownList").data("kendoDropDownList")),n!=undefined){i=$("#TopCoverIncludingAdultChildrenCoverOptionIdHiddenField").val();t==undefined&&(o=r(i),t=o.dataItem,s=o.index);var d=f.is(":checked"),g=h.is(":checked"),l=c.is(":checked"),p=e.is(":checked"),w=0,a=$("#ApplicantOneDateOfBirthTextBox").val();a!=""&&(w=calculateAge(a));v=0;u=$("#ApplicantTwoDateOfBirthTextBox").val();u!=""&&(v=calculateAge(u));b=(l||p)&&(a==""||w>=35||l&&(u==""||v>=35));k=b||!d&&!g&&!l&&!p;k?r(i).dataItem==null&&t!=null&&n.dataSource.insert(s,t):(y=r(i),y.dataItem!=null&&n.dataSource.remove(y.dataItem))}}function r(n){var t=0,i=0,r=null;return $("#CoverOptionsDropDownList").children().each(function(){var f=$(this),u;f.val()==n&&(u=$("#CoverOptionsDropDownList").data("kendoDropDownList"),r=u.dataSource.at(t),i=t);t+=1}),{dataItem:r,index:i}}var u=$(".applicantTwoDateOfBirth"),f=$("li.single").find("input"),h=$("li.couples").find("input"),c=$("li.family").find("input"),e=$("li.soleParent").find("input"),t,s;$(".cover-selector-option select").kendoDropDownList();$(".cover-selector-option .k-dropdown").on("touchstart",function(){$(this).removeAttr("tabindex")});o();i();$(".cover-selector-type").find("input").change(function(){o();n();i()});$("#ApplicantOneDateOfBirthTextBox").change(function(){n();i()});$("#ApplicantTwoDateOfBirthTextBox").change(function(){n();i()});$("#StateDropDownList").change(function(){n()});$("#CoverOptionsDropDownList").change(function(){n()});$("#RebateRateDropDownList").change(function(){n()})}function coverFeaturesMobileToggles(){}function getQuotePriceLogic(){function a(n){return!(n.find(".extrasDropDownList select").val()==="0"&&n.find(".hospitalDropDownList select").val()==="0")}function l(n){n.length>0&&n.find(".promocodeError").html("")}function h(){for(var t,f,e,s,h,o=$(".cover-selector-panels").find(i),u=0;u<o.length;u++)t=$(o[u]),t.attr("data-hospitalid")||t.attr("data-extrasid")||t.attr("data-packageid")?(f=t.attr("data-hospitalid"),e=t.attr("data-extrasid")):(s=t.find(r),h=t.find(n),f=s.val(),e=h.val()),c(f)&&e==0?t.attr("data-isAmbulanceOnlyProductSelected","true"):t.attr("data-isAmbulanceOnlyProductSelected","false");return!0}function v(){for(var t,u,e,s,h,o=$(".cover-selector-panels").find(i),f=0;f<o.length;f++)if(t=$(o[f]),t.attr("data-hospitalid")||t.attr("data-extrasid")||t.attr("data-packageid")?(u=t.attr("data-hospitalid"),e=t.attr("data-extrasid")):(s=t.find(r),h=t.find(n),u=s.val(),e=h.val()),(c(u)||u==0)&&e!=0)return t.attr("data-hasExtrasOrAmbulanceOnlyProductSelected","true"),!0;return!1}function y(n){return/[A-Za-z0-9]$/.test(n)}function p(n,t,i){i.find(".promocodeError").html(MsgWrapper(""));var r=i.find(".DiscountIdTextBox"),u=i.find(".DiscountNameTextBox");return i.attr("data-discountid",0),i.attr("data-discountmsg",""),r.val(0),u.val(""),n==""||y(n)?!0:(i.find(".promocodeError").html(MsgWrapper("Discount code for selected company is invalid")),!0)}function w(n,t,i,r,u,f){var s=t.find(".promocode").val(),h=t,c=p(n,s,h);if(c){t.find(".promocode").val(n);$("#isPromoCodeValidated").val(!0);var e=t.find(".DiscountIdTextBox"),o=t.find(".DiscountNameTextBox"),l="hospitalGuid="+i+"&extrasGuid="+r+"&packageGuid="+u+"&discountCode="+n;$.ajax({dataType:"json",url:"/Handlers/DiscountHandler.ashx?"+l,success:function(n){var s=n,h,c;s&&(s.Message!=""?(t.attr("data-discountid",0),t.attr("data-discountmsg",""),e.val(0),o.val(""),a(t)&&t.find(".promocodeError").html(MsgWrapper("Discount code for selected company is invalid"))):(e.val(s.Discount.ContributionDiscountId),o.val(s.Discount.Name),t.attr("data-discountid",s.Discount.ContributionDiscountId),t.attr("data-discountmsg",s.Discount.Name),t.find(".promocodeError").html(""),h=n.Discount.ContributionDiscountId,c=n.Discount.Name));k(t,i,r,u,f,h,c)}})}}function o(t,i){var u,e,o,s;if(t.find(".btn").attr("disabled","disabled"),g(t),t.attr("data-hospitalid")||t.attr("data-extrasid")||t.attr("data-packageid"))u=t.attr("data-hospitalid"),e=t.attr("data-extrasid"),o=t.attr("data-packageid");else{var h=t.find(r),c=t.find(n),l=t.find(f);u=h.val();e=c.val();o=l.val()}(u!="0"||e!="0"||o!="0")&&t.find(".errorPanel").hide();s=$("#PromoCodeTextBox0 input").val();w(s,t,u,e,o,i);t.find(".btn").removeAttr("disabled","disabled")}function s(t){var r=t.find(".selector-col__extras"),i;r.addClass("-disable");i=t.find(n).data("kendoDropDownList");i.dataSource.data()[0].set("text","Select Hospital to unlock Extras");i.enable(!1);i.value(0);r.find(".k-input").css("max-width",$(".selector-col .selector-title > h2").width()-38)}function b(t){var i=t.find(".selector-col__extras");i.removeClass("-disable");t.find(n).data("kendoDropDownList").dataSource.data()[0].set("text","Please select");t.find(n).data("kendoDropDownList").enable(!0);i.find(".k-input").css("max-width",$(".selector-col .selector-title > h2").width()-38)}function k(n,i,r,f,e,o,h){var l=n.find(t),a=l.val();i==0&&(ClearPaymentOptionsText(n),clearQuotePrice(n),n.addClass("hide-elements"),updateVariationIdHiddenFields(n,0,0));hasExtrasOrAmbulanceOnly=n.attr("data-hasExtrasOrAmbulanceOnlyProductSelected")=="true"?!0:!1;u=n.attr("data-isAmbulanceOnlyProductSelected")=="true"?!0:!1;u||c(i)?(l.data("kendoDropDownList").value(4),l.data("kendoDropDownList").enable(!1),getPaymentOptionsAndProductData(i,0,null,4,n,e,o,h),s(n)):c(i)&&r==0?(l.data("kendoDropDownList").value(4),l.data("kendoDropDownList").enable(!1),getPaymentOptionsAndProductData(i,r,null,4,n,e,o,h),s(n)):i!=0?(l.data("kendoDropDownList").enable(!0),getPaymentOptionsAndProductData(i,r,null,a,n,e,o,h),b(n)):f!=0?(l.data("kendoDropDownList").enable(!0),getPaymentOptionsAndProductData(null,null,f,a,n,e,o,h),s(n)):(s(n),clearQuotePrice(n),d(n),n.addClass("hide-elements"),updateVariationIdHiddenFields(n,0,0))}function d(n){var r=n.find(t).data("kendoDropDownList"),i;r==undefined&&n.find(t).kendoDropDownList();r=n.find(t).data("kendoDropDownList");r.enable(!1);r.value("");i=n.find(e).data("kendoDropDownList");i==undefined&&n.find(e).kendoDropDownList();i=n.find(e).data("kendoDropDownList");i.enable(!1);i.text("");i.value("")}function g(i){var c=i.find(r).data("kendoDropDownList"),u,o,s,h;c==undefined&&i.find(r).kendoDropDownList();u=i.find(n).data("kendoDropDownList");u==undefined&&i.find(n).kendoDropDownList();o=i.find(f).data("kendoDropDownList");o==undefined&&i.find(f).kendoDropDownList();s=i.find(t).data("kendoDropDownList");s==undefined&&i.find(t).kendoDropDownList();h=i.find(e).data("kendoDropDownList");h==undefined&&i.find(e).kendoDropDownList()}function c(n){var t=$("#AmbulanceOnlyProductIdsHiddenField"),i=null;return t.length>0&&(i=t.val().split("|")),$.inArray(n,i)>-1}toggleBlueQuote();var u=!1,i=".selector-col",r="select.hospitalDropDownList",n="select.extrasDropDownList",f="select.packageDropDownList",t="select.billingFrequencyDropDownList",e="select.additionalPaymentDropDownList";$(r).change(function(){var n=$(this).parents(i);l(n);n.find(f).data("kendoDropDownList").value(0);u=h();$(".cover-selector-panels").find(i).each(function(){var n=$(this);o(n,!0)})});$(n).change(function(){var n=$(this).parents(i),t;l(n);n.find(f).data("kendoDropDownList").value(0);t=v();u=h();$(".cover-selector-panels").find(i).each(function(){var n=$(this);o(n,t)})});$(f).change(function(){var t=$(this).parents(i);t.find(r).data("kendoDropDownList").value(0);t.find(n).data("kendoDropDownList").value(0);s(t);u=h();$(".cover-selector-panels").find(i).each(function(){var n=$(this);o(n,!0)})});$(t).change(function(){u=h();var n=$(this).val();$(".cover-selector-panels").find(i).each(function(){var i=$(this);i.find(t).data("kendoDropDownList").value(n);o(i,!1)})});$(e).change(function(){var i=$(this).parents(".selector-col"),u=i.data("discountid")!==undefined?i.data("discountid"):0;i.attr("data-hospitalid")||i.attr("data-extrasid")||i.attr("data-packageid")?getProductPrice(i.data("hospitalid"),i.data("extrasid"),i.data("packageid"),i.find(t).val(),$(this).val(),i,u,i.attr("data-discountmsg"),$("input.PromoCodeTextBox").val()):getProductPrice(i.find(r).val(),i.find(n).val(),i.find(f).val(),i.find(t).val(),$(this).val(),i,u,i.attr("data-discountmsg"),$("input.PromoCodeTextBox").val())});$(".selector-col").each(function(){o($(this))})}function MsgWrapper(n){return"<div class='error' >"+n+"<\/div>"}function getQuoteScroll(){scrollToAnchor("#productScrollAnchor",20)}function myQuotePaymentFrequency(){$("#BillingFrequencyDropDownList").change(function(){updateMyQuote()})}function clearQuotePrice(n){var t=n.children(".selector-pricing").find("li").first();n.attr("data-hospitalid")||n.attr("data-extrasid")||n.attr("data-packageid")?t.html('<span class="noPriceLabel">Could not retrieve product price<\/span>'):t.html('<span class="noPriceLabel">Please select Hospital &amp; Extras or Package<\/span>')}function IsValidPromocode(n){return/[A-Za-z0-9]$/.test(n)}function GetParameterByName(n){n=n.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var i=new RegExp("[\\?&]"+n+"=([^&#]*)"),t=i.exec(location.search);return t===null?"":decodeURIComponent(t[1].replace(/\+/g," "))}function toDMY(n){n=new Date(n);var t=n.getDate(),i=n.getMonth()+1,r=n.getFullYear();return t==="NaN"?"":(t<10&&(t="0"+t),i<10&&(i="0"+i),t+"/"+i+"/"+r)}function ClearPaymentOptionsText(n){dv=$('<div class="insertedContent"><\/div>');n.find(".selector-features").removeAttr("style");$container=n.find(".selector-features").find(".cover-text");$container.html(dv).hide();$container.parent().hide();insertedHeight=dv.height();$(window).width()<=639&&showHideContainer($(".selector-features"),$container);equalInsertedCoverSelectorPanels($(".selector-features .cover-text"),insertedHeight);dv=$('<div class="insertedContent style="display:none"><\/div>');$container=n.find(".selector-covered").find(".cover-text");$container.html(dv).hide();$container.parent().hide();insertedHeight=dv.height();showHideContainer($(".selector-covered"),$container);equalInsertedCoverSelectorPanels($(".selector-covered .cover-text"),insertedHeight);dv=$('<div class="insertedContent style="display:none"><\/div>');$container=n.find(".selector-not-covered").find(".cover-text");$container.html(dv).hide();$container.parent().hide();insertedHeight=dv.height();showHideContainer($(".selector-not-covered"),$container);equalInsertedCoverSelectorPanels($(".selector-not-covered .cover-text"),insertedHeight);dv=$('<div class="insertedContent style="display:none"><\/div>');$container=n.find(".selector-waiting").find(".cover-text");$container.html(dv).hide();$container.parent().hide();insertedHeight=dv.height();showHideContainer($(".selector-waiting"),$container);equalInsertedCoverSelectorPanels($(".selector-waiting .cover-text"),insertedHeight);$(".cover-selector-panels").equalize({children:".selector-title h2"}).equalize({children:"h2"}).equalize({children:".selector-discription"})}function getPaymentOptionsAndProductData(n,t,i,r,u,f,e,o){var h=u.children(".selector-pricing"),c=h.find("li").first(),s;c.html("").append('<div class="loading"><\/div>');$.ajax({url:"/Handlers/CoverSelectorProductHandler.ashx?rnd="+Math.random(),data:"hospitalId="+n+"&extrasId="+t+"&packageId="+i+"&billingFrequencyId="+r,type:"get",dataType:"json",success:function(h){var p,v,l,a,c,b;s=u.find("select.additionalPaymentDropDownList");p=s.val()==null||s.val()==""||f?h.DefaultAdditionalPayment:s.val();u.find(".additionalPaymentLabel").text("Excess:");h.AdditionalPaymentOptions!=null&&h.AdditionalPaymentOptions.length>0&&(v="[",jQuery.each(h.AdditionalPaymentOptions,function(){v+='{"Text": "'+this.Text+'", "Value": "'+this.Value+'"},'}),v=v.substring(0,v.length-1),v+="]",s.kendoDropDownList({dataSource:$.parseJSON(v),dataTextField:"Text",dataValueField:"Value"}),s.data("kendoDropDownList").refresh(),s.data("kendoDropDownList").enable(!0),s.data("kendoDropDownList").value(p));l=$('<div class="insertedContent">'+h.CoverFeaturesText+"<\/div>");u.find(".selector-features").removeAttr("style");c=u.find(".selector-features").find(".cover-text");c.html(l).show();c.parent().show();a=l.height();$(window).width()<=639?showHideContainer($(".selector-features"),c):$(".selector-features .toggle").removeClass("toggle-close");equalInsertedCoverSelectorPanels($(".selector-features .cover-text"),a);l=$('<div class="insertedContent style="display:none">'+h.WhatsCoveredText+"<\/div>");c=u.find(".selector-covered").find(".cover-text");c.html(l).show();c.parent().show();a=l.height();showHideContainer($(".selector-covered"),c);equalInsertedCoverSelectorPanels($(".selector-covered .cover-text"),a);l=$('<div class="insertedContent style="display:none">'+h.WhatsNotCoveredText+"<\/div>");c=u.find(".selector-not-covered").find(".cover-text");c.html(l).show();c.parent().show();a=l.height();showHideContainer($(".selector-not-covered"),c);equalInsertedCoverSelectorPanels($(".selector-not-covered .cover-text"),a);l=$('<div class="insertedContent style="display:none">'+h.WaitingPeriodsText+"<\/div>");c=u.find(".selector-waiting").find(".cover-text");c.html(l).show();c.parent().show();a=l.height();showHideContainer($(".selector-waiting"),c);equalInsertedCoverSelectorPanels($(".selector-waiting .cover-text"),a);$(".cover-selector-panels").equalize({children:".selector-title h2"}).equalize({children:"h2"}).equalize({children:".selector-discription"});var k=$("input.PromoCodeTextBox").val(),y=$(".selector-col").attr("data-discountid"),w=$(".selector-col").attr("data-discountmsg");(y=="0"||!y)&&e&&(y=e);w=o;b=s.data("kendoDropDownList").value();getProductPrice(n,t,i,r,b,u,y,w,k)}})}function showHideContainer(n,t){var i=!1;n.each(function(){$(this).find(".toggle").hasClass("toggle-close")&&(i=!0)});i||t.hide()}function equalInsertedCoverSelectorPanels(n,t){var i=t;n.css("height","");n.each(function(){var n=$(this).height();n>i&&(i=n)});i>0&&n.height(i)}function getProductPrice(n,t,i,r,u,f,e,o,s){updateVariationIdHiddenFields(f,n,i);f.removeClass("hide-elements");$.ajax({url:"/Handlers/CoverSelectorPriceHandler.ashx?rnd="+Math.random(),data:"hospitalId="+n+"&extrasId="+t+"&packageId="+i+"&billingFrequencyId="+r+"&variationId="+u+"&discountId="+e+"&discountName="+o+"&promotionCode="+s,type:"get",dataType:"json",success:function(n){var t=f.children(".selector-pricing").find("li").first(),i;if(t.find("loading").length==0&&t.html("").append('<div class="loading"><\/div>'),i=n==null?null:n.Price,i!=null){var u=String(i).split("."),c=n.PaymentFrequencyText,l=n.RebateRateText;typeof o=="undefined"?o="":o!=""?n.DiscountText?(setDiscountError(f,n.DiscountText),o=""):(o=" & "+o,s!==""&&f.find(".promocodeError").html("")):s!=""&&n.DiscountText&&setDiscountError(f,n.DiscountText);var r=n.AgeBasedDiscountText,e="",h=" & ";o&&(h=", ");r!="0%"&&r!="0"&&(e=h+r+" Age Based Discount");t.html('from <span class="price">$'+u[0]+"<sup>."+u[1]+'*<\/sup><\/span><span class="frequency">'+c+"<\/span><small>*includes "+l+" rebate"+e+o+"<\/small>")}else clearQuotePrice(f)}})}function setDiscountError(n,t){n.length>0&&(t="Discount code for selected company is invalid",n.find(".promocodeError").html(MsgWrapper(t)),n.find(".DiscountIdTextBox").val(0),n.find(".DiscountNameTextBox").val(""))}function clearQuotePrice(n){var t=n.children(".selector-pricing").find("li").first();n.attr("data-hospitalid")||n.attr("data-extrasid")||n.attr("data-packageid")?t.html('<span class="noPriceLabel">Could not retrieve product price<\/span>'):t.html('<span class="noPriceLabel">Please select Hospital &amp; Extras or Package<\/span>')}function updateVariationIdHiddenFields(n,t,i){var r=n.find(".selector-pricing").find(".packageProductVariationHiddenFieldWrapper").find("input"),u=n.find(".selector-pricing").find(".hospitalProductVariationHiddenFieldWrapper").find("input"),e=n.find(".selector-pricing").find(".additionalPaymentDropDownList"),f=e.children(":selected").val();i!=null&&i!="0"?(r.val(f),u.val("")):t!=null&&t!="0"?(r.val(""),u.val(f)):(r.val(""),u.val(""))}function updateMyQuote(){var o=$("#BillingFrequencyDropDownList"),h=parseInt(o.val(),10),c=$("#ResidentialAddressStateDropDownList"),i=parseInt(c.val(),10),l=$("#IsParticipatingInGovernmentRebateDropDownList"),r=null,s=$("#RebateTierId"),n,u,f,e,t;s.val()<-1?r=null:(r=s.val(),$('input[name="rebateTier1"][value="'+r+'"]').prop("checked",!0));isNaN(i)&&(i=null);n=-2;n=$(".rebateRadio1:checked").val();l.val()=="No"&&(n=-1);(isNaN(n)||n<-1)&&(n=null);u="";f="";$("#actionMode").val()=="discount"&&(u=$(".promocode").val(),f="discount");e=$(".result");t=$("#price");e.append('<div class="loading"><\/div>');t.css("visibility","hidden");$.ajax({url:"/handlers/MyQuoteHandler.ashx?rnd="+Math.random(),data:{frequency:h,state:i,rebateTier:n,promotionCode:u,mode:f},type:"get",dataType:"json",success:function(n){var i,r;$("#promocodeAgree, #promocodeTC, #promocodeName").hide();n!=null&&(i=n.price.toString().split("."),t.html("$"+i[0]+"<sup>."+i[1]+"<\/sup>"),$("#futurePrice").html("<strong>$"+n.futurePrice+"<\/strong> /"+o.children("option:selected").text()),$("#coverState").html(n.state),$(".lifeStageTypeText").html(n.lifeStageTypeText));e.find(".loading").remove();t.css("visibility","visible");$("#spanPromoCodeName").html("");$("#promocodeTC").html("");$("#divPromocodeStartDate").hide();$("#divPromocodeEndDate").hide();$(".discountRelated").hide();$("#lblDiscountTermsAcceptance").html("");$(".promocodeError").html("");$("#spanPromoCodeName").data("Frequency","");$("#spanPromoCodeName").data("DiscountPeriodId","");$("#DiscountMessageLiteral").html("");$("#DiscountMessageLiteral2").html("");n!=null&&n.Discount!=null&&(n.Discount.Message==""?($("#spanPromoCodeName").html(n.Discount.Discount.Name),$("#promocodeTC").html("<p><strong>"+n.Discount.Discount.Name+" Terms & Conditions<\/strong><\/p>"+n.Discount.Discount.TermsAndConditions),$("#lblDiscountTermsAcceptance").html("I accept the "+n.Discount.Discount.Name+" Terms & Conditions"),$("#DiscountMessageLiteral").html(" and the "+n.Discount.Discount.Name),$("#DiscountMessageLiteral2").html(" and the "+n.Discount.Discount.Name),$(".discountRelated").show(),n.Discount.Discount.ContributionDiscountTypeId==DiscountType.TimeLimited?($("#spanPromoCodeName").data("Frequency",n.Discount.Discount.Frequency),$("#spanPromoCodeName").data("DiscountPeriodId",n.Discount.Discount.ContributionDiscountPeriodId),DiscountStartDateChangeHanlder(),DiscountEndDateChangeHandler(),$("#divPromocodeStartDate").show(),$("#divPromocodeEndDate").show()):($("#divPromocodeStartDate").hide(),$("#divPromocodeEndDate").hide())):$(".promocodeError").html(n.Discount.Message));r=$(".promocode").val();r!=""&&$(".promocode:not(.hidden)").addClass("x")}})}function DiscountStartDateChangeHanlder(){if($("#PromotionCodeTextBox").val()!=null){var n=$("#CoverStartPeriodDropDownList option:selected").val();n==CoverStartPeriod.NotSelected?$("#spanPromoCodeStartDate").html(""):n==CoverStartPeriod.SpecficDate?$("#spanPromoCodeStartDate").html($("#CoverStartDateTextBox").val()):$("#spanPromoCodeStartDate").html($("#CoverStartPeriodDropDownList option:selected").text())}}function DiscountEndDateChangeHandler(){var n,t;$("#PromotionCodeTextBox").val()!=null&&(n=$("#CoverStartPeriodDropDownList option:selected").val(),n==CoverStartPeriod.NotSelected&&$("#spanPromoCodeEndDate").html(""),n==CoverStartPeriod.SpecficDate?(t=CalculateDiscountEndDate($("#CoverStartDateTextBox").val().toDate(),$("#spanPromoCodeName").data("Frequency"),$("#spanPromoCodeName").data("DiscountPeriodId")),$("#spanPromoCodeEndDate").html(toDMY(t))):n==CoverStartPeriod.DateApplicaRecived?(t=CalculateDiscountEndDate(new Date,$("#spanPromoCodeName").data("Frequency"),$("#spanPromoCodeName").data("DiscountPeriodId")),$("#spanPromoCodeEndDate").html(toDMY(t))):n==CoverStartPeriod.DateDDSalaryDeduction&&$("#spanPromoCodeEndDate").html("Will be confirmed on processing application"))}function CalculateDiscountEndDate(n,t,i){return i==DiscountPeriod.Weeks?new Date(n.getFullYear(),n.getMonth(),n.getDate()+t*7):i==DiscountPeriod.Months?new Date(n.getFullYear(),n.getMonth()+t,n.getDate()):i==DiscountPeriod.Years?new Date(n.getFullYear()+t,n.getMonth(),n.getDate()):void 0}function titleGenderLogic(){$("#TitleDropDownList").change(function(){var t=$(this).val(),n=$("#GenderDropDownList").data("kendoDropDownList"),r=$("#FemaleIdsHiddenField").val().split(","),i;if(jQuery.inArray(t,r)!=-1){n.select(2);n.readonly(!0);return}if(i=$("#MaleIdsHiddenField").val().split(","),jQuery.inArray(t,i)!=-1){n.select(1);n.readonly(!0);return}n.select(0);n.readonly(!1)})}function hearAboutUsLogic(){setRepresentativeVisibility();$("#HowDidYouHearAboutUsDropDownList").change(function(){setRepresentativeValidation();setRepresentativeVisibility()})}function setRepresentativeVisibility(){var n=$("#RepresentativeCodeTextBox");$("#HowDidYouHearAboutUsDropDownList").val()=="1100"?(n.mask("aa-999"),$(".representativePanel").removeClass("hidden")):(n.val(""),$(".representativePanel").addClass("hidden"))}function setRepresentativeValidation(){var i=$("#HowDidYouHearAboutUsDropDownList"),t=i.val()=="1100",n=document.getElementById("RepresentativeCodeValidator");n.enabled=t;t||(n.isvalid=!0);ValidatorUpdateDisplay(n)}function saveApplicationPopup(){var t=$("#saveApplication"),n;t.length>0&&(n=t.kendoWindow({width:getPopupWidth(),modal:!0,visible:!1,appendTo:"#aspnetForm"}),$(".saveApplication").click(function(){return n.data("kendoWindow").open().center(),$("#ReturnToApplicationButton").click(function(){return n.data("kendoWindow").close(),!1}),$(".k-overlay").click(function(){n.data("kendoWindow").close()}),$("#SaveAndExitButton").click(function(){$(".cancelOverlay").show()}),!1}))}function cancelApplicationPopup(){var t=$("#cancelApplication"),n;t.length>0&&(n=t.kendoWindow({width:getPopupWidth(),modal:!0,visible:!1,appendTo:"#aspnetForm"}),$(".cancelApplication").click(function(){return n.data("kendoWindow").open().center(),$("#ReturnToApplicationButton").click(function(){return n.data("kendoWindow").close(),!1}),$(".k-overlay").click(function(){n.data("kendoWindow").close()}),$("#CancelAndExitButton").click(function(){$(".cancelOverlay").show()}),!1}))}function saveApplicationConfirmationPopup(){var t=$("#saveApplicationConfirmationPopup"),n;t.length>0&&(n=t.kendoWindow({width:getPopupWidth(),modal:!0,visible:!1,appendTo:"#aspnetForm"}),n.data("kendoWindow").open().center(),$("#CloseButton").click(function(){n.data("kendoWindow").close()}),$(".k-overlay").click(function(){n.data("kendoWindow").close()}))}function setFamilyMemberEligibilityRelationship(){var t=$("#FamilyMemberEligibilityRelationshipDropDownList"),n=$("#SingleCoverOnlyMessage"),i=$("#EligibilityRelationshipIdsRequiringSingleLifeStageTypeHiddenField").val().split(",");if(jQuery.inArray(t.val(),i)!=-1){n.removeClass(clsHiddenElement);return}n.addClass(clsHiddenElement)}function getRebatePercentage(){var i=$(".rebatePercentage"),r=$("#IsReceivingIncreasedGovernmentRebateDropDownList").val(),n=parseInt($("#AgeBracketDropDownList").val(),10),t=-2;$("#GovernmentRebateTierDropDownList").data()!=null&&(t=parseInt($("#GovernmentRebateTierDropDownList").data("kendoDropDownList").dataItem().value,10));r!="Yes"&&(n=0);$.ajax({url:"/Handlers/RebatePercentageHandler.ashx?rnd="+Math.random(),data:"ageBracket="+n+"&rebateTier="+t,type:"get",dataType:"json",success:function(n){i.html("<strong>"+n.rebate+"%<\/strong>");updateMyQuote()}})}function eligibilityLogic(){setEligibilityVisibility();setReferrerVisibility();$("#EligibilityDropDownList").change(function(){setEligibilityVisibility()});$("#HowDidYouHearAboutUsDropDownList").change(function(){setReferrerVisibility()});$("#FamilyMemberEligibilityRelationshipDropDownList").change(function(){setFamilyMemberEligibilityRelationship()});setFamilyMemberEligibilityRelationship()}function setReferrerVisibility(){$("#ReferrerMemberNumberTextBox").keyup(function(){this.value=this.value.replace(/[^0-9\.]/g,"")});var n=parseInt($("#HowDidYouHearAboutUsDropDownList").val(),10);n===3?($("#ReferrerSortedList").removeClass(clsHiddenElement),$("#ReferrerNameDiv").removeClass(clsHiddenElement)):($("#ReferrerSortedList").addClass(clsHiddenElement),$("#ReferrerNameDiv").addClass(clsHiddenElement),$("#ReferrerNameTextBox").val(""),$("#ReferrerMemberNumberTextBox").val(""))}function setEligibilityVisibility(){var n=$(".eligibility").find("ul"),t=n.children().not(".question"),i=parseInt($("#EligibilityDropDownList").val(),10);switch(i){case 1:t.addClass(clsHiddenElement);n.find("[data-id=1]").removeClass(clsHiddenElement);break;case 2:t.addClass(clsHiddenElement);n.find("[data-id=2]").removeClass(clsHiddenElement);break;case 3:t.addClass(clsHiddenElement);n.find("[data-id=3]").removeClass(clsHiddenElement);break;default:t.addClass(clsHiddenElement)}setEligibilityValidation(i)}function setEligibilityValidation(){}function emailAddressLogic(){$("#IsRegisterOnlineDropDownList").change(function(){setEmailAddressValidation()})}function setEmailAddressValidation(){var r=$("#IsRegisterOnlineDropDownList"),n=r.val()==="Yes",i=document.getElementById("EmailAddressRequiredFieldValidator"),t;i.enabled=n;n||(i.isvalid=!0);ValidatorUpdateDisplay(i);t=document.getElementById("ConfirmEmailAddressRequiredFieldValidator");t.enabled=n;n||(t.isvalid=!0);ValidatorUpdateDisplay(t)}function residentialAddressLogic(){var n=$("#ResidentialAddressStateDropDownList");n.change(function(){updateMyQuote()})}function postalAddressLogic(){$("#WorkPhoneNumberTextBox").mask("(99) 9999-9999");$("#HomePhoneNumberTextBox").mask("(99) 9999-9999");$("#MobilePhoneNumberTextBox").mask("9999-999-999");$("#IsPostalSameDropDownList").change(function(){setAddressVisibility()});setAddressVisibility()}function setAddressVisibility(){var n=$(".addressDetails").find("ul").eq(1);$("#IsPostalSameDropDownList").val()==="No"?(n.removeClass(clsHiddenElement),setAddressValidators(!1)):(n.addClass(clsHiddenElement),setAddressValidators(!0))}function setAddressValidators(n){document.getElementById("PostalAddressLine1RequiredFieldValidator").enabled=!n;document.getElementById("PostalAddressSuburbRequiredFieldValidator").enabled=!n;document.getElementById("PostalAddressStateCompareValidator").enabled=!n;document.getElementById("PostalAddressPostCodeRequiredFieldValidator").enabled=!n}function registerOnlineLogic(){var n=$(".termsConditions");$("#IsRegisterOnline").change(function(){$(this).val()==="Yes"?n.removeClass(clsHiddenElement):n.addClass(clsHiddenElement)})}function DisableButton(){var n=document.getElementById("AddMemberPendingHiddenField").value;return n!="0"?(alert("Please wait... "),!1):(Page_ClientValidate("MemberDetailsListValidation")&&(document.getElementById("AddMemberPendingHiddenField").value="1"),!0)}function RelationshipToMainMemberAgeCustomValidator_ClientValidate(n,t){var u=$("#RelationshipToMainMemberDropDownList"),e=$("#DateOfBirthTextBox");if(u.val()!="0"){var f=u.find(":selected").text(),r=f=="Spouse"||f=="Defacto",i=calculateAge(e.val());document.getElementById("DateOfBirthAgeCustomValidator").style.visibility="hidden";document.getElementById("RelationshipToMainMemberAgeCustomValidator").style.visibility="hidden";!r&&i>=18&&i<=24||i==0||r?(document.getElementById("RelationshipToMainMemberAgeCustomValidator").style.visibility="hidden",document.getElementById("DateOfBirthAgeCustomValidator").style.visibility="hidden",t.IsValid=!0):!r&&i>24&&i!=0&&(document.getElementById("RelationshipToMainMemberAgeCustomValidator").style.visibility="visible",document.getElementById("DateOfBirthAgeCustomValidator").style.visibility="hidden",t.IsValid=!1)}}function MemberDateOfBirthAgeCustomValidator_ClientValidate(n,t){var u=$("#RelationshipToMainMemberDropDownList"),e=$("#DateOfBirthTextBox");if(u.val()!="0"){var f=u.find(":selected").text(),r=f=="Spouse"||f=="Defacto",i=calculateAge(e.val());document.getElementById("DateOfBirthAgeCustomValidator").style.visibility="hidden";document.getElementById("RelationshipToMainMemberAgeCustomValidator").style.visibility="hidden";!r&&i>=18&&i<=24||i==0||r?(document.getElementById("DateOfBirthAgeCustomValidator").style.visibility="hidden",document.getElementById("RelationshipToMainMemberAgeCustomValidator").style.visibility="hidden",t.IsValid=!0):!r&&i>24&&i!=0&&(document.getElementById("DateOfBirthAgeCustomValidator").style.visibility="visible",document.getElementById("RelationshipToMainMemberAgeCustomValidator").style.visibility="hidden",t.IsValid=!1)}}function memberDetailsLogic(){function o(){if(n.val()!="0"){var t=n.find(":selected").text(),i=t=="Spouse"||t=="Defacto";i?(e.removeClass(clsHiddenElement),createWindowPopup(),document.getElementById("IsPartnerCbaEmployeeCompareValidator").enabled=!0):(e.addClass(clsHiddenElement),document.getElementById("IsPartnerCbaEmployeeCompareValidator").enabled=!1)}}function s(){if(n.val()!="0"){var t=n.find(":selected").text(),o=t=="Spouse"||t=="Defacto",e=calculateAge(u.val());!o&&e>=18&&e<=24?(f.removeClass(clsHiddenElement),createWindowPopup(),r(!0)):(f.add(i).addClass(clsHiddenElement),r(!1))}}function r(n){n?(i.removeClass(clsHiddenElement),h(!0)):(i.addClass(clsHiddenElement),h(!1))}function h(n){document.getElementById("InstitutionNameRequiredFieldValidator").enabled=n;document.getElementById("InstitutionPhoneRequiredFieldValidator").enabled=n;document.getElementById("IsDeclaringInformationCorrectCustomValidator").enabled=n}var t=$(".memberDetails"),c=$("#IsCbhsPrestigeWithNonStudentDependantsHiddenField"),n=$("#RelationshipToMainMemberDropDownList"),u=$("#DateOfBirthTextBox"),f=t.find("[data-studentEligible=true]"),i=t.find("[data-isStudent=true]"),e=t.find("[data-spousalAuthority=true]");formStylingGlobal();c.val()=="False"?(n.change(function(){s();o()}),u.blur(function(){s()}),r(!1)):n.change(function(){o()})}function AddMemberDetailsLogic(){var t=$("#IsTransferringFromFundDropDownList"),i=$("#IsSameMemeberShipDropDownList"),n=$(".coverDetails"),r=n.find("[data-samememebership=false]"),u=n.find('[data-isauthorise="false"]'),f=n.find("[data-HasHadHospitalCoverForLifetimeHealthCover=true]"),e=n.find("[data-lifetimehealthcover=false]");t.val()=="Yes"&&i.val()=="No"&&($("#IsSameMemeberShipDropDownList").val("0"),r.addClass(clsHiddenElement),u.addClass(clsHiddenElement),f.addClass(clsHiddenElement),e.addClass(clsHiddenElement),document.getElementById("IsSameMemeberShipCompareValidator").enabled=!0)}function coverDetailsLogic(){function it(){document.getElementById("IsSameMemeberShipCompareValidator").enabled=!1;document.getElementById("TransferFromHealthFundCompareValidator").enabled=!1;document.getElementById("IsAuthoriseCompareValidator").enabled=!1;document.getElementById("HasPreviouslyHeldPrivateHealthInsuranceCompareValidator").enabled=!1;v.addClass(clsHiddenElement);b.addClass(clsHiddenElement);u.addClass(clsHiddenElement);w.addClass(clsHiddenElement);f.addClass(clsHiddenElement);k.addClass(clsHiddenElement);e.addClass(clsHiddenElement);i.addClass(clsHiddenElement);r.addClass(clsHiddenElement);p.addClass(clsHiddenElement);y.addClass(clsHiddenElement)}function c(n){var t="Which health fund are you transferring from?";return n||(t="Please specify the last private health insurer you held cover with"),t}function d(){document.getElementById("IsSameMemeberShipCompareValidator").enabled=!1;document.getElementById("TransferFromHealthFundCompareValidator").enabled=!1;document.getElementById("IsAuthoriseCompareValidator").enabled=!1;t.val()=="Yes"&&a.val()=="Yes"?(v.removeClass(clsHiddenElement),w.addClass(clsHiddenElement),u.removeClass(clsHiddenElement),f.removeClass(clsHiddenElement),b.removeClass(clsHiddenElement),document.getElementById("IsSameMemeberShipCompareValidator").enabled=!0,document.getElementById("TransferFromHealthFundCompareValidator").enabled=!0,document.getElementById("IsAuthoriseCompareValidator").enabled=!0):t.val()=="Yes"&&a.val()=="No"?(u.removeClass(clsHiddenElement),v.addClass(clsHiddenElement),w.removeClass(clsHiddenElement),f.addClass(clsHiddenElement),b.removeClass(clsHiddenElement),document.getElementById("RefreshPreviousCoverMemberDetailUpdatePanel").style.display="inline",document.getElementById("IsSameMemeberShipCompareValidator").enabled=!0,document.getElementById("TransferFromHealthFundCompareValidator").enabled=!1,document.getElementById("IsAuthoriseCompareValidator").enabled=!0):t.val()=="Yes"&&(u.removeClass(clsHiddenElement),document.getElementById("IsSameMemeberShipCompareValidator").enabled=!0)}function g(){t.val()=="No"&&(o.val()=="Yes"?(r.addClass(clsHiddenElement),i.addClass(clsHiddenElement),f.removeClass(clsHiddenElement),h.innerHTML=c(!1),y.removeClass(clsHiddenElement),e.removeClass(clsHiddenElement),document.getElementById("TransferFromHealthFundCompareValidator").enabled=!0,document.getElementById("RefreshPreviousCoverMemberDetailUpdatePanel").style.display="none"):o.val()=="No"&&(r.addClass(clsHiddenElement),i.removeClass(clsHiddenElement),f.addClass(clsHiddenElement),y.addClass(clsHiddenElement),e.addClass(clsHiddenElement),document.getElementById("TransferFromHealthFundCompareValidator").enabled=!1,document.getElementById("RefreshPreviousCoverMemberDetailUpdatePanel").style.display="none"))}function nt(){it();t.val()=="Yes"?(u.removeClass(clsHiddenElement),k.addClass(clsHiddenElement),document.getElementById("HasPreviouslyHeldPrivateHealthInsuranceCompareValidator").enabled=!1):t.val()=="No"&&(v.addClass(clsHiddenElement),u.addClass(clsHiddenElement),k.removeClass(clsHiddenElement),document.getElementById("HasPreviouslyHeldPrivateHealthInsuranceCompareValidator").enabled=!0,document.getElementById("RefreshPreviousCoverMemberDetailUpdatePanel").style.display="none")}function l(){t.val()=="Yes"?a.val()=="Yes"?e.removeClass(clsHiddenElement):e.addClass(clsHiddenElement):t.val()=="No"&&(document.getElementById("RefreshPreviousCoverMemberDetailUpdatePanel").style.display="none",o.val()=="Yes"?(s.val()=="No"&&(r.addClass(clsHiddenElement),i.removeClass(clsHiddenElement)),s.val()=="Yes"&&(r.removeClass(clsHiddenElement),i.addClass(clsHiddenElement))):o.val()=="No"&&(s.val()=="No"&&(i.addClass(clsHiddenElement),r.removeClass(clsHiddenElement)),s.val()=="Yes"&&(r.addClass(clsHiddenElement),i.removeClass(clsHiddenElement))))}function tt(){t.val()=="Yes"?p.removeClass(clsHiddenElement):p.addClass(clsHiddenElement)}var n=$(".coverDetails"),f=n.find("[data-transferringfund=true]"),e=n.find("[data-HasHadHospitalCoverForLifetimeHealthCover=true]"),p=n.find("[data-lifetimehealthcover=false]"),t=$("#IsTransferringFromFundDropDownList"),a=$("#IsSameMemeberShipDropDownList"),u=n.find("[data-issamememebership=false]"),v=n.find("[data-samememebership=true]"),w=n.find("[data-samememebership=false]"),b=n.find('[data-isauthorise="false"]'),rt=$("#lhcDisclaimer"),k=n.find("[data-transferringfund=false]"),i=n.find("[data-hospitalcover=false]"),r=n.find("[data-hospitalcover=true]"),o=$("#HasPreviouslyHeldHealthInsuranceDropDownList"),s=$("#HasHadHospitalCoverForLifetimeHealthCoverDropDownList"),h=document.getElementById("TransferFromHealthFundLabel"),y;h.innerHTML=c(!0);y=n.find("[data-lifetimehealthcover=true]");t.change(function(){h.innerHTML=c(!0);nt();d();g();tt();l()});a.change(function(){h.innerHTML=c(!0);d();l()});o.change(function(){h.innerHTML=c(!0);g();l()});s.change(function(){l()});nt();d();tt();l();g()}function refreshForm(n){memberDetailsLogic();titleGenderLogic();createDatePicker();createDateMask();n=="1"&&($("#RefreshPreviousCoverMemberDetailsTableId").click(),document.getElementById("AddMemberPendingHiddenField").value="0")}function RebateDetailsDeclarationRebateValidator_ClientValidate(n,t){$("#ChkRebateDetailsDeclaration").prop("checked")?(t.IsValid=!0,$("#ChkRebateDetailsDeclaration").parent().removeClass("validation-failed")):(t.IsValid=!1,$("#ChkRebateDetailsDeclaration").parent().addClass("validation-failed"))}function ValidToRebateValidator_ClientValidate(n,t){if($("#MedicareValidToText").val()!=""){var r=$("#MedicareValidToText").val(),i=r.split("/"),u=new Date(i[1],+i[0]-1),f=new Date;u>f?(t.IsValid=!0,$("#MedicareValidToText").removeClass("validation-failed")):(t.IsValid=!1,$("#MedicareValidToText").addClass("validation-failed"))}else t.IsValid=!1,$("#MedicareValidToText").addClass("validation-failed")}function ValidateMedicare_ClientValidate(n,t){$.ajax({async:!1,cache:!1,url:"/handlers/MedicareValidationHandler.ashx",data:{MedicareNumber:$("#MedicareNumberText").val()},type:"get",dataType:"json",success:function(n){n==!0?(t.IsValid=!0,$("#MedicareNumberText").removeClass("validation-failed")):(t.IsValid=!1,$("#MedicareNumberText").addClass("validation-failed"))}})}function PhoneNumber_ClientValidate(n,t){t.IsValid=$("#MobileTextBox").val().length>0?!0:$("#HomePhoneTextBox").val().length>0?!0:$("#WorkPhoneTextBox").val().length>0?!0:!1}function memberRebatePopulateLogic(){$("#IsRebateRegistered").val().toUpperCase()==="TRUE"?$rebateUpdateDropDownList.val()==1?($divUpdateRebate.removeClass(clsHiddenElement),$divStopRebate.addClass(clsHiddenElement),setGrid(),$("#rebateExistingContribution").text("Same as Above")):$rebateUpdateDropDownList.val()==2?($divUpdateRebate.addClass(clsHiddenElement),$divStopRebate.removeClass(clsHiddenElement)):($divUpdateRebate.addClass(clsHiddenElement),$divStopRebate.addClass(clsHiddenElement)):($("#rebateExistingContribution1").text(""),setGrid1())}function setGrid1(){$("#kendoGrid1").append($historyGrid1.kendoGrid({dataSource:{transport:{read:{url:"/handlers/rebatetierhandler.ashx",dataType:"Json"}},serverPaging:!1,serverFiltering:!1,serverSorting:!1,server:!0},filterable:!1,sortable:!1,pageable:!1,columns:[{field:"RebateTierSelected",title:"Applicable Rebate %",template:"<label style='margin-left:0.5px'> #=kendo.toString(TierText)# <\/label> <input type='radio' runat='server' class='rebateRadio1' name='rebateTier1' value='#=Tier#'/>"},{field:"Under65",title:"Under 65"},{field:"From65To69",title:"65-69"},{field:"Plus70",title:"70+"},{field:"SingleIncome",title:"Single Income Threshold"},{field:"FamilyIncome",title:"Couple/Family Income Threshold"}]}))}function declareTermsAndConditionsAgreeRebateValidator_ClientValidate(n,t){$("#DeclareRebate").prop("checked")?(t.IsValid=!0,$("#DeclareRebate").parent().removeClass("validation-failed")):(t.IsValid=!1,$("#DeclareRebate").parent().addClass("validation-failed"))}function residentialAddressLogic(){var n=$("#ResidentialAddressStateDropDownList");n.change(function(){updateMyQuote()})}function postalAddressLogic(){$("#WorkPhoneNumberTextBox").mask("(99) 9999-9999");$("#HomePhoneNumberTextBox").mask("(99) 9999-9999");$("#MobilePhoneNumberTextBox").mask("9999-999-999");$("#IsPostalSameDropDownList").change(function(){setAddressVisibility()});setAddressVisibility()}function setAddressVisibility(){var n=$(".addressDetails").find("ul").eq(1);$("#IsPostalSameDropDownList").val()=="No"?(n.removeClass(clsHiddenElement),setAddressValidators(!1)):(n.addClass(clsHiddenElement),setAddressValidators(!0))}function setAddressValidators(n){document.getElementById("PostalAddressLine1RequiredFieldValidator").enabled=!n;document.getElementById("PostalAddressSuburbRequiredFieldValidator").enabled=!n;document.getElementById("PostalAddressStateCompareValidator").enabled=!n;document.getElementById("PostalAddressPostCodeRequiredFieldValidator").enabled=!n}function rebateDetailsLogic(){function u(){var n=0;$rebateTier.val()!=null&&(n=$rebateTier.val());$("#RebateTierSelected1").val(n);$('#gridRebate1 input[name="rebateTier1"][value="'+$("#RebateTierSelected1").val()+'"]').prop("checked",!0)}function t(){$isNotPeopleCovered.addClass(clsHiddenElement);$divNotCovered.addClass(clsHiddenElement);$isParticipatingInGovernmentRebateDropDownList.val()=="Yes"?($participatingInGovernmentRebate=!0,$cntrMedicareDetails.removeClass(clsHiddenElement),$rebateapplicationvisibility.removeClass(clsHiddenElement),f()):$isParticipatingInGovernmentRebateDropDownList.val()=="No"?($participatingInGovernmentRebate=!1,$cntrRebateDetails.addClass(clsHiddenElement),$cntrMedicareDetails.addClass(clsHiddenElement),$rebateapplicationvisibility.addClass(clsHiddenElement),e()):$participatingInGovernmentRebate=null}function i(){$isNotPeopleCovered.addClass(clsHiddenElement);$isCoveredByPolicyList.val()=="Yes"?($divCoverByPolicy.removeClass(clsHiddenElement),$divNotCovered.addClass(clsHiddenElement)):$isCoveredByPolicyList.val()=="No"?($divCoverByPolicy.addClass(clsHiddenElement),$divNotCovered.removeClass(clsHiddenElement)):($divCoverByPolicy.addClass(clsHiddenElement),$divNotCovered.addClass(clsHiddenElement))}function r(){$isCoveredByPolicyList.val()=="Yes"&&$isAllPeopleCoveredDropDownList.val()=="Yes"?($isAllFieldCovered.removeClass(clsHiddenElement),$isNotPeopleCovered.addClass(clsHiddenElement),$divNotCovered.addClass(clsHiddenElement)):$isCoveredByPolicyList.val()=="Yes"&&$isAllPeopleCoveredDropDownList.val()=="No"?($isAllFieldCovered.addClass(clsHiddenElement),$isNotPeopleCovered.removeClass(clsHiddenElement),$divNotCovered.addClass(clsHiddenElement)):($isAllFieldCovered.addClass(clsHiddenElement),$isNotPeopleCovered.removeClass(clsHiddenElement),$divNotCovered.removeClass(clsHiddenElement))}function f(){$priceAsterisk.removeClass(clsHiddenElement);$priceAsteriskInfo.removeClass(clsHiddenElement)}function e(){$participatingInGovernmentRebate==!1&&$cntrRebatePercentage.html("<strong>0%<\/strong>")}function n(){var t=$isParticipatingInGovernmentRebateDropDownList.val()=="Yes",i,n,r;document.getElementById("IsCoveredByCompareValidator").enabled=t;i=$isCoveredByPolicyList.val()=="Yes";document.getElementById("MedicareCardNumberCustomValidator").enabled=i&t;document.getElementById("MedicareNumberTextRequiredFieldValidator").enabled=i&t;document.getElementById("RefNumberTextBoxRequiredFieldValidator").enabled=i&t;document.getElementById("ValidToRequiredFieldValidator").enabled=i&t;document.getElementById("GivenNameValidator").enabled=i&t;document.getElementById("SurnameValidator").enabled=i&t;document.getElementById("IsAllPeopleCoveredCompareValidator").enabled=i&t;n=$isAllPeopleCoveredDropDownList.val()=="Yes";document.getElementById("ResidentialAddressLine1ForLookupRequiredFieldValidator").enabled=n;document.getElementById("ResidentialAddressLine1Validator").enabled=n;document.getElementById("ResidentialAddressSuburbRequiredFieldValidator").enabled=n;document.getElementById("ResidentialAddressSuburbForLookupRequiredFieldValidator").enabled=n;document.getElementById("ResidentialAddressStateForLookupCompareValidator").enabled=n;document.getElementById("ResidentialAddressPostCodeRequiredFieldValidator").enabled=n;document.getElementById("ResidentialAddressPostCodeRegularExpressionValidator").enabled=n;document.getElementById("ResidentialAddressPostCodeForLookupRequiredFieldValidator").enabled=n;document.getElementById("IsPostalSameCompareValidator").enabled=n;r=$isPostalSameDropDownList.val()=="No";document.getElementById("PostalAddressLine1RequiredFieldValidator").enabled=n&r;document.getElementById("PostalAddressSuburbRequiredFieldValidator").enabled=n&r;document.getElementById("PostalAddressStateCompareValidator").enabled=n&r;document.getElementById("PostalAddressPostCodeRequiredFieldValidator").enabled=n&r;document.getElementById("PostalAddressPostCodeRegularExpressionValidator").enabled=n&r;document.getElementById("ChkRebateRegisterSelectedCustomValidator").enabled=n;document.getElementById("RebateDetailsTermsAndConditionsAgreeCustomValidator").enabled=n&i&t}$("#MedicareCardNumberTextBox").mask("9999-99999-9");window.setTimeout(u,1e3);$isParticipatingInGovernmentRebateDropDownList.change(function(){t();n();updateMyQuote()});$isCoveredByPolicyList.change(function(){i();n()});$isAllPeopleCoveredDropDownList.change(function(){r();n()});t();i();n();getRebatePercentage();r()}function RebateDetailsSelectedRebateValidator_ClientValidate(n,t){$("#RebateTierSelected1").val()!=""?(t.IsValid=!0,$("#gridRebate1").removeClass("validation-failed")):(t.IsValid=!1,$("#gridRebate1").addClass("validation-failed"))}function paymentDetailsLogic(){function t(){var t=parseInt($paymentMethodDropDownList.val(),10);switch(t){case 1:$paymentMethodInvoice.add($paymentMethodSalaryDeduction).add($paymentMethodCreditCard).addClass(clsHiddenElement);$paymentMethodDirectDebit.removeClass(clsHiddenElement);$bankAccountMessage.removeClass(clsHiddenElement);$invoiceMessage.addClass(clsHiddenElement);n($debitFrequencyDropDownList);setPaymentOfBenefitsElementsEnabled(!0);changeCoverStartPeriodDropDown();break;case 2:$paymentMethodDirectDebit.add($paymentMethodSalaryDeduction).add($paymentMethodCreditCard).addClass(clsHiddenElement);$paymentMethodInvoice.removeClass(clsHiddenElement);$bankAccountMessage.addClass(clsHiddenElement);$invoiceMessage.removeClass(clsHiddenElement);n($invoiceFrequencyDropDownList);setPaymentOfBenefitsElementsEnabled(!0);clearDirectDebitFields();changeCoverStartPeriodDropDown();break;case 3:$paymentMethodDirectDebit.add($paymentMethodInvoice).add($paymentMethodCreditCard).addClass(clsHiddenElement);$paymentMethodSalaryDeduction.removeClass(clsHiddenElement);$bankAccountMessage.addClass(clsHiddenElement);$invoiceMessage.addClass(clsHiddenElement);setPaymentOfBenefitsElementsEnabled(!0);clearDirectDebitFields();changeCoverStartPeriodDropDown();break;case 4:$paymentMethodInvoice.add($paymentMethodSalaryDeduction).add($paymentMethodDirectDebit).add($bankAccountMessage).addClass(clsHiddenElement);$bankAccountMessage.addClass(clsHiddenElement);$paymentMethodCreditCard.removeClass(clsHiddenElement);$invoiceMessage.addClass(clsHiddenElement);checkStartDay($startDayDropDownList.val());break;default:$paymentMethodDirectDebit.add($paymentMethodInvoice).add($paymentMethodSalaryDeduction).add($bankAccountMessage).add($invoiceMessage).add($paymentMethodCreditCard).addClass(clsHiddenElement)}$sameAsDirectDebit.parent().removeClass("checked");r(t);i();$("#CoverStartPeriodDropDownList").kendoDropDownList().data()!=null&&$coverSelectData==null&&($coverSelectData=$("#CoverStartPeriodDropDownList").kendoDropDownList().data().kendoDropDownList.dataSource.data());$cbxDiscountTermsAcceptance.change(function(){this.checked?$hiddenDiscountTerms.val("1"):$hiddenDiscountTerms.val("0")});$hiddenDiscountTerms.val()=="1"?$cbxDiscountTermsAcceptance.prop("checked",!0):$cbxDiscountTermsAcceptance.prop("checked",!1)}function r(n){document.getElementById("DirectDebitFrequencyCompareValidator").enabled=n==1;document.getElementById("DirectDebitBsbNumberRequiredFieldValidator").enabled=n==1;document.getElementById("DirectDebitBsbNumberCustomValidator").enabled=n==1;document.getElementById("DirectDebitBsbNumberRegularExpressionValidator").enabled=n==1;document.getElementById("DirectDebitAccountNumberRequiredFieldValidator").enabled=n==1;document.getElementById("DirectDebitAccountNameRequiredFieldValidator").enabled=n==1;document.getElementById("DirectDebitHasAllowedFundsDebitCustomValidator").enabled=n==1;document.getElementById("InvoicePaymentPeriodCompareValidator").enabled=n==2;document.getElementById("SalaryDeductionEmployeeNumberFieldValidator").enabled=n==3;document.getElementById("SalaryDeductionHasAcceptedEmployerDeductionsCustomValidator").enabled=n==3}function i(){var i=parseInt($paymentMethodDropDownList.val(),10),n=i==1,t=$sameAsDirectDebit.val();document.getElementById("BenefitPaymentsBsbNumberRequiredFieldValidator").enabled=n&&!t;document.getElementById("BenefitPaymentsBsbNumberCustomValidator").enabled=n&&!t;document.getElementById("BenefitPaymentsBsbNumberRegularExpressionValidator").enabled=n&&!t;document.getElementById("BenefitPaymentsAccountNumberRequiredFieldValidator").enabled=n&&!t;document.getElementById("BenefitPaymentsAccountNameRequiredFieldValidator").enabled=n&&!t}function n(n){var t=$(n).find("option:selected").text();t=t=="Monthly - 15th"?"Monthly":t;$billingFrequencyDropDownList.data("kendoDropDownList")!=null&&($billingFrequencyDropDownList.data("kendoDropDownList").select(function(n){return n.text===t}),$billingFrequencyDropDownList.change(),$billingFrequencyDropDownList.data("kendoDropDownList").readonly())}$directDebitBsb.mask("999-999");$paymentMethodDropDownList.change(function(){var n=parseInt($paymentMethodDropDownList.val(),10);n==4?$creditCardSelectedMessage.removeClass(clsHiddenElement):$creditCardSelectedMessage.addClass(clsHiddenElement);t()});$debitFrequencyDropDownList.change(function(){n(this)});$invoiceFrequencyDropDownList.change(function(){n(this)});$frequencyOfPaymentDropDownList.change(function(){n(this)});$directDebitBsb.blur(function(){getBankDetailsByBSB($directDebitBsb,$directDebitPaymentsBankDetails)});$sameAsDirectDebit.change(function(){i()});$startDayDropDownList.change(function(){checkStartDay($(this).val())});t();getBankDetailsByBSB($directDebitBsb,$directDebitPaymentsBankDetails)}function paymentCoverDetailsLogic(){function t(){var n=parseInt($paymentMethodDropDownList.val(),10);document.getElementById("SalaryDeductionHasAcceptedEmployerDeductionsCustomValidator").enabled=n==3}function i(){var t=parseInt($coverStartPeriodDropDownList.val(),10);t==3?n.removeClass(clsHiddenElement):n.addClass(clsHiddenElement);document.getElementById("CoverStartDateRequiredFieldValidator").enabled=t==3;document.getElementById("CoverStartDateRegularExpressionValidator").enabled=t==3;document.getElementById("CoverStartDatePeriodCustomValidator").enabled=t==3}var n=$cntrPaymentCoverDetails.find('[data-specifyCoverStartDate="true"]');$paymentMethodDropDownList.change(function(){t()});$coverStartPeriodDropDownList.change(function(){i()});t();i()}function paymentBenefitsLogic(){function n(){$sameAsDirectDebit.is(":checked")?setPaymentOfBenefitsElementsEnabled(!1):setPaymentOfBenefitsElementsEnabled(!0)}$benefitPaymentsBsbNumber.mask("999-999");$sameAsDirectDebit.change(function(){n()});$benefitPaymentsBsbNumber.blur(function(){getBankDetailsByBSB($benefitPaymentsBsbNumber,$bankDetails_paymentBenefits)});$updateBenefitPayments.blur(function(){$sameAsDirectDebit.is(":checked")&&copyDirectDebitDetailsToBenefitPaymentDetails()});n();getBankDetailsByBSB($benefitPaymentsBsbNumber,$bankDetails_paymentBenefits)}function copyDirectDebitDetailsToBenefitPaymentDetails(){$benefitPaymentsBsbNumber.val($directDebitPaymentsBsbNumber.val());$benefitPaymentsAccountNumber.val($directDebitPaymentsAccountNumber.val());$benefitPaymentsAccountName.val($directDebitPaymentsAccountName.val());$benefitPaymentsBankDetails.html($directDebitPaymentsBankDetails.html())}function setPaymentOfBenefitsElementsEnabled(n){n?($benefitPaymentsBsbNumber.removeAttr("disabled"),$benefitPaymentsAccountNumber.removeAttr("disabled"),$benefitPaymentsAccountName.removeAttr("disabled")):($benefitPaymentsBsbNumber.attr("disabled","disabled"),$benefitPaymentsAccountNumber.attr("disabled","disabled"),$benefitPaymentsAccountName.attr("disabled","disabled"),copyDirectDebitDetailsToBenefitPaymentDetails())}function clearBenefitsFields(){$benefitPaymentsBsbNumber.add($benefitPaymentsAccountNumber).add($benefitPaymentsAccountName).val("");$benefitPaymentsBankDetails.html("")}function clearDirectDebitFields(){$directDebitPaymentsBsbNumber.add($directDebitPaymentsAccountNumber).add($directDebitPaymentsAccountName).val("");$directDebitPaymentsBankDetails.html("")}function changeCoverStartPeriodDropDown(){var t=parseInt($paymentMethodDropDownList.val(),10),n=$("#CoverStartPeriodDropDownList").kendoDropDownList();n!=undefined&&(n.data().kendoDropDownList.dataSource.serverFiltering=!0,t!=2&&n.data().kendoDropDownList.setDataSource($coverSelectData))}function clearDiscountTermsCheckbox(n){$(n).keypress(function(){$hiddenDiscountTerms.val("0");$cbxDiscountTermsAcceptance.parent().removeClass("checked");$cbxDiscountTermsAcceptance.prop("checked",!1)});$(n).keyup(function(n){(n.keyCode==8||n.keyCode==46)&&($hiddenDiscountTerms.val("0"),$cbxDiscountTermsAcceptance.parent().removeClass("checked"),$cbxDiscountTermsAcceptance.prop("checked",!1))});$(n).bind("paste",function(){$hiddenDiscountTerms.val("0");$cbxDiscountTermsAcceptance.parent().removeClass("checked");$cbxDiscountTermsAcceptance.prop("checked",!1)})}function checkStartDay(n){checkStartDayForAllMonths(n);checkStartDayForFebMonth(n)}function checkStartDayForAllMonths(n){n=="31"?$StartDayMessageForAllMonths.removeClass(clsHiddenElement):$StartDayMessageForAllMonths.addClass(clsHiddenElement)}function checkStartDayForFebMonth(n){n=="29"||n=="30"?$StartDayMessageForFebMonth.removeClass(clsHiddenElement):$StartDayMessageForFebMonth.addClass(clsHiddenElement)}function CCPaymentLogic(){adjustMessageBoxPosition();adjustCCUI()}function overrideButtonHandler(){var n=$("#CCSubmitLinkButton"),t=n[0].onclick;n[0].onclick=null;n.click(function(n){return check()?t(n):(validationSummary(),!1)})}function isCreditCardDebitTermsChecked(n,t){t.IsValid=$("#HasConfirmedCreditCardDebitTermsCheckBox").is(":checked")}function adjustMessageBoxPosition(){var u=$("#CreditCardApplicationCompleteDiv"),f=$("#application-complete-message").parents(".sf_cols"),n,t,i,r;u.length>0&&f.length>0&&u.html(f);n=$("#CreditCardRebateAddedSectionDiv");t=$("#application-complete-rebate-section");n.length>0&&t.length>0&&n.html(t);i=$("#CreditCardFormSectionDiv");r=$("#application-complete-forms-section");i.length>0&&r.length>0&&i.html(r)}function adjustCCUI(){var n=$("#CreditCardUIContainerDiv"),t=$("#CCViewRaw"),r=$(".credit-card-start-day-container"),u=$(".credit-card-debit-date-container"),i;t.length>0&&(overrideButtonHandler(),n.html(t.val()),t.val(""),n.find("li:first-child").after("<li> <\/li>").after("<li> <\/li>"),n.find("li:eq(1)").append(r),n.find("li:eq(2)").append(u),n.find("script").each(function(index,element){eval(element.innerHTML)}),i=t.closest("form"),i.removeData("unobtrusiveValidation"),$.validator.unobtrusive.parse(i),validationSummary())}function validationSummary(){var r=$("#CreditCardUIContainerDiv"),t=$(".errorPanel"),i=[],n;r.find(".field-validation-error").each(function(){var n=$(this),t=n.text().trim();t.length>0&&n.is(":visible")&&i.push(t)});i.length>0&&(n=t.find("ul"),n.length?n.empty():(t.append("The following errors have occurred processing the form. <ul> <\/ul>"),n=t.find("ul")),i.forEach(function(t){n.append("<li> "+t+" <\/li>")}),t.show())}function check(){var t=$("#CCViewRaw"),n;return t.length>0?(n=t.closest("form"),n.validate(),n.valid()):!0}function checkLifeStageSelected(n,t){t.IsValid=$(".lifeStageType").find("input").is(":checked")}function isOnePhoneNumberEntered(n,t){var i=$("#HomePhoneNumberTextBox"),r=$("#WorkPhoneNumberTextBox"),u=$("#MobilePhoneNumberTextBox");t.IsValid=i.val()!=""||r.val()!=""||u.val()!=""}function isMemberAgreementChecked(n,t){var i=$("#IsStudentDependantHiddenField"),r=i.val()=="Yes";t.IsValid=!r||$("#IsDeclaringInformationCorrectCheckBox").is(":checked")}function isAllowedFundsDebitChecked(n,t){t.IsValid=$("#DirectDebitHasAllowedFundsDebitCheckBox").is(":checked")}function isHasAcceptedEmployerDeductionsChecked(n,t){t.IsValid=$("#SalaryDeductionHasAcceptedEmployerDeductionsCheckBox").is(":checked")}function isCoverStartDateWithinOneMonth(n,t){var r,i;if(t.IsValid=!0,r=$("#CoverStartPeriodDropDownList").val(),r==3)if(i=$("#CoverStartDateTextBox").val(),i!=""){var f=moment(i,"DD/MM/YYYY"),e=moment(),o=f.diff(e,"days"),u=o/30;t.IsValid=u>=-1&&u<=1}else t.IsValid=!1}function isDateOfBirthWithinOneMonth(n,t){var i=$("#DateOfBirthTextBox").val();if(i!=""){var u=moment(i,"DD/MM/YYYY"),f=moment(),e=u.diff(f,"days"),r=e/60;t.IsValid=r>=-1&&r<=2}else t.IsValid=!1}function isConfirmedDeclarationChecked(n,t){t.IsValid=$("#HasConfirmedDeclarationCheckBox").is(":checked")}function isConfirmedPrivacyCollectionChecked(n,t){t.IsValid=$("#HasConfirmedPrivacyCollectionDeclarationCheckBox").is(":checked")}function isDiscountValidatorDeclarationChecked(n,t){console.log("In isDiscountValidatorDeclarationChecked");t.IsValid=$("#cbxDiscountTermsAcceptance").is(":visible")?$("#cbxDiscountTermsAcceptance").is(":checked"):!0}function initializeProviderSearchMap(){if(providerSearchResultData!=""&&providerSearchResultData!=null){var n={zoom:10,center:new google.maps.LatLng(-33.9,151.2)};map=new google.maps.Map(document.getElementById("map-canvas"),n)}}function setMapMarkers(n,t){var e={url:"/site.resource/images/mapMarker.png",size:new google.maps.Size(20,32),origin:new google.maps.Point(0,0),anchor:new google.maps.Point(0,32)},o={coord:[1,1,1,20,18,20,18,1],type:"poly"},u=new google.maps.LatLngBounds,r;for(clearMarkers(),r=0;r<t.length;r++){var i=t[r],f=new google.maps.LatLng(i.Latitude,i.Longitude),s=new google.maps.Marker({position:f,map:n,icon:e,shape:o,title:i.FullName+". Address: "+i.AddressLine1+". Phone: "+(i.Phone==undefined?"":i.Phone),zIndex:r});markers.push(s);u.extend(f)}n.fitBounds(u)}function clearMarkers(){for(var n=0;n<markers.length;n++)markers[n].setMap(null);markers=[]}function createProviderSearchGrid(){if(providerSearchResultData!=""&&providerSearchResultData!=null){var n=$("#providerSearch");$(".k-grid .k-grid-header").hide();n.kendoGrid({dataSource:{data:providerSearchResultData,pageSize:20},dataBound:onProviderSearchGridDataBound,filterable:!1,sortable:!1,pageable:{pageSize:providerSearchResultGridPageSize,messages:{first:"",last:"",next:"&raquo;",previous:"&laquo;"}},rowTemplate:kendo.template($("#providerSearchResults").html())})}}function onProviderSearchGridDataBound(){var t=$("#providerSearch").data("kendoGrid"),i=t.dataSource.page(),n=(i-1)*providerSearchResultGridPageSize,r=n+providerSearchResultGridPageSize;setMapMarkers(map,providerSearchResultData.slice(n,r))}function providerSearchScroll(){scrollToAnchor("#providerSearchScrollAnchor",100)}function initializeGlossary(){$("#ResetKeywordLink").on("click",function(n){n.preventDefault();$("#KeywordTextBox").val("")})}var EnumPaymentPayrollGroup,EnumPaymentMethod,BillingGroup,Session,Http,Ajax,PaymentMethodRequest,clsHiddenElement,windowWidth,windowHeight,$newsAndInfoTile,addressTemplate,setSpanInnerHtml,ShowHidePostalAddressContainer,$historyDropdown,datePeriod,CoverStartPeriod,DiscountType,DiscountPeriod,$rebateTier,OverseasCover,overseas,WebChatUIIndex,WebChatUIChatCallback;String.prototype.replaceAll=function(n,t){return this.replace(new RegExp(escapeRegExp(n),"g"),t)},function(n){n[n.PleaseSelect=0]="PleaseSelect";n[n.CBA=1]="CBA";n[n.Bankwest=2]="Bankwest"}(EnumPaymentPayrollGroup||(EnumPaymentPayrollGroup={})),function(n){n[n.PleaseSelect=0]="PleaseSelect";n[n.DirectDebit=1]="DirectDebit";n[n.Invoice=2]="Invoice";n[n.SalaryDeduction=3]="SalaryDeduction";n[n.CreditCard=4]="CreditCard"}(EnumPaymentMethod||(EnumPaymentMethod={})),function(n){n[n.G0_Undefined=0]="G0_Undefined";n[n.G1_CBAEmployees_Payroll_Fortnightly=1]="G1_CBAEmployees_Payroll_Fortnightly";n[n.G2_CBAEmployees_PayrollAdvancePayment_Fortnightly=2]="G2_CBAEmployees_PayrollAdvancePayment_Fortnightly";n[n.G3_Retirees_DirectDeb_Fortnightly=3]="G3_Retirees_DirectDeb_Fortnightly";n[n.G4_Avanteos_Payroll_Fortnightly=4]="G4_Avanteos_Payroll_Fortnightly";n[n.G5_CappedRetirees_DirectDeb_Fortnightly=5]="G5_CappedRetirees_DirectDeb_Fortnightly";n[n.G6_OffPayWeek_DirectDeb_Fortnightly=6]="G6_OffPayWeek_DirectDeb_Fortnightly";n[n.G7_CBAStaff_DirectDeb_Fortnightly=7]="G7_CBAStaff_DirectDeb_Fortnightly";n[n.G8_DependantsAndRejoins_DirectDeb_Fortnightly=8]="G8_DependantsAndRejoins_DirectDeb_Fortnightly";n[n.G9_FormerCBAStaff_DirectDeb_Fortnightly=9]="G9_FormerCBAStaff_DirectDeb_Fortnightly";n[n.G10_Unfinancial_MembershipsLapsedMembers_Monthly=10]="G10_Unfinancial_MembershipsLapsedMembers_Monthly";n[n.G11_Broken_Rates_Bulk_Payment_Fortnightly=11]="G11_Broken_Rates_Bulk_Payment_Fortnightly";n[n.G12_CPIPensioners_OSFPensionPayroll_Fortnightly=12]="G12_CPIPensioners_OSFPensionPayroll_Fortnightly";n[n.G13_CappedPensioners_OSFPensionPayroll_Fortnightly=13]="G13_CappedPensioners_OSFPensionPayroll_Fortnightly";n[n.G14_CBHSEmployees_Payroll_Fortnightly=14]="G14_CBHSEmployees_Payroll_Fortnightly";n[n.G15_Lapsed_Memberships_Fortnightly=15]="G15_Lapsed_Memberships_Fortnightly";n[n.G16_Monthly_DirectDebOn_15th=16]="G16_Monthly_DirectDebOn_15th";n[n.G17_Monthly_DirectDebOn_21st=17]="G17_Monthly_DirectDebOn_21st";n[n.G18_Lapsed_Membership_Monthly=18]="G18_Lapsed_Membership_Monthly";n[n.G19_CBAEmployees_PayrollInAdvanced_Fortnightly=19]="G19_CBAEmployees_PayrollInAdvanced_Fortnightly";n[n.G20_PaidInAdvance_Quarterly_BulkPayment=20]="G20_PaidInAdvance_Quarterly_BulkPayment";n[n.G21_PaidInAdvance_BulkPayment_HalfYearly=21]="G21_PaidInAdvance_BulkPayment_HalfYearly";n[n.G22_PaidInAdvance_YearlyBulkPayment=22]="G22_PaidInAdvance_YearlyBulkPayment";n[n.G23_ColonialPropertyMmt_Payroll_Fortnightly=23]="G23_ColonialPropertyMmt_Payroll_Fortnightly";n[n.G24_OffPayWeek_DirectDeb_Fortnightly=24]="G24_OffPayWeek_DirectDeb_Fortnightly";n[n.G26_NetworkLogic_Staff_PayrollMonthly=26]="G26_NetworkLogic_Staff_PayrollMonthly";n[n.G30_BankWest_PayrollInAdvance_Fortnightly=30]="G30_BankWest_PayrollInAdvance_Fortnightly";n[n.G31_BankWest_DirectDebInAdvanced_Fortnightly=31]="G31_BankWest_DirectDebInAdvanced_Fortnightly";n[n.G32_BankWest_Monthly_SalaryDeductionInAdvance_DirectDeb=32]="G32_BankWest_Monthly_SalaryDeductionInAdvance_DirectDeb";n[n.G33_ColonialFirstState_Payroll_Monthly=33]="G33_ColonialFirstState_Payroll_Monthly";n[n.G34_GlobalMobility_Payroll_Yearly=34]="G34_GlobalMobility_Payroll_Yearly";n[n.G35_PaidInAdvance_Yearly_5perDiscount_BulkPayment=35]="G35_PaidInAdvance_Yearly_5perDiscount_BulkPayment";n[n.G50_CreditCard=50]="G50_CreditCard";n[n.G51_CreditCardDishonour=51]="G51_CreditCardDishonour"}(BillingGroup||(BillingGroup={})),function(n){function t(n){if(n.search("session has expired")>0){var i=$($.parseHTML(n)),t;$.each(i,function(n,i){i.rel=="canonical"&&(t=i.href)});t?window.location.replace(t):window.location.replace(window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:"")+"/500.htm")}}n.ExpireCheck=t}(Session||(Session={})),function(n){function i(){$('<div id="divMainContentPlaceholder">').addClass("spinner-loader").addClass("exactCenter").appendTo("body")}function r(){$("#divMainContentPlaceholder").remove()}function t(n,t,f,e,o,s){$.ajax({url:n,data:t,type:"get",dataType:f,cache:!1,async:e,beforeSend:function(){i()},complete:function(){r();console.log(typeof s);typeof s=="function"&&(console.log("Calling completeCallBack"),s())},success:function(n){f==u.html&&Session.ExpireCheck(n);console.log(typeof o);typeof o=="function"&&(console.log("Calling successCallback"),o(n))}})}function f(n,i,r,u){console.log("In Http.GetJson >> apiUrl",n,i);t(n,i,"json",!0,r,u)}function e(n,i,r,u){console.log("In Http.GetJsonAsync >> apiUrl",n,i);t(n,i,"json",!1,r,u)}function o(n,i,r,u){console.log("In Http.GetHtml >> apiUrl",n,i);t(n,i,"html",!0,r,u)}function s(n,t,u,f,e,o){$.ajax({url:n,data:t,type:"post",dataType:u,cache:!1,contentType:"application/json; charset=utf-8",beforeSend:function(){i();typeof f=="function"&&f()},complete:function(){r();typeof o=="function"&&o()},success:function(n){e(n)}})}function h(n,t){console.log("In Http.PostJsonSync >> apiUrl",n,t);var i=null;return $.ajax({url:n,data:t,type:"post",dataType:"json",contentType:"application/json; charset=utf-8",cache:!1,async:!1,success:function(n){i=n},error:function(n,t){console.log("In Http.PostJsonSync Error: "+t)}}),i}var u=function(){function n(){}return n.json="json",n.html="html",n}();n.GetJson=f;n.GetJsonAsync=e;n.GetHtml=o;n.Post=s;n.PostJsonSync=h}(Http||(Http={})),function(n){function t(n,t){console.log("In GetBankDetailsByBSB");/^(?!(?:0{6}|000-000))(?:\d{6}|\d\d\d-\d\d\d)$/.test(n)&&Http.GetJson("/Handlers/BankBranchDetailsHandler.ashx?rnd="+Math.random(),"bsb="+n,function(n){n.BankName!=null&&n.BranchName!=null?t.html('<div class="inner col-md-12">\n                                                <p class="col-md-12">\n                                                    <strong>Bank name:<\/strong><span>'+n.BankName+'<\/span><\/p> \n                                                <p class="col-md-12">\n                                                    <strong>Branch name:<\/strong><span>'+n.BranchName+"<\/span><\/p>\n                                                <\/div>"):t.html('<div class="inner col-md-12">\n                                                <p class="col-md-12">\n                                                    <strong>Bank name:<\/strong><span>(Invalid BSB number)<\/span><\/p>\n                                                <p class="col-md-12">\n                                                    <strong>Branch name:<\/strong><span>(Invalid BSB number)<\/span><\/p>\n                                                <\/div>')},null)}function i(n){console.log("In ValidateBankByBSB");var t=!1;return/^(?!(?:0{6}|000-000))(?:\d{6}|\d\d\d-\d\d\d)$/.test(n)&&Http.GetJsonAsync("/Handlers/BankBranchDetailsHandler.ashx?rnd="+Math.random(),"bsb="+n,function(n){n.BankName!=null&&n.BranchName!=null&&(t=!0)},null),t}function r(n,t){console.log("In HandlePaymentMethod");Http.GetJson("/Handlers/PaymentMethodHandler.ashx",n,t,null)}n.GetBankDetailsByBSB=t;n.ValidateBankByBSB=i;n.HandlePaymentMethod=r}(Ajax||(Ajax={}));PaymentMethodRequest=function(){function n(){}return n}();!function(){"use strict";var t,i;if("undefined"!=typeof window){if(t=window.navigator.userAgent.match(/Edge\/(\d{2})\./),i=!!t&&parseInt(t[1],10)>=16,"objectFit"in document.documentElement.style!=!1&&!i)return void(window.objectFitPolyfill=function(){return!1});var u=function(n){var t=window.getComputedStyle(n,null),i=t.getPropertyValue("position"),u=t.getPropertyValue("overflow"),r=t.getPropertyValue("display");i&&"static"!==i||(n.style.position="relative");"hidden"!==u&&(n.style.overflow="hidden");r&&"inline"!==r||(n.style.display="block");0===n.clientHeight&&(n.style.height="100%");-1===n.className.indexOf("object-fit-polyfill")&&(n.className=n.className+" object-fit-polyfill")},f=function(n){var r=window.getComputedStyle(n,null),i={"max-width":"none","max-height":"none","min-width":"0px","min-height":"0px",top:"auto",right:"auto",bottom:"auto",left:"auto","margin-top":"0px","margin-right":"0px","margin-bottom":"0px","margin-left":"0px"};for(var t in i)r.getPropertyValue(t)!==i[t]&&(n.style[t]=i[t])},n=function(n){var t=n.parentNode;u(t);f(n);n.style.position="absolute";n.style.height="100%";n.style.width="auto";n.clientWidth>t.clientWidth?(n.style.top="0",n.style.marginTop="0",n.style.left="50%",n.style.marginLeft=n.clientWidth/-2+"px"):(n.style.width="100%",n.style.height="auto",n.style.left="0",n.style.marginLeft="0",n.style.top="50%",n.style.marginTop=n.clientHeight/-2+"px")},r=function(t){var r,u;if(void 0===t)t=document.querySelectorAll("[data-object-fit]");else if(t&&t.nodeName)t=[t];else{if("object"!=typeof t||!t.length||!t[0].nodeName)return!1;t=t}for(r=0;r<t.length;r++)t[r].nodeName&&(u=t[r].nodeName.toLowerCase(),"img"!==u||i?"video"===u&&(t[r].readyState>0?n(t[r]):t[r].addEventListener("loadedmetadata",function(){n(this)})):t[r].complete?n(t[r]):t[r].addEventListener("load",function(){n(this)}));return!0};document.addEventListener("DOMContentLoaded",function(){r()});window.addEventListener("resize",function(){r()});window.objectFitPolyfill=r}}();clsHiddenElement="hiddenElement";windowWidth=$(window).width();windowHeight=$(window).height();$(function(){function n(n){return n?"addClass":"removeClass"}$(document).on("input",".clearable",function(){$(this)[n(this.value)]("x")}).on("mousemove",".x",function(t){$(this)[n(this.offsetWidth-18<t.clientX-this.getBoundingClientRect().left)]("onX")}).on("touchstart click",".onX",function(n){n.preventDefault();$(this).removeClass("x onX").val("").change();$(".discountRelated")&&$(".discountRelated").hide()});$(".clearable").val()!=""&&$(".clearable").addClass("x")});$newsAndInfoTile=$(".js-news, .js-info-tile");var CBHS={load:function(){function n(n,t){var i=String(n.attr("class"));i.length>0&&i.indexOf("searchbox")>-1||(t?(n.val(""),n.removeClass("placeholder")):(n.addClass("placeholder"),n.val(n.attr("placeholder"))))}$.vividCore({cycleSlider:!0,cycleSliderContainerSelector:"#promoSlider",cycleSliderTimeout:1e4,navigationToggle:!0,searchToggle:!0,navigationContainerSelector:".navigation",inlineFormLabels:!0,formStyling:!0,tabs:!0});$("[placeholder]").focus(function(){var t=$(this);t.val()==t.attr("placeholder")&&n(t,!0)}).blur(function(){var t=$(this);(t.val()==""||t.val()==t.attr("placeholder"))&&n(t,!1)}).blur();$(".slider").css("visibility","visible");createNavigation();createWindowPopup();createToggle();createHeaderToggleClasses();replaceSearchElement();createQuoteSelectorClasses();createSFtemplateClasses();createStrikeThroughTitles();createDatePicker();createContentSlider();createSlickSlider();objectFit();stepsWizard();showPlaceholder();isMobile()||createEqualHeightColumns();createSiteFinityExpandList();createResponsiveTables();bingSearchHtml();saveApplicationPopup();cancelApplicationPopup();createTruncatedText();createDateMask()},getQuote:{init:function(){myQuotePaymentFrequency()},getAQuote:function(){getQuoteLogic();setupRebateRateTierInformationToggles()},getAQuoteResults:function(){coverFeaturesToggles();isMobile()&&coverFeaturesMobileToggles();getQuotePriceLogic();getQuoteScroll()},personalDetails:function(){CBHS.getQuote.init();eligibilityLogic();titleGenderLogic();hearAboutUsLogic();emailAddressLogic();residentialAddressLogic();postalAddressLogic();registerOnlineLogic();validateAddressLogic()},coverDetails:function(){CBHS.getQuote.init();memberDetailsLogic();coverDetailsLogic();titleGenderLogic()},rebate:function(){CBHS.getQuote.init();updateMyQuote();residentialAddressLogic();postalAddressLogic();validateAddressLogic();rebateDetailsLogic();setupRebateRateTierInformationToggles();memberRebatePopulateLogic()},payment:function(){CBHS.getQuote.init();paymentDetailsLogic();paymentBenefitsLogic();paymentCoverDetailsLogic()},applicationComplete:function(){CCPaymentLogic()}},account:{inboxMessageBar:function(){inboxMessageBar()},inbox:function(){createInboxGrid()},taxStatements:function(){createTaxStatementsGrid()},benefitQuoteHistory:function(){createBenefitQuoteHistoryGrid()},updateContactDetails:function(){updateContactDetailsLogic()},updateAddressDetails:function(){updateAddressDetailsLogic();validateAddressLogic();addressDetailsMessageScroll()},benefitsLimit:function(){benefitsLimitLogic();benefitsLimitScroll();benefitsLimitAvailableScroll()},studentDependant:function(){studentDependantLogic()},replacementCard:function(){createCardPersonDetailsGrid()},benefitQuote:function(){benefitQuoteTypeLogic()},claim:function(){claimLogic()},extrasClaim:function(){extrasClaimLogic()},claimHistory:function(){claimHistoryScroll()},claimHistorySearch:function(){claimHistorySearchInitialise()},claimReviewCreditAccount:function(){claimReviewCreditAccountLogic()},creditAccount:function(){creditAccountLogic()},debitAccount:function(){debitAccountLogic()},addNewbornBaby:function(){addNewBornBabyLogic()},memberPopulateRebate:function(){memberRebatePopulateLogic();postalAddressLogic();updateAddressDetailsLogic();validateAddressLogic();addressDetailsMessageScroll()},coverChange:function(n){coverChangeLogic(n)},receipt:function(){receiptLogic()}},helper:{init:function(){createHistoryGrid()}},providerSearch:{init:function(){initializeProviderSearchMap();createProviderSearchGrid();providerSearchScroll()}},helperEligibilitySearch:{init:function(){initializeHelperEligibilitySearch()}},glossary:{init:function(){initializeGlossary()}},proxyEligibility:{init:function(){proxyEligibilityLogic()}}},MobileHandler={init:function(){document.documentElement.addEventListener("touchstart",function(n){n.touches.length>1&&n.preventDefault()},!1);var n=0;document.documentElement.addEventListener("touchend",function(t){var i=(new Date).getTime();i-n<=300&&t.preventDefault();n=i},!1)}},TopSearchBehaviour={init:function(){var n=document.querySelectorAll(".searchbox")[0],t=document.querySelector(".btn.searchbutton");n&&(n.onclick=function(){var i=document.activeElement;i===n&&(t.style.zIndex="10")},n.onblur=function(){setTimeout(function(){t.style.zIndex="0"},200)})}};$(document).ready(function(){CBHS.load();TopSearchBehaviour.init();MobileHandler.init();datePickerInputTypeChanger("tel");bingSearchFeature()});$(window).load(function(){createRetinaIcon()});window.onresize=function(){replaceSearchElement()};var validResidentialAddresses=null,$validateResidentialAddressButton=$("#ValidateResidentialAddressButton"),$validResidentialAddressesPanel=$("#ValidResidentialAddressesPanel"),$validResidentialAddressesDropDownList=null,$residentialAddressWasValidatedHiddenField=$("#ResidentialAddressWasValidatedHiddenField"),$isResidentialAddressOverridden=$("#IsResidentialAddressOverriddenHiddenField"),$residentialAddressLine1=$("#ResidentialAddressLine1TextBox"),$residentialAddressLine2=$("#ResidentialAddressLine2TextBox"),$residentialAddressSuburb=$("#ResidentialAddressSuburbTextBox"),$residentialAddressStateDropDownList=$("#ResidentialAddressStateDropDownList"),$residentialAddressCurrentState=$("#ResidentialAddressCurrentState"),$residentialAddressPostCode=$("#ResidentialAddressPostCodeTextBox"),validPostalAddresses=null,$validatePostalAddressButton=$("#ValidatePostalAddressButton"),$validPostalAddressesPanel=$("#ValidPostalAddressesPanel"),$validPostalAddressesDropDownList=null,$postalAddressWasValidatedHiddenField=$("#PostalAddressWasValidatedHiddenField"),$isPostalAddressOverridden=$("#IsPostalAddressOverriddenHiddenField"),$postalAddressLine1=$("#PostalAddressLine1TextBox"),$postalAddressLine2=$("#PostalAddressLine2TextBox"),$postalAddressSuburb=$("#PostalAddressSuburbTextBox"),$postalAddressStateDropDownList=$("#PostalAddressStateDropDownList"),$postalAddressPostCode=$("#PostalAddressPostCodeTextBox"),$currentCoverTextBox=$("#CurrentCoverTextBox"),$currentContributionTextBox=$("#CurrentContributionTextBox"),$newCoverTextBox=$("#NewCoverTextBox"),$newContributionTextBox=$("#NewContributionTextBox"),$currentDiscountSpan=$("#CurrentDiscountSpan"),$newDiscountSpan=$("#NewDiscountSpan"),$currentAgeBasedDiscountSpan=$("#CurrentAgeBasedDiscountSpan"),$newAgeBasedDiscountSpan=$("#NewAgeBasedDiscountSpan"),$discountRestrictedHtml=$("#DiscountRestrictedHtml"),$residentialAddressStateRebate=$("#ResidentialAddressStateLabelReb");addressTemplate=kendo.template("#:data.StreetName##if (data.Suburb != undefined) {#, #:data.Suburb##}##if (data.State != undefined) {#, #:data.State##}##if (data.Postcode != undefined) {#, #:data.Postcode##}#");setSpanInnerHtml=function(n){if(n!=null){var t=n.dataItem();t&&n.span.html(addressTemplate(t))}};$("#dropdownIsPostalAddressSameAsResidentialAddress").change(function(){ShowHidePostalAddressContainer($("#dropdownIsPostalAddressSameAsResidentialAddress option:selected").val()==="false");$("#IsPostalAddressOverriddenHiddenField").val("True")});$("#ResidentialAddressLine1, #ResidentialAddressLine2, #ResidentialSuburb, #dropdownResidentialState, #ResidentialPostcode").change(function(){ARDRF_ShowAddressValidationStatus(!1,1)});$("#PostalAddressLine1, #PostalAddressLine2, #PostalSuburb, #dropdownPostalState, #PostalPostcode").change(function(){ARDRF_ShowAddressValidationStatus(!1,2)});$("#btnResidentialAddress").click(function(){if($("#ResidentialAddressLine1").val()+$("#ResidentialAddressLine2").val()+$("#ResidentialSuburb").val()+$("#ResidentialPostcode").val()=="")return ARDRF_ShowAddressValidationStatus(!1,1),!1;getJson("/handlers/AddressLookupDetailsHandler.ashx",{addressline1:$("#ResidentialAddressLine1").val(),addressline2:$("#ResidentialAddressLine2").val(),suburb:$("#ResidentialSuburb").val(),state:$("#dropdownResidentialState").val(),postcode:$("#ResidentialPostcode").val()},function(n){validResidentialAddresses=n;console.log("In btnResidentialAddress",n);$validResidentialAddressesDropDownList=$("#ValidResidentialAddressesDropDownList").kendoDropDownList({optionLabel:"Please select",dataTextField:"StreetName",dataValueField:"Id",template:addressTemplate,dataBound:function(){setSpanInnerHtml($validResidentialAddressesDropDownList)},change:ARDRF_onChangeValidResidentialAddress}).data("kendoDropDownList");$validResidentialAddressesDropDownList.setDataSource(n);$validResidentialAddressesDropDownList.dataSource.insert(0,{StreetName:"My address is not listed; use address as entered",Id:"0"});$validResidentialAddressesDropDownList.select(0);$validResidentialAddressesPanel.show()})});$("#btnPostalAddress").click(function(){if($("#PostalAddressLine1").val()+$("#PostalAddressLine2").val()+$("#PostalSuburb").val()+$("#PostalPostcode").val()=="")return ARDRF_ShowAddressValidationStatus(!1,2),!1;getJson("/handlers/AddressLookupDetailsHandler.ashx",{addressline1:$("#PostalAddressLine1").val(),addressline2:$("#PostalAddressLine2").val(),suburb:$("#PostalSuburb").val(),state:$("#dropdownPostalState").val(),postcode:$("#PostalPostcode").val()},function(n){validPostalAddresses=n;$validPostalAddressesDropDownList=$("#ValidPostalAddressesDropDownList").kendoDropDownList({optionLabel:"Please select",dataTextField:"StreetName",dataValueField:"Id",template:addressTemplate,dataBound:function(){setSpanInnerHtml($validPostalAddressesDropDownList)},change:ARDRF_onChangeValidPostalAddress}).data("kendoDropDownList");$validPostalAddressesDropDownList.setDataSource(n);$validPostalAddressesDropDownList.dataSource.insert(0,{StreetName:"My address is not listed; use address as entered",Id:"0"});$validPostalAddressesDropDownList.select(0);$validPostalAddressesPanel.show()})});$(function(){$("#PostalAddressLine1").val()+$("#PostalAddressLine2").val()+$("#PostalSuburb").val()+$("#PostalPostcode").val()==""&&ShowHidePostalAddressContainer($("#dropdownIsPostalAddressSameAsResidentialAddress option:selected").val()==="false")});ShowHidePostalAddressContainer=function(n){console.log("In ShowHidePostalAddressContainer",n);n===!0?($("#PostalAddressContainer").removeClass("hidden"),ARDRF_ShowAddressValidationStatus(!1,2)):($("#PostalAddressContainer").addClass("hidden"),ARDRF_ShowAddressValidationStatus(!0,2))};var getJson=function(n,t,i,r){console.log("In getJson >> apiUrl",n,t);getBase(n,t,"json",i,r)},getHtml=function(n,t,i,r){console.log("In getHtml >> apiUrl",n,t);getBase(n,t,"html",i,r)},getBase=function(n,t,i,r,u){$.ajax({url:n,data:t,type:"get",dataType:i,cache:!1,beforeSend:function(){$('<div id="divMainContentPlaceholder">').addClass("spinner-loader").addClass("exactCenter").appendTo("body")},complete:function(){$("#divMainContentPlaceholder").remove();typeof u=="function"&&u()},success:function(n,t){i=="html"&&sessionExpireCheck(n,t);typeof r=="function"&&r(n)}})},postAjax=function(n,t,i,r,u,f){$.ajax({url:n,data:t,type:"post",dataType:i,cache:!1,contentType:"application/json; charset=utf-8",beforeSend:function(){$('<div id="divMainContentPlaceholder">').addClass("spinner-loader").addClass("exactCenter").appendTo("body");typeof r=="function"&&r()},complete:function(){$("#divMainContentPlaceholder").remove();typeof f=="function"&&f()},success:function(n){u(n)}})};if(Date.now=Date.now||function(){return+new Date},$historyDropdown=$("#SearchPeriodDropDownList"),$(function(){$("#datepicker").datepicker()}),$(function(){var n=GetParameterByName("promoCode");$(".promocode").mask("*?*********",{placeholder:""});$(".promocode").focus(function(){$(this).select()});$(".promocode").keyup(function(){var n=$(this).val();$(this).val()==""?$("#isPromoCodeValidated").val(!0):$("#isPromoCodeValidated").val(!1);$(".promocode").each(function(){$(".promocode").val(n)})});n!=""&&$(".promocode").val(n).trigger("blur");$(".validPromocheck").click(function(n){$("#isPromoCodeValidated").val()=="false"&&($(".promocodeError").html(MsgWrapper("Please click apply or delete code")),n.preventDefault())})}),$.curCSS=function(n,t,i){return $(n).css(t,i)},$(".company-search").length){var windowWidth=$(window).width(),windowHeight=$(window).height(),eventTimeout,moveCompanySearch=function(){$("input").is(":focus")||(window.matchMedia("(max-width: 639px)").matches?$(".company-search").insertBefore(".cover-selector-option-rebate"):$(".company-search").insertAfter(".cover-selector-type"))},eventThrottler=function(){eventTimeout||(eventTimeout=setTimeout(function(){eventTimeout=null;$(window).width()!==windowWidth&&moveCompanySearch()},66))};moveCompanySearch();window.addEventListener("resize",eventThrottler,!1);window.addEventListener("orientationchange",eventThrottler,!1);$.ajax({dataType:"json",url:"/Handlers/CompanyPromoCodeHandler.ashx",success:function(n){var t=$(".companySearch"),r=$("#CompanyNameTextBox0 input"),i=$("#PromoCodeTextBox0 input"),f=i.val(),u;f&&i.val(f);u=r.val();u&&t.val(u);u&&!f&&($(".company-search__msg").addClass("show"),$(".company-search__msg").html("You have not selected a valid company. Make sure you select an option from the list."));t.on("input",function(){var f=$(this).val(),e,u;r.val(f);t.val(f);i.val("");t.attr("setPromoCode","false");t.val()===""&&($(".company-search__msg").removeClass("show"),$(".company-search__msg").empty());e=$(".companyNameInput .ui-autocomplete li:first-child a").text();f.toLowerCase().trim()===e.toLowerCase().trim()&&(u=$.grep(n,function(n){var t=n,i;return t["Alternative Names"].unshift(t.CompanyName),i=!1,$.each(t["Alternative Names"],function(n,t){f.toLowerCase().trim()===t.toLowerCase()&&(i=!0)}),i?!0:void 0}),u[0]&&(t.val(u[0].CompanyName),r.val(u[0].CompanyName),i.val(u[0].PromoCode),t.attr("setPromoCode","true")))});t.autocomplete({appendTo:".ui-front",sortResults:!1,source:function(t,i){var u=$.ui.autocomplete.escapeRegex(t.term),o=new RegExp("^"+u,"i"),r=$.grep(n,function(n){var t=n,i;return t["Alternative Names"].unshift(t.CompanyName),i=!1,$.each(t["Alternative Names"],function(n,t){o.test(t)&&(i=!0)}),i?!0:void 0}),s=new RegExp(u,"i"),f=$.grep(n,function(n){var t=n,i;return t["Alternative Names"].unshift(t.CompanyName),i=!1,$.each(t["Alternative Names"],function(t,u){$.inArray(n,r)<0&&s.test(u)&&(i=!0)}),i?!0:void 0}),e;i(r.concat(f));r.concat(f).length===0?(e=[{CompanyName:"No matches found",PromoCode:"","Alternative Names":[]}],i(e)):($(".company-search__msg").removeClass("show"),$(".company-search__msg").empty())},select:function(n,u){return u.item&&(t.val(u.item.CompanyName),r.val(u.item.CompanyName),i.val(u.item.PromoCode),$(".promocode").val(u.item.PromoCode)),$("#productResults").hide(),!1},focus:function(n,i){return i.item&&(r.val(i.item.CompanyName),t.val(i.item.CompanyName)),!1},change:function(n,r){return r.item==null&&(t.attr("setPromoCode")==="false"&&(i.val(""),$(".promocode").val("")),t.val()==="Start typing.."||t.val()===""?($(".company-search__msg").removeClass("show"),$(".company-search__msg").empty()):t.attr("setPromoCode")==="false"&&($(".company-search__msg").addClass("show"),$(".company-search__msg").html("You have not selected a valid company. Make sure you select an option from the list."))),$("#productResults").hide(),!1}}).data("autocomplete")._renderItem=function(n,t){var i={PromoCode:t.PromoCode,CompanyName:t.CompanyName},r;return t.PromoCode===""?$("<li><\/li>").data("item.autocomplete",i).append("<span class='no-results'>"+t.CompanyName+"<\/span>").appendTo(n):(r=String(t.CompanyName).replace(new RegExp(this.term,"gi"),"<span class='ui-state-highlight'>$&<\/span>"),$("<li><\/li>").data("item.autocomplete",i).append("<a>"+r+"<\/a>").appendTo(n))}}})}$(function(){$(".btnPackageSelector").click(function(){$(".cover-selector-panels").find(".selector-col").each(function(){var n=$(this);n.find(".promocodeError").find("span.error").is(":visible")==!0&&$(".PromoCodeTextBox",n).val("")})})}),function(n){n[n.NotSelected="0"]="NotSelected";n[n.DateApplicaRecived="1"]="DateApplicaRecived";n[n.DateDDSalaryDeduction="2"]="DateDDSalaryDeduction";n[n.SpecficDate="3"]="SpecficDate"}(CoverStartPeriod||(CoverStartPeriod={})),function(n){n[n.Flat="1"]="Flat";n[n.TimeLimited="2"]="TimeLimited"}(DiscountType||(DiscountType={})),function(n){n[n.Weeks=1]="Weeks";n[n.Months=2]="Months";n[n.Years=3]="Years"}(DiscountPeriod||(DiscountPeriod={}));String.prototype.toDate=function(){var n=this.split("/");return new Date(n[2],n[1],n[0])},function(){$("#CoverStartPeriodDropDownList, #CoverStartDateTextBox").change(function(){DiscountStartDateChangeHanlder();DiscountEndDateChangeHandler()});$("#PromotionCodeTextBox").change(function(){})}(),function(){var n;$(document).ready(function(){$(".hospitalDropDownList .k-input, .extrasDropDownList .k-input").css("max-width",$(".selector-col .selector-title > h2").width()-38)});$(window).on("resize",function(){clearTimeout(n);n=setTimeout(function(){$(".hospitalDropDownList .k-input, .extrasDropDownList .k-input").css("max-width",$(".selector-col .selector-title > h2").width()-38)},100)})}();window.onload=function(){spinLoader()};var $cntrRebateDetails=$(".rebateDetails"),$cntrRebatePercentage=$(".rebatePercentage"),$cntrMedicareDetails=$(".medicareDetails"),$cntRebate=$(".rebateapplication"),$rebateapplicationvisibility=$cntRebate.find('[data-rebateregistrationeligibility="true"]'),$medicareEligibility_0=$cntrMedicareDetails.find('[data-medicareEligibility="false"]'),$medicareEligibility_1=$cntrMedicareDetails.find('[data-medicareEligibility="true"]'),$medicareCardDetails_0=$cntrMedicareDetails.find('[data-medicareCardDetails="false"]'),$medicareCardDetails_1=$cntrMedicareDetails.find('[data-medicareCardDetails="true"]'),$savingsProvEntitlement=$cntrRebateDetails.find("[data-savingsProvEntitlement=true]"),$divCoverByPolicy=$("#fieldMedicare"),$divNotCovered=$("#divNotCovered"),$participatingInGovernmentRebate=null,$hasAllMembersEligibleForMedicareCards=null,$isMedicareCardTypeNoneOrNotSelected=null,$isParticipatingInGovernmentRebateDropDownList=$("#IsParticipatingInGovernmentRebateDropDownList"),$isAllFieldCovered=$("#fieldIsAllPeopleCovered"),$isAllPeopleCoveredDropDownList=$("#IsAllPeopleCoveredList"),$isCoveredByPolicyList=$("#IsCoveredByPolicyList"),$isPostalSameDropDownList=$("#IsCoveredByPolicyList"),$isNotPeopleCovered=$("#divPeopleNotCovered"),$priceAsterisk=$("#priceAsterisk"),$priceAsteriskInfo=$("#priceAsteriskInfo");$("#MedicareNumberText").mask("9999-99999-9");$("#MedicareValidToText").mask("99/9999");$("#MobileTextBox").mask("9999-999-999");$("#HomePhoneTextBox").mask("(99) 9999-9999");$("#WorkPhoneTextBox").mask("(99) 9999-9999");$historyGrid1=$("#gridRebate1");$rebateRadio=$(".rebateRadio1");$rebateTier=$("#RebateTierLiteral");$rebateRadio.live("change",function(){$("#RebateTierSelected1").val($("input:radio[name=rebateTier1]:checked").val());getRebatePercentage();updateMyQuote()});var bankDetails=".bankingDetailPanel",$bankAccountMessage=$("#bankAccountMessage"),$invoiceMessage=$("#invoiceMessage"),$cntrPaymentContributions=$(".paymentContributions"),$cntrPaymentBenefits=$(".paymentBenefits"),$directDebitBsb=$cntrPaymentContributions.find("#DirectDebitBsbNumberTextBox"),$directDebitPaymentsBankDetails=$cntrPaymentContributions.find(bankDetails),$paymentMethodDropDownList=$("#PaymentMethodDropDownList"),$debitFrequencyDropDownList=$("#DirectDebitFrequencyDropDownList"),$invoiceFrequencyDropDownList=$("#InvoicePaymentPeriodDropDownList"),$sameAsDirectDebit=$("#IsUsingDirectDebitDetailsForBenefitPaymentsCheckBox"),$startDayDropDownList=$("#StartDayDropDownList"),$frequencyOfPaymentDropDownList=$("#FrequencyOfPaymentDropDownList"),$StartDayMessageForAllMonths=$("#StartDayMessageForAllMonths"),$StartDayMessageForFebMonth=$("#StartDayMessageForFebMonth"),$paymentMethodDirectDebit=$cntrPaymentContributions.find('[data-paymentMethodId="directDebit"]').add($cntrPaymentBenefits.find('[data-paymentMethodId="directDebit"]')),$paymentMethodInvoice=$cntrPaymentContributions.find('[data-paymentMethodId="invoice"]'),$paymentMethodSalaryDeduction=$cntrPaymentContributions.find('[data-paymentMethodId="salaryDeduction"]'),$paymentMethodCreditCard=$cntrPaymentContributions.find('[data-paymentMethodId="creditCard"]'),$directDebitFortnightly=$(".directDebitFortnightly"),$directDebitMonthly=$(".directDebitMonthly"),$coverSelectData,$billingFrequencyDropDownList=$("#BillingFrequencyDropDownList"),$hiddenDiscountTerms=$("#hiddenDiscountTerms"),$cbxDiscountTermsAcceptance=$("#cbxDiscountTermsAcceptance"),$creditCardSelectedMessage=$("#CreditCardSelectedMessage");var $paymentMethodDropDownList=$cntrPaymentContributions.find("#PaymentMethodDropDownList"),$cntrPaymentCoverDetails=$(".coverDetails"),$coverStartPeriodDropDownList=$cntrPaymentCoverDetails.find("#CoverStartPeriodDropDownList");var $benefitPaymentsBsbNumber=$cntrPaymentBenefits.find("#BenefitPaymentsBsbNumberTextBox"),$bankDetails_paymentBenefits=$cntrPaymentBenefits.find(bankDetails),benefitPaymentsAccountNumber="#BenefitPaymentsAccountNumberTextBox",benefitPaymentsAccountName="#BenefitPaymentsAccountNameTextBox",$benefitPaymentsAccountNumber=$cntrPaymentBenefits.find(benefitPaymentsAccountNumber),$benefitPaymentsAccountName=$cntrPaymentBenefits.find(benefitPaymentsAccountName),$benefitPaymentsBankDetails=$cntrPaymentBenefits.find(bankDetails),directDebitPaymentsBsbNumber="#DirectDebitBsbNumberTextBox",directDebitPaymentsAccountNumber="#DirectDebitAccountNumberTextBox",directDebitPaymentsAccountName="#DirectDebitAccountNameTextBox",$directDebitPaymentsBsbNumber=$cntrPaymentContributions.find(directDebitPaymentsBsbNumber),$directDebitPaymentsAccountNumber=$cntrPaymentContributions.find(directDebitPaymentsAccountNumber),$directDebitPaymentsAccountName=$cntrPaymentContributions.find(directDebitPaymentsAccountName),$updateBenefitPayments=$(".updateBenefitPayments");$(document).ready(function(){$startDayDropDownList.val()!=undefined&&checkStartDay($startDayDropDownList.val())});var providerSearchResultData=null,providerSearchResultGridPageSize=20,map=null,markers=[];var isMemberEligibilityDd=document.getElementById("MemberEligibilityDd"),memId=document.getElementById("divMemId"),surName=document.getElementById("divSurname"),firstName=document.getElementById("divFirstName"),dob=document.getElementById("divdoB"),gender=document.getElementById("divGender"),txtmemId=document.getElementById("MembershipNumberText"),txtmemberSurnameText=document.getElementById("MemberSurnameText"),txtmemberFirstNameText=document.getElementById("MemberFirstNameText"),txtdob=document.getElementById("MemberDateOfBirthText"),membercustomValidator=document.getElementById("MembershipNumberCustomValidator"),memberSurCustomValidator=document.getElementById("MemberSurnameTextCustomValidator"),memberfirstCustomValidator=document.getElementById("MemberFirstNameTextCustomValidator"),memberDobCustomValidator=document.getElementById("MemberDOBTextCustomValidator"),ddlgender=document.getElementById("genderDropDownList"),ddlgenderCustomValidator=document.getElementById("MemberGenderCustomValidator"),minDate=new Date,maxDate=new Date;maxDate.setDate(maxDate.getDate());minDate.setMonth(maxDate.getMonth()-2);OverseasCover=function(){function n(){var t=this,n;this.searchInProgress=!1;n=document.getElementById("btnSearchCover");n&&n.addEventListener("click",function(n){return t.memberSearchValidation(n)})}return n.prototype.memberSearchValidation=function(n){var t,i,r,u,f;return $(txtmemId).val()==""&&$(isMemberEligibilityDd).val()=="MemNo"?($(membercustomValidator).removeClass("hidden"),$(txtmemId).addClass("form-control input-validation-error"),t=!1,n.preventDefault()):($(membercustomValidator).addClass("hidden"),$(txtmemId).removeClass("form-control input-validation-error"),t=!0),$(txtmemberSurnameText).val()==""?($(memberSurCustomValidator).removeClass("hidden"),$(txtmemberSurnameText).addClass("form-control input-validation-error"),i=!1,n.preventDefault()):($(memberSurCustomValidator).addClass("hidden"),$(txtmemberSurnameText).removeClass("form-control input-validation-error"),i=!0),$(txtmemberFirstNameText).val()==""?($(memberfirstCustomValidator).removeClass("hidden"),$(txtmemberFirstNameText).addClass("form-control input-validation-error"),r=!1,n.preventDefault()):($(memberfirstCustomValidator).addClass("hidden"),$(txtmemberFirstNameText).removeClass("form-control input-validation-error"),r=!0),$(txtdob).val()==""&&$(isMemberEligibilityDd).val()=="Dob"?($(memberDobCustomValidator).removeClass("hidden"),$(txtdob).addClass("form-control input-validation-error"),u=!1,n.preventDefault()):($(memberDobCustomValidator).addClass("hidden"),$(txtdob).removeClass("form-control input-validation-error"),u=!0),$(ddlgender).val()==""?($(ddlgenderCustomValidator).removeClass("hidden"),$(ddlgender).addClass("input-validation-error"),f=!1,n.preventDefault()):($(ddlgenderCustomValidator).addClass("hidden"),$(ddlgender).removeClass("input-validation-error"),f=!0),t&i&r&f&u},n.prototype.infoWindowOpen=function(n){if(n){var t=n.getMap();return t!==null&&typeof t!="undefined"}return!1},n}();overseas=new OverseasCover;$(window).keydown(function(n){var t=document.activeElement.id,i=document.getElementById("overseaSearch");i&&n.keyCode===13&&t.indexOf("SearchBox")<0&&(n.preventDefault(),document.getElementById("btnSearchCover").click())});$(isMemberEligibilityDd).change(function(){var n=$(isMemberEligibilityDd).val();n=="MemNo"?($("#divMemId").removeClass("hidden"),$("#divSurname").removeClass("hidden"),$("#divFirstName").removeClass("hidden"),$("#divGender").removeClass("hidden"),$("#divButtons").removeClass("hidden"),$("#divdoB").addClass("hidden"),$("#MemberSurnameText").val(""),$("#MemberFirstNameText").val(""),$("#MembershipNumberText").val("")):n=="Dob"?($("#divMemId").addClass("hidden"),$("#divSurname").removeClass("hidden"),$("#divFirstName").removeClass("hidden"),$("#divGender").removeClass("hidden"),$("#divdoB").removeClass("hidden"),$("#divButtons").removeClass("hidden"),$("#MemberSurnameText").val(""),$("#MemberFirstNameText").val(""),$("#MemberDOBText").val("")):($("#divMemId").addClass("hidden"),$("#divSurname").addClass("hidden"),$("#divFirstName").addClass("hidden"),$("#divGender").addClass("hidden"),$("#divdoB").addClass("hidden"),$("#divButtons").addClass("hidden"))});var WebChatService=function(){function n(n){$.ajax({url:"/Handlers/WebchatHandler.ashx?rnd="+Math.random(),type:"get",dataType:"json",success:function(t){n(t)}})}return{getWebchatConfiguration:n}}(),WebChatCommon=function(){function n(n){var t;return t=n=="Chat"?WebChat.Options.chatWindowHeight:WebChat.Options.chatCallbackWindowHeight,window.open("","RegistrationFormPanel","directories=no,titlebar=no,toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=400,height="+t+",bottom=0,right=0")}function t(t,i){globalWebchatWindow=n(i);!globalWebchatWindow||globalWebchatWindow.closed||(globalWebchatWindow.location.href=="about:blank"&&globalWebchatWindow.location.replace(t),globalWebchatWindow.focus())}function i(t,i){globalWebchatWindow=n(i);!globalWebchatWindow||globalWebchatWindow.closed||(globalWebchatWindow.location.href!=t&&globalWebchatWindow.location.replace(t),globalWebchatWindow.focus())}function r(n){for(var i,u=window.location.search.substring(1),r=u.split("&"),t=0;t<r.length;++t)if(i=r[t].split("="),i[0]==n)return i[1];return null}function u(){return navigator.userAgent.toLowerCase().indexOf("android")>-1}function f(){var n=window,t="inner";return"innerWidth"in window||(t="client",n=document.documentElement||document.body),{width:n[t+"Width"],height:n[t+"Height"]}}return{openDefaultChatWindow:t,openChatWindow:i,getQueryStringValue:r,isAndroid:u,viewport:f}}(),WebChat=function(){function i(){n.headerChatMinimisedImageUrl="/Site.Resource/images/chat-icon.svg";n.headerCallbackMinimisedImageUrl="/Site.Resource/images/chat-icon.svg";n.headerChatImageUrl="/Site.Resource/images/webchat-bar-480x80.png";n.headerCallbackImageUrl="/Site.Resource/images/webchat-callback-bar-480x80.png";n.headerCallbackTitle="Request a call back";n.headerChatTitle="Chat with us now";n.chatCallbackTriggerWidth="300";n.chatCallbackWindowWidth="400";n.chatWindowHeight="515";n.chatCallbackWindowHeight="720";n.chatInputWatermarkText="Type your message here and click SEND or press ENTER...";n.chatHeaderHeight=146;n.chatFooterHeight=48;n.chatMinimumReceivedMessageContainerHeight=40;n.chatDefaultResizeWait=500;n.chatInformationUrl="/I3Root/index.html";n.chatMainUrl="/I3Root/chatOrCallback.html"}function r(t){if(i(),t!=null)for(key in n)t[key]&&(n[key]=t[key]);WebChat.Options=n}function u(){WebChatService.getWebchatConfiguration(f)}function f(i){if(i!=null&&i.IsEnabled){if(i.Showchat?(t="Chat",$("body").append('  <div class="chatTriggerContainer">     <div class="chatTriggerHeader">         <img width="'+n.chatCallbackTriggerWidth+'" class="chatHeaderImage" alt="Chat now" src="'+n.headerChatMinimisedImageUrl+'" />     <\/div>  <\/div> ')):(t="Callback",$("body").append('  <div class="chatTriggerContainer">     <div class="chatTriggerHeader callback">         <img width="'+n.chatCallbackTriggerWidth+'" class="chatHeaderImage" alt="Request a callback" src="'+n.headerCallbackMinimisedImageUrl+'" />     <\/div>  <\/div> ')),WebChatCommon.isAndroid())jQuery(window).on("resize",function(){e()});$(".chatTriggerHeader").on({click:function(){var i=n.chatInformationUrl+"?interactionType="+t;WebChatCommon.openDefaultChatWindow(i,t)}})}}function e(){var t=!1,n;document.activeElement&&(n=jQuery(document.activeElement),n.length>0&&(n.is("input")||n.is("textarea"))&&(t=!0));t?jQuery(".chatTriggerContainer").hide():jQuery(".chatTriggerContainer").show()}function o(n){var u=window.location.pathname,r=!0,t,i;if(n!=null&&n!=""&&(t=n.split(","),t!=null&&t.length>0))for(i=0;i<t.length;i++)if(u.toLowerCase()===t[i].toLowerCase()){r=!1;break}return r}var t="",n=[];return{config:r,init:u,allowed:o}}();WebChat.Options=[];WebChatUIIndex=function(){function i(){WebChatService.getWebchatConfiguration(r)}function r(n){n!=null&&n.IsEnabled&&u(n)}function u(i){var u=WebChatCommon.getQueryStringValue("interactionType"),r;$("#divCallbackSuccessMessage").css("display","none");$("#divRequestCallback").css("display","none");$("#divWebChatWelcome").css("display","none");u=="Chat"?(n("txtMembershipNumber",i.MembershipNumber),f(i.ChatQueues),$("#frmChatInfo").validate({rules:{txtName:"required"},messages:{txtName:"Please enter a name"}}),$("#btnStartChat").click(function(n){n.preventDefault();var t=$("#frmChatInfo").valid();t&&e()}),$("#txtMembershipNumber").keypress(function(n){return t(n,jQuery(this))}),$(".chatHeader").addClass("chatHeader-chat"),$(".chatHeader-text").html(WebChat.Options.headerChatTitle),$("#divWebChatWelcome").css("display","block")):u=="Callback"?($("#txtCallbackPhoneNumber").mask("(99) 9999-9999"),n("txtCallbackMembershipNumber",i.MembershipNumber),$("#frmCallbackInfo").validate({rules:{txtCallbackName:"required",txtCallbackPhoneNumber:{required:function(){return $("#txtCallbackEmail").val().length==0}},txtCallbackEmail:{required:function(){return $("#txtCallbackPhoneNumber").val().length==0},email:!0},txtCallbackMessage:"required",ddlPreferredContact:{required:function(){return $("#ddlPreferredContact option:selected").val()==""}}},errorPlacement:function(n,t){t.attr("name")=="txtCallbackMessage"?n.insertBefore("#txtCallbackMessage"):n.insertAfter(t)},messages:{txtCallbackName:"Please enter a name",txtCallbackPhoneNumber:"Please provide either a phone number or email",txtCallbackEmail:"Please provide either a phone number or email",txtCallbackEmail:"Email address is invalid",txtCallbackMessage:"Please type your message below",ddlPreferredContact:"Select preferred contact method"}}),$("#btnSendCallbackRequestMessage").click(function(n){n.preventDefault();var t=$("#frmCallbackInfo").valid();t&&o()}),$("#txtCallbackMembershipNumber").keypress(function(n){return t(n,jQuery(this))}),$(".chatHeader").addClass("chatHeader-callback"),$(".chatHeader-text").html(WebChat.Options.headerCallbackTitle),$("#divRequestCallback").css("display","block")):u=="CallbackSuccess"&&(r=decodeURIComponent(WebChatCommon.getQueryStringValue("callbackUsername")),r!=null&&r.length>0&&$("#spanCallbackUserName").text(r),$(".chatHeader-text").html(WebChat.Options.headerCallbackTitle),$(".chatHeader").addClass("chatHeader-callback"),$("#divCallbackSuccessMessage").css("display","block"));$(".chatContainer").css("display","block")}function n(n,t){t.length>0&&($("#"+n).val(t),$("#"+n).prop("disabled",!0))}function f(n){$("#ddlChatAbout").append('<option value="">Please Select<\/option>');$.each(n,function(n,t){$("#ddlChatAbout").append('<option value="'+t.Value+'">'+t.Key+"<\/option>")})}function e(){var n=$("#txtName").val(),t=WebChatCommon.getQueryStringValue("interactionType"),i=$("#txtMembershipNumber").val(),f=$("#txtEmail").val(),r=$("#ddlChatAbout").val(),u=WebChat.Options.chatMainUrl+"?chatUsername="+n+"&chatPassword=&interactionType="+t+"&target="+r+"&targetType=Workgroup&memberNo="+i;WebChatCommon.openChatWindow(u)}function o(){var i=$("#txtCallbackName").val(),n=$("#txtCallbackPhoneNumber").val(),r=encodeURIComponent($("#txtCallbackMessage").val()),u=WebChatCommon.getQueryStringValue("interactionType"),f=$("#txtCallbackMembershipNumber").val(),e=$("#txtCallbackEmail").val(),o=$("#ddlPreferredContact option:selected").text(),t;n==""&&(n="NA");t=WebChat.Options.chatMainUrl+"?callbackUsername="+i+"&callbackPassword=&interactionType="+u+"&callbackTelephone="+n+"&memberNo="+f+"&email="+e+"&preferredContact="+o+"&callbackDescription="+r;WebChatCommon.openChatWindow(t,"Callback")}function t(n,t){if(t.val().length<parseInt(t.attr("maxlength"))){if(n.which!=8&&n.which!=0&&(n.which<48||n.which>57))return!1}else return!1;return!0}return{load:i}}();WebChatUIChatCallback=function(){function i(){}function r(){var t=document.getElementsByClassName("iwt-exit-button"),r,i,n,u,e,o;t.length>0&&t[0].setAttribute("value","Exit Chat");r=document.getElementsByClassName("iwt-input");r.length>0&&r[0].setAttribute("placeholder",WebChat.Options.chatInputWatermarkText);i=document.getElementsByClassName("iwt-print-div");i.length>0&&(i[0].getElementsByTagName("a")[0].innerHTML="Print Chat History",t.length>0&&i[0].appendChild(t[0]));n=document.getElementById("participantsPanel");u='   <div class="chatHeader chatHeader-chat">        <div class="chatHeader-left">  <\/div>        <div class="chatHeader-right"> <\/div>        <div class="chatHeader-center chatHeader-slice">     <div class="chatHeader-text">'+WebChat.Options.headerChatTitle+"<\/div> <\/div> <\/div>";n.insertAdjacentHTML?n.insertAdjacentHTML("beforebegin",u):(e=document.createRange(),o=e.createContextualFragment(u),n.parentNode.insertBefore(o,n));f()}function u(){chatHistoryWindow=window.open("","Chat_History");!chatHistoryWindow||chatHistoryWindow.closed||(jQuery("body table tr td:nth-child(3)",chatHistoryWindow.document).each(function(){var n=jQuery(this);n.html(n.text())}),chatHistoryWindow.focus())}function f(){if(typeof jQuery!="undefined"&&jQuery.noConflict(!0),jQuery(".iwt-exit-button").wrap('<div class="iwt-exit-button-wrapper"><\/div>'),jQuery(".iwt-exit-button").attr("class","iwt-exit-button"),jQuery(".iwt-chat-printable-history-link").length>0){jQuery(".iwt-chat-printable-history-link").removeClass("pull-right");jQuery(".iwt-chat-printable-history-link").on("click",function(){u()})}if(jQuery(".iwc-send-button").length>0&&jQuery(".iwc-send-button").removeClass("btn btn-lg"),jQuery(".iwt-print-div").length>0&&jQuery(".iwt-print-div").attr("class","iwt-print-div col-sm-4 col-sm-push-8"),jQuery(".iwt-participants-panel-list-container").length>0&&jQuery(".iwt-participants-panel-list-container").attr("class","iwt-participants-panel-list-container col-sm-8 col-sm-pull-4"),jQuery("#iwt-compose-message-textarea").length>0&&(jQuery("#iwt-compose-message-textarea").focus(),jQuery("#iwt-compose-message-textarea").focusout()),WebChatCommon.isAndroid())jQuery(window).on("orientationchange",function(){n()});else jQuery(window).on("resize",function(){n()});t=setInterval(n,WebChat.Options.chatDefaultResizeWait)}function e(){var n="Chat",t=WebChat.Options.chatInformationUrl+"?interactionType="+n;WebChatCommon.openChatWindow(t,n)}function o(){var n="CallbackSuccess",t=WebChatCommon.getQueryStringValue("callbackUsername"),i=WebChat.Options.chatInformationUrl+"?interactionType="+n+"&callbackUsername="+t;WebChatCommon.openChatWindow(i,n)}function n(){var n,i;if(jQuery(".iwt-input").length>0&&jQuery(".iwt-input").blur(),n=jQuery("#participantsPanel").outerHeight(!0),n&&n>0){var u=n+jQuery(".chatHeader").outerHeight(!0),f=WebChat.Options.chatFooterHeight,r=WebChatCommon.viewport().height;r!=null&&(i=r-(u+f),i>WebChat.Options.chatMinimumReceivedMessageContainerHeight&&(jQuery(".iwt-received-messages-panel").css("height",i),jQuery(".iwt-received-messages-panel > ul").css("height",i)));clearInterval(t)}}var t;return{load:i,chatCreate:r,chatComplete:e,callbackCreate:o,chatLoad:n}}()