function markFormAsSubmitted(n,t){$(".loading").removeClass("hide");$("body").css("cursor","progress");n.data("submitted",t)}function escapeHtml(n){var t={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};return String(n).replace(/[&<>"'\/]/g,function(n){return t[n]})}function SetupCropperOnImage(n){n=typeof n!="undefined"?n:1.5;$(".img-container > img").cropper({aspectRatio:n,minContainerWidth:475,minCanvasWidth:100,minCanvasHeight:100,minCropBoxWidth:100,minCropBoxHeight:100,autoCropArea:1,crop:function(n){$("#dataX").val(Math.round(n.x));$("#dataY").val(Math.round(n.y));$("#dataHeight").val(Math.round(n.height));$("#dataWidth").val(Math.round(n.width));$("#dataRotate").val(Math.round(n.rotate))}})}function ToggleRiskClosure(){var n=$("#allMitgationActionsComplete").is(":checked");n?($("#riskMinimised_container").show(),$("#riskEliminated_container").show()):($("#riskMinimised_container").hide(),$("#riskEliminated_container").hide(),$("#riskMinimised").prop("checked",!1),$("#riskEliminated").prop("checked",!1),$("#riskNone").prop("checked",!0))}function DisableSubmitIfUnmetRequirements(n){var t=$('input[type="submit"]');if(typeof window.validateForm=="function"&&!window.validateForm()){t.prop("disabled",!0);return}if(typeof window.formChanged=="function"&&window.formChanged()){t.prop("disabled",!1);return}t.prop("disabled",!n)}function BindControlsEventsToEnableSubmitButton(){var n=$('input[type="submit"]');(typeof window.defaultSubmitToEnabled=="undefined"||window.defaultSubmitToEnabled===!1)&&n.prop("disabled",!0);$('input[type="text"]').on("input change",function(n){$(n.target).data("optional")?DisableSubmitIfUnmetRequirements(1):DisableSubmitIfUnmetRequirements($(this).val().length)});$('input[type="radio"]').on("change",function(){DisableSubmitIfUnmetRequirements(1)});$('input[type="checkbox"]').on("change",function(){DisableSubmitIfUnmetRequirements(1)});$('input[type="file"]').on("change",function(){var n=$(this).val().length;DisableSubmitIfUnmetRequirements(n)});$("select").on("change",function(){DisableSubmitIfUnmetRequirements(1)});$("textarea").on("input",function(){DisableSubmitIfUnmetRequirements($(this).val().length)});$('input[type="password"]').on("input change",function(){DisableSubmitIfUnmetRequirements($(this).val().length)})}function showHideSection(n,t,i){var r=$(n),u=$(t);showHideSectionBasedOnToggle(r,u,i)}function showHideSectionBasedOnToggle(n,t,i){var r=n.is(":checked");showHideSectionBasedOnValue(r,t,i)}function showHideSectionBasedOnValue(n,t,i){var r=n?t.slideDown:t.slideUp,u=n?t.show:t.hide,f=i?r:u;f.call(t)}jQuery.fn.preventDoubleSubmission=function(){$(this).on("submit",function(n){var t=$(this);t.data("submitted")&&t.data("submitted")!==n.timeStamp?n.preventDefault():$.isFunction(t.valid)?t.valid()&&markFormAsSubmitted(t,n.timeStamp):markFormAsSubmitted(t,n.timeStamp)});return this};$(document).ready(function(){navigator.cookieEnabled||(window.location="/OnSide/CookiesRequired.html");$("form").preventDoubleSubmission()}),function(){window.onSideSettings||(window.onSideSettings={},window.onSideSettings.googleMapsUrl="https://{s}.google.com/vt/lyrs=s,h&x={x}&y={y}&z={z}")}(),function(){typeof String.prototype.endsWith!="function"&&(String.prototype.endsWith=function(n){return this.indexOf(n,this.length-n.length)!==-1})}(),function(){$("html").bind("hidden.bs.modal",function(){$("body").removeClass("modal-open")});$("html").bind("shown.bs.modal",function(){$("body").addClass("modal-open")})}(),function(){function n(n,t){$("#"+t).change(function(){$("."+n).css("display","none")})}$("[validation-failure-subject]").each(function(){var t=$(this);n(t.attr("validation-failure-subject"),t.attr("id"))})}()