function onDateSelected(n,t){var i;i=t.indexOf(":")>0?t.split(" ")[0]:t;n.data("threepartdate")=="True"?(i=i.split("/"),n.parent().siblings("div.day").children("input").val(i[0]),n.parent().siblings("div.month").children("input").val(i[1]),n.parent().siblings("div.year").children("input").val(i[2])):n.parent().siblings("div.compactDate").children("input").val(i)}function setDatePickerDate(n){var t;if(n.data("threepartdate")=="True"){var i=n.parent().siblings("div.day").children("input").val(),r=n.parent().siblings("div.month").children("input").val()-1,u=n.parent().siblings("div.year").children("input").val();t=new Date(u,r,i);t.getDate()!=i||t.getMonth()!=r||t.getFullYear()!=u?n.val(""):n.val(t.getDate()+"/"+(t.getMonth()+1)+"/"+t.getFullYear())}else n.val(n.parent().siblings("div.compactDate").children("input").val())}function setupDatePicker(){$(".attachDatePicker").datepicker({onSelect:function(n){onDateSelected($(this),n)},beforeShow:function(){setDatePickerDate($(this))},buttonImage:"/SiteAssets/Modules.PublicWebsite.UI.Web/Assets/Images/icon-calendar-2.png",buttonImageOnly:!0,showOn:"both",dateFormat:"dd/mm/yy",changeMonth:!0,changeYear:!0,buttonText:abritas.data("selectDateWording"),showButtonPanel:!1,yearRange:"c-100:c+100"})}function setupTimePicker(){$(".attachDateTimePicker").each(function(){var n='[id="'+$(this).data("timefieldid")+'"]';$(this).datetimepicker({onSelect:function(n){onDateSelected($(this),n)},beforeShow:function(){setDatePickerDate($(this))},buttonImage:"/SiteAssets/Modules.PublicWebsite.UI.Web/Assets/Images/icon-calendar-2.png",buttonImageOnly:!0,showOn:"both",dateFormat:"dd/mm/yy",changeMonth:!0,changeYear:!0,buttonText:abritas.data("selectDateWording"),altField:n,altTimeFormat:"HH:mm:ss",controlType:"select",oneLine:!0,timeFormat:"HH:mm:ss",showMillisec:!1,showMicrosec:!1,showTimezone:!1,yearRange:"c-100:c+100"})})}function setupDateFieldAutoTabbing(){$(".dateControl input").filter(":not([data-autotabbingenabled])").keydown(function(n){var i=0,r=0,t=0;$(n.target)[0].selectionEnd!=null?t=$(n.target)[0].selectionEnd-$(n.target)[0].selectionStart:document.selection!==null&&(t=document.selection.createRange().text);t==0&&$(n.target).val().length>0&&(n.which==111||n.which==220||n.which==110||n.which==190)?(i=1,n.preventDefault()):n.which==8||n.which==46?$(n.target).val().length==0&&(r=1,n.preventDefault()):(n.which!=9||n.shiftKey)&&(n.which==9&&n.shiftKey||n.which>=37&&n.which<=40||n.which==13||(n.which>=48&&n.which<=57||n.which>=96&&n.which<=105?$(n.target).attr("maxlength")!=undefined&&$(n.target).val().length-t>=$(n.target).attr("maxlength")&&n.preventDefault():n.preventDefault()));i?$(n.target).parent().next().children("input:visible").focus():r&&$(n.target).parent().prev().children("input:visible").focus()}).keyup(function(n){var t=0;$(n.target)[0].selectionEnd!=null?t=$(n.target)[0].selectionEnd-$(n.target)[0].selectionStart:document.selection!==null&&(t=document.selection.createRange().text);isNaN(t)&&(t=0);n.which==8||n.which==46||n.which==9&&n.shiftKey||n.which>=37&&n.which<=40||n.which>31&&$(n.target).attr("maxlength")!=undefined&&$(n.target).val().length-t==$(n.target).attr("maxlength")&&$(n.target).parent().next().children("input:visible").focus()}).focus(function(){$(this).select()}).data("autotabbingenabled",!0)}function callServer(n,t,i,r,u){return callServerWithOptions({url:n,data:t,success:i,error:r,type:u})}function callServerWithOptions(n){var t,i,u,r;if(!n)throw{name:"No options",message:"No options specified for callServer"};if(n.type===window.undefined&&(n.type=typeof n.data===window.undefined||n.data==null?"GET":"POST"),n.data||(n.data=Array()),!n.preventAppendLastUpdateValues)if(t=abritas.util.getLastUpdateValues(),$.isArray(n.data))for(i in t)n.data.push(t[i]);else for(i in t)n.data[t[i].name]=t[i].value;return u={},r=abritas.util.getAuthTokenInput(),r.length>0&&(n.data[r.attr("name")]=r.val(),u[".CLAUTH"]=r.val()),$.ajaxAntiForgery({xhrFields:{withCredentials:!0},type:n.type,headers:u,url:n.url,cache:!1,data:n.data,success:function(t){if(abritas.ajax.redirectIfRequired(t))return!1;abritas.sessionTimeout.restartTimer();abritas.ajax.isPluginCallbackResponse(t)?(abritas.util.updateLastUpdateValues(t.LastUpdate.names,t.LastUpdate.values),n.success(t.Response)):n.success(t);abritas.data.updateData()},error:function(t,i,r){abritas.info.isWindowUnloading||(n.error&&n.error!=null?n.error(t,i,r):abritas.ajax.defaultErrorHandler(t,i,r))},options:n})}function initialiseMapHelper(){$("