function DisplayTimeOutPopUp(){var t=window.location.origin+"/CrashRetrieval/OhioCrashReportRetrieval/ClearOutSession",n=parseInt($("#timeout").val());n>=20?($("#timeOutModal").modal("hide"),window.location.href=t):n>=15?($("body").addClass("submit-progress-bg"),$("#timeOutModal").modal("show"),$("#timeout").val(n+1)):$("#timeout").val(n+1)}function clearTimeOutPopUp(){clearInterval(myInterval);$("#timeout").val(1);myInterval=setInterval(DisplayTimeOutPopUp,6e4)}function getUrl(n){return window.location.pathname.toLowerCase().indexOf("OhioCrashReportRetrieval/Search".toLowerCase())!=-1?n="../"+n:window.location.pathname.toLowerCase().substr(-15)=="/CrashRetrieval".toLowerCase()&&(n=n.replace("../","")),n}function getDate(n){var t=new Date(n);return t.getMonth()+1+"/"+t.getDate()+"/"+t.getFullYear()}$("#btnSearch").click(function(){$("#txtCaptcha").val($("#txtCaptcha").val().replace(/[^a-zA-Z0-9]/g,""));$("#txtDocumentNumber").val($("#txtDocumentNumber").val().replace(/[^0-9;]/g,""));$("#Parameters_OnSearch").val(!0)});$("#ddlAgencies").on("change",function(){$("#Agency").val($(this).find("option:selected").text())});$(function(){$(document).on("dp.change","#startDatePicker",function(){$("#txtCrashEndDate").val($("#txtCrashStartDate").val())})});$(function(){$(document).ajaxStart(function(){ODPS.Helpers.ShowLoaderNow()});$(document).ajaxComplete(function(){ODPS.Helpers.HideLoader()});$(document).ajaxStop(function(){ODPS.Helpers.HideLoader()});$(document).ajaxError(function(){ODPS.Helpers.HideLoader()});$(document).submit(function(){ODPS.Helpers.ShowLoaderNow()});$(".btn-captcha").click(function(){var n=window.location.origin+"/CrashRetrieval/OhioCrashReportRetrieval/RefreshCaptcha";$.ajax({type:"GET",url:n,contentType:"image/png",success:function(n){$(".captchaImage").attr("src","data:image/png;base64,"+n)}})})});$("#ddlCounties").on("change",function(){var t=window.location.origin+"/CrashRetrieval/OhioCrashReportRetrieval/GetAgenciesByCountyID",n=parseInt($(this).find("option:selected").val());isNaN(n)&&$("#Agency").val("");$.ajax({type:"GET",url:t,data:{county:n},contentType:"application/json; charset=utf-8"}).done(function(n){$("#ddlAgencies").empty();n!=null&&($("#ddlAgencies").empty(),$("#ddlAgencies").append('<option value="">- Please Select -<\/option>'),$.each(n,function(n,t){$("#ddlAgencies").append('<option value="'+t.Value+'">'+t.Text+"<\/option>")}))}).fail(function(n){n.status!=0})});$(document).ready(function(){if($("#ResultCount").val()>0||$("#NoDataFound").val().length>0)return $(window).width()<700&&($(".CrashLocation").hide(),$(".Agency").hide(),$(".Jurisdiction").hide()),$("#Parameters_OnSearch").val(!1),!0;$("#txtCrashStartDate").html(function(){$("#txtCrashStartDate").val().length>0&&$("#txtCrashStartDate").val(getDate($("#txtCrashStartDate").val()))});$("#txtCrashEndDate").html(function(){$("#txtCrashEndDate").val().length>0&&$("#txtCrashEndDate").val(getDate($("#txtCrashEndDate").val()))})});$(function(){$("#TempDataMessage").val()&&$("#tempDataMessageModal").modal("show")});$(".grid-button").click(function(){setTimeout(function(){HideLoader()},100)});var myInterval;clearTimeOutPopUp();$(function(){$("#timeOutButton").click(function(){var n=window.location.origin+"/CrashRetrieval/OhioCrashReportRetrieval/ExtendSession";$("body").removeClass("submit-progress-bg");$("#timeOutModal").modal("hide");$.ajax({url:n,data:{},cache:!1,type:"POST",dataType:"html",success:function(){clearTimeOutPopUp()}})})});$("#txtCaptcha").on("keyup",function(){this.value.match(/[^a-zA-Z0-9]/g)&&(this.value=this.value.replace(/[^a-zA-Z0-9]/g,""))});$("#txtDocumentNumber").on("keyup",function(){this.value.match(/[^0-9;]/g)&&(this.value=this.value.replace(/[^0-9;]/g,""))})