var AIS;jQuery(function(n){n.datepicker.regional["en-GB"]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"dd/mm/yy",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""};n.datepicker.buttonText="Calendar";n.datepicker.setDefaults(n.datepicker);n.datepicker.setDefaults(n.datepicker.regional["en-GB"])});typeof AIS!="object"&&(AIS={});typeof AIS.Views!="object"&&(AIS.Views={});typeof AIS.Views.Shared!="object"&&(AIS.Views.Shared={});AIS.Views.Shared.Master=function(){return{Init:function(){$(document).ready(function(){var u=$(window),n=Math.round($("#ais-logo").width()/14.15),t,i,r;n==0&&(n=Math.round($("#mobile-header-title").width()/14.75));$(".am-logo").height(n);$(".am-logo-div").height(n);$(".am-logo.x2a").height(n/1.7);$(".am-logo.x2b").height(n/1.7);$(".am-logo.x2a").width(n/1.7);$(".am-logo.x2b").width(n/1.7);$(".am-logo.x1").height(n);u.on("resize",function(){var n=Math.round($("#ais-logo").width()/14.75);n==0&&(n=Math.round($("#mobile-header-title").width()/14.75));$(".am-logo").height(n);$(".am-logo-div").height(n);$(".am-logo.x2a").height(n/1.7);$(".am-logo.x2b").height(n/1.7);$(".am-logo.x2a").width(n/1.7);$(".am-logo.x2b").width(n/1.7);$(".am-logo.x1").height(n)});$(".fa-question-circle").removeClass("fa").addClass("far");$(".search-group.options").hide();t=$("#q-search-id").val();i=$("li[data-search-id='"+t+"']").text();$(".search-group.button > .label").text(i);$(".search-group.button").on("click",function(){$(".search-group.options").toggle(50)});$(".search-group.options > ul > li").on("click",function(){var t=$(this).parent().parent().parent(),i=$(this).attr("data-search-id"),n;t.find(".label").text(this.innerText);n=$(this).parent().find("#q-search-id");n.attr("value",i);$(".search-group.options").toggle(50)});r=AIS.RecordSelection.SelectionCounter();r.each(function(){$(this).html().length>0&&$(this).addClass("ais-menu-item-tip-border")});$.ajaxSetup({cache:!1,error:function(){window.location=AIS.Helpers.ResolveUrl("/error")}});$("body").ajaxStart(function(){$(".ais-temporary-message-script").remove();AIS.Views.Shared.AjaxTimeout=setTimeout("$('.ais-loader').addClass('loading')",500)}).ajaxComplete(function(){clearTimeout(AIS.Views.Shared.AjaxTimeout);$(".ais-loader").removeClass("loading")});$(".ais-request-will").on("click",function(n){n.preventDefault();$.ajax({url:AIS.Helpers.ResolveUrl("helper/GetSearchResult"),dataType:"json",data:{Database:"research",SearchStatement:"((s0="+$("#ais-borrower-number").val()+" and not order.status = RETURNED_DESK) and not order.status = RETURNED_STORE) and order.status.date=Today&fields=priref,borrower.number",Limit:1,Fields:"priref"},success:function(n){var t=parseInt(n.Hits)>0?n.Result.record[0]["borrower.number"][0].borrower_category.maximum_loans[0]:100;n===null?$(".ais-will-message").show().html('<span color="red" class="fas fa-times-circle"><\/span> Error'):parseInt(n.Hits)>=parseInt(t)?$(".ais-will-message").show().html('<span color="red" class="fas fa-times-circle"><\/span> Max loans exceeded: '+n.Hits):parseInt(n.Hits)<parseInt(t)?window.location=AIS.Helpers.ResolveUrl("Request/Will"):$(".ais-will-message").show().html('<span color="red" class="fas fa-times-circle"><\/span> ????')}})});$("body").on("click",function(){$(".ais-language-list-element").hide()});$(".ais-language-open-list-script").on("click",function(n){n.preventDefault();n.stopPropagation();$(".ais-language-list-element").toggle()});$(".ais-language-list-element").hover(function(){},function(n){n.preventDefault();n.stopPropagation();$(".ais-language-list-element").hide()});$(".ais-helpsubject.ais-helpsubject-script").removeAttr("target");$(".zais-helpsubject-script").on("click",function(n){var o,r,t,s,h;n.preventDefault();var u=$(this).parent().find(".ais-helpsubject-value"),f=$(this).parent().find(".ais-helpsubjectsection-value"),i=$(this).parent().find(".ais-helpsubject-type-value"),e=["page","field"],c=e[0];if($(u).length!==0){o=$(f).length!==0?"#"+f.val():"";r="";r=$(i).length!==0&&$.inArray($(i).val().toString(),e)?$(i).val().toString():c;t=null;s="left=100,top=100";switch(r){case"page":t="width=640,height=480";break;case"field":t="width=300,height=450"}h=window.open(AIS.Helpers.ResolveUrl("/helpers/gethelp?subject="+$(u).val()+o),"Help","fullscreen=no,toolbar=no,status=no,menubar=no,scrollbars=yes,resizable=yes,directories=no,location=no,"+t+","+s);h.focus()}else alert("No topic found for this page.")});$(".ais-activator-script").on("click",function(n){n.preventDefault();var t=$(this).children("input[type='hidden'][class='ais-id-to-activate-value']").val();window.location.href=$("#"+t).attr("href")});AIS.Helpers.AttachDatePicker();AIS.Helpers.AttachTimePicker();AIS.Helpers.SetFocusFirstInput("form");$("form").on("submit",function(){$.each($(".ais-field-type-email-script"),function(){var n=this.value,t;n!==undefined&&(t="mailto:",n=AIS.Helpers.Trim(n),n.toLowerCase().indexOf(t)<0&&(n=t+n,this.value=n))})});$("#ais-main").touchwipe({wipeLeft:function(){$("#ais-main").addClass("swipe-left");var n=$(".prev-page-script > a");n!==undefined&&n.length>=1&&(window.location.href=n.attr("href"))},wipeRight:function(){$("#ais-main").addClass("swipe-right");var n=$(".next-page-script > a");n!==undefined&&n.length>=1&&(window.location.href=n.attr("href"))},min_move_x:20,min_move_y:20,preventDefaultEvents:!1})})}}}();AIS.Views.Shared.Master.Init();typeof AIS!="object"&&(AIS={});typeof AIS.Views!="object"&&(AIS.Views={});typeof AIS.Views.Navigator!="object"&&(AIS.Views.Navigator={});AIS.Views.Navigator=function(){var n=function(n){$("html, #ais-master").animate({scrollTop:0},300);$.ajax({url:window.location.href.replace("#","")+"/"+$.trim(n),dataType:"json",data:{},beforeSend:function(){AIS.WindowManager.ShowResultsLoader()},complete:function(){AIS.WindowManager.HideResultsLoader()},success:function(n){n.Content&&$(".ais-partial-container-script").first().html(n.Content);n.Message&&AIS.Helpers.AddUserMessage(n.Message,n.MessageType,!1,!1)},error:function(n){alert(n)}})};return{Init:function(){$(document).ready(function(){$(".ais-navigator-script .ais-page-input-script").numeric();$(this).on("click",".nav-block.goto",function(t){if(t.target.tagName=="div")n(Number(t.target.attributes["data-topage"].value));else{var i=$(this).closest(".nav-block").attr("data-topage");n(Number(i))}})})},Prev:function(){return Number($(".ais-navigator-script .current-page-num").val())-1},Next:function(){return Number($(".ais-navigator-script .current-page-num").val())+1},First:function(){return 1},Last:function(){return Number($(".ais-navigator-script .nav-total-pages").val())}}}();AIS.Views.Navigator.Init()