function loadAutoSugggest(){function n(){var n=Microsoft.Maps.LocationRect.fromCorners(new Microsoft.Maps.Location(47.487912,-90.432779),new Microsoft.Maps.Location(41.670924,-82.409652)),t={maxResults:5,bounds:n,autoDetectLocation:!1,autoDetectLocation:!1,countryCode:"US"},r=new Microsoft.Maps.AutosuggestManager(t);r.attachAutosuggest("#Address","#searchBoxContainer",i)}function t(){}function i(n){$("#Latitude").val(n.location.latitude);$("#Longitude").val(n.location.longitude)}Microsoft.Maps.loadModule("Microsoft.Maps.AutoSuggest",{credentials:"AkGcMAL0Mi6vh0-DpI500TDfbII91OR1klN59xr58ckkY_qxXegOkHcIN9AEZ1Fo",callback:n,errorCallback:t})}function getUrlParameter(n,t){for(var u=n.split("&"),i,r=0;r<u.length;r++)if(i=u[r].split("="),i[0]===t)return i[1]===undefined?!0:decodeURIComponent(i[1])}$(document).ready(function(){$("#btnCountySearch").off("click").on("click",function(n){if(!$("#county-Form").valid())return!1;n.preventDefault();var t={CountyName:$("#Counties option:selected").text(),CountyID:$("#Counties").val(),Address:"",Latitude:0,Longitude:0,Counties:null};$.ajax({method:"POST",cache:!1,url:"/Voter/SearchByCounty",data:t,success:function(n){ReplaceBody(n)},error:function(){QVFtoastr.Error("County clerk information is not available at this time.")}})});$("#county-clerk-link").off("click").on("click",function(n){n.preventDefault();var t={CountyName:"",CountyID:$("#hfCountyID").val(),Address:"",Latitude:0,Longitude:0,Counties:null};$.ajax({method:"POST",cache:!1,url:"/Voter/SearchByCounty",data:t,success:function(n){ReplaceBody(n)},error:function(){QVFtoastr.Error("County clerk information is not available at this time.")}})});$("#btnSearchByAddress").off("click").on("click",function(n){if(!$("#address-Form").valid())return!1;n.preventDefault();var t={CountyName:"",CountyID:"",Address:$("#Address").val(),Latitude:$("#Latitude").val(),Longitude:$("#Longitude").val(),Counties:null};$.ajax({method:"POST",cache:!1,url:"/Voter/SearchByAddress",data:t,success:function(n){ReplaceBody(n)},error:function(){QVFtoastr.Error("Clerk information is not available at this time.")}})});$(".local-clerk-link").off("click").on("click",function(n){n.preventDefault();var t={jurisdictionCode:getUrlParameter(n.currentTarget.href,"jurisdictionCode"),countyID:getUrlParameter(n.currentTarget.href,"countyID"),jurisdictionName:getUrlParameter(n.currentTarget.href,"jurisdictionName")};$.ajax({method:"POST",cache:!1,url:"/Voter/LocalClerk",data:t,success:function(n){ReplaceBody(n)},error:function(){QVFtoastr.Error("Clerk information is not available at this time.")}})});$("#btnClearCounty").off("click").on("click",function(){$("#Counties").get(0).selectedIndex=0;$("#Counties").removeClass("input-validation-error");$("#county-Form").find($(".field-validation-error")).html("");$("#county-Form").find($(".field-validation-error")).removeClass("field-validation-error").addClass("field-validation-valid")});$("#btnClearAddress").off("click").on("click",function(){$("#Address").val("");$("#Address").removeClass("input-validation-error");$("#address-Form").find($(".field-validation-error")).html("");$("#address-Form").find($(".field-validation-error")).removeClass("field-validation-error").addClass("field-validation-valid")})})