function GetTheFeedback(){var r=$("form").validate(),i,n,t;return $("form").valid()?($("input[id=IsAnonymous_1]:checked").val()==="1"?$("#confirmMessage").val("Press Submit to send your feedback to the Housing Authority.<br /><br />If you wish to make changes, click Back"):$("#confirmMessage").val("Press Submit to send your Anonymous feedback to the Housing Authority.<br /><br />If you wish to make changes, click Back"),t=bootbox.confirm({message:$("#confirmMessage").val(),buttons:{confirm:{label:"Submit",className:"btn-success"},cancel:{label:"Back",className:"btn-default"}},callback:function(n){n&&$("form").submit()}}),t.init(function(){var i="_"+Math.random().toString(36).substr(2,9),r="modalTitle"+i,n;$(t).find(".modal-title").attr("id",r);n="modalDesc"+i;$(t).find(".bootbox-body").attr("id",n);$(t).attr("aria-labelledby",r);$(t).attr("aria-describedby",n)}),!0):(i="",r.errorList.forEach(function(n){i+=n.message+"<br />"}),n=bootbox.alert({title:"Please attend to the following list before attempting to submit again, thanks",message:i}),n.init(function(){var i="_"+Math.random().toString(36).substr(2,9),r="modalTitle"+i,t;$(n).find(".modal-title").attr("id",r);t="modalDesc"+i;$(n).find(".bootbox-body").attr("id",t);$(n).attr("aria-labelledby",r);$(n).attr("aria-describedby",t)}),!1)}$(document).ready(function(){$("#buttonSave").addClass("disabled").prop("disabled",!0).attr("aria-disabled","true");$("#reCapLoader").hide();$("#buttonCancel").click(function(){$("#IgnoreDirtyDataCheck").val(!0)});$("#buttonHousingAuth").click(function(){$('<a href="/Client/Index" target="blank"><\/a>')[0].click()});$("#buttonCancel").click(function(){var n=bootbox.confirm({message:"Are you sure that you wish to cancel This submission?",buttons:{confirm:{label:"Yes",className:"btn-success"},cancel:{label:"No",className:"btn-default"}},callback:function(n){n&&(window.location.href="/Public/Index")}});n.init(function(){var i="_"+Math.random().toString(36).substr(2,9),r="modalTitle"+i,t;$(n).find(".modal-title").attr("id",r);t="modalDesc"+i;$(n).find(".bootbox-body").attr("id",t);$(n).attr("aria-labelledby",r);$(n).attr("aria-describedby",t)})});$("#buttonSave").on("click",function(){grecaptcha.reset();var n=$(this).data("recaptcha");n==="1"?GetTheFeedback():bootbox.alert("Please re-attempt the reCAPTCHA verification and try submitting feedback again.  Thanks")});radioLoadInitialValues();radioChangeValue();radioTrafficLoadInitialValues();radioTrafficChangeValue()});var onloadCallback=function(n){$("#reCapLoader").show();$.ajax({type:"POST",url:"/Public/GetTheRecapTok",data:{token:n},cache:!1}).success(function(n){var t=n;t.Success?($("#buttonSave").data("recaptcha","1"),$("#buttonSave").removeClass("disabled").prop("disabled",!1).attr("aria-disabled","false")):($("#buttonSave").data("recaptcha","0"),$("#buttonSave").addClass("disabled").prop("disabled",!0).attr("aria-disabled","true"));$("#reCapLoader").hide()}).error(function(n,t,i){var r="Message: "+t+"\n";r+="Source: NewIndex.js.GetTheRecapTok.ajax.error\n";r+="Exception:\n"+i;alert("An error occured and was unable to be logged.  Please capture (or print) screen for support.\n\n"+r);$("#reCapLoader").hide()})};$(document).ready(function(){function i(){$("#"+n+"AuthorIsAdvocate").val().toLowerCase()==="true"?$("#"+n+"IsAnonymous").val()==="2"?($("#"+n+"ClientKnownOrAnonymous_3").prop("checked",!0).trigger("click").trigger("change"),$("#"+n+"divAuthorContactDetails").hide("slow")):$("#"+n+"IsAnonymous").val()==="1"&&($("#"+n+"divAuthorContactDetails").show("slow"),o()):($("#"+n+"divAuthorContactDetails").hide("slow"),$("#"+n+"IsAnonymous").val()==="2"?$("#"+n+"ClientKnownOrAnonymous_3").prop("checked",!0).trigger("click").trigger("change"):$("#"+n+"IsAnonymous").val()==="1"&&$("#"+n+"ClientKnownOrAnonymous_1").prop("checked",!0).trigger("click").trigger("change"));s();$("form").validate()}function o(){$("#"+n+"ClientKnownOrAnonymous").val()==="1"?$("#"+n+"divClientRepresentDetails").show("slow"):$("#"+n+"divClientRepresentDetails").hide("slow")}function s(){$("#"+n+"IsAnonymous").val()==="1"?$("#"+n+"divPreferredContactMethod").show("slow"):$("#"+n+"divPreferredContactMethod").hide("slow")}function r(){$("#"+n+"PreviousFlag").val().toLowerCase()==="true"?$("#"+n+"prevFileNoHidden").show("slow"):$("#"+n+"prevFileNoHidden").hide("slow")}function u(){$("#"+n+"AdvocateAuthority").val().toLowerCase()==="true"?$("#"+n+"divAdvocateAuthorityReason").show("slow"):$("#"+n+"divAdvocateAuthorityReason").hide("slow")}function f(){$("#"+n+"SpecialRequirements").val().toLowerCase()==="true"?$("#"+n+"divOtherDisabilities").show("slow"):$("#"+n+"divOtherDisabilities").hide("slow")}function e(){$("#"+n+"ResponseRequired").val().toLowerCase()==="true"?$("#"+n+"divResponseRequired").show("slow"):$("#"+n+"divResponseRequired").hide("slow")}var n="",t="";$("[id$='FeedbackForm_Prefix']").length>0&&$("[id$='FeedbackForm_Prefix']").val()!==""&&(n=$("[id$='FeedbackForm_Prefix']").val()+"_",t=$("[id$='FeedbackForm_Prefix']").val()+".");$("#"+n+"divAuthorContactDetails").hide();$("#"+n+"divAdvocateAuthorityReason").hide();$("#"+n+"divPreferredContactMethod").hide();$("#"+n+"divClientRepresentDetails").hide();$("#"+n+"OtherDisabilities").hide();$("#"+n+"prevFileNoHidden").hide();$("#"+n+"divResponseRequired").hide();$("#"+n+"IssueDesc").attr("placeholder","Enter your issue");$("#"+n+"IssueOutcomeDesc").attr("placeholder","Enter what result would you expect from your issue");$("input[name='"+t+"AuthorIsAdvocate'][type='radio']").on("change",i);$("input[name='"+t+"IsAnonymous'][type='radio']").on("change",i);$("input[name='"+t+"ClientKnownOrAnonymous'][type='radio']").on("change",o);$("input[id='"+n+"PreviousFlag_Yes'][type='radio']").not(".disabled").on("change",r);$("input[id='"+n+"PreviousFlag_No'][type='radio']").not(".disabled").on("change",r);$("input[id='"+n+"AdvocateAuthority_Yes'][type='radio']").not(".disabled").on("change",u);$("input[id='"+n+"AdvocateAuthority_No'][type='radio']").not(".disabled").on("change",u);$("input[id='"+n+"SpecialRequirements_No'][type='radio']").not(".disabled").on("change",f);$("input[id='"+n+"SpecialRequirements_Yes'][type='radio']").not(".disabled").on("change",f);$("input[id='"+n+"ResponseRequired_Yes'][type='radio']").not(".disabled").on("change",e);$("input[id='"+n+"ResponseRequired_No'][type='radio']").not(".disabled").on("change",e);i();u();r();f();s();e();countCharacters($("#"+n+"IssueDesc"),$("#"+n+"IssueDescCharCount"),2e3);$("#"+n+"IssueDesc").on("keyup",function(){countCharacters($(this),$("#"+n+"IssueDescCharCount"),2e3)});countCharacters($("#"+n+"IssueOutcomeDesc"),$("#"+n+"IssueOutcomeDescCharCount"),2e3);$("#"+n+"IssueOutcomeDesc").on("keyup",function(){countCharacters($(this),$("#"+n+"IssueOutcomeDescCharCount"),2e3)});countCharacters($("#"+n+"AdvocateAuthorityDesc"),$("#"+n+"AdvocateAuthorityDescCharCount"),1e3);$("#"+n+"AdvocateAuthorityDesc").on("keyup",function(){countCharacters($(this),$("#"+n+"AdvocateAuthorityDescCharCount"),1e3)});countCharacters($("#"+n+"PrevRefNo"),$("#"+n+"PrevRefNoCharCount"),512);$("#"+n+"PrevRefNo").on("keyup",function(){countCharacters($(this),$("#"+n+"PrevRefNoCharCount"),512)});countCharacters($("#"+n+"SpecialRequirementsDesc"),$("#"+n+"SpecialRequirementsDescCharCount"),100);$("#"+n+"SpecialRequirementsDesc").on("keyup",function(){countCharacters($(this),$("#"+n+"SpecialRequirementsDescCharCount"),100)})})