function nameSearchLoadRecordListDesktop(n,t,i,r,u,f,e,o,s,h,c,l,a,v,y,p,w,b,k,d,g,nt,tt,it,rt,ut,ft,et,ot){var st,lt,ct,ht;lt=ot===undefined?!0:ot;updateSearchCompleteStatus(rt,!1);rt==="nameSearchResultRecordListFullMatch"?(st=$("#searchPlaceHolderFull"),m_nameSearchResultRecordListFullMatchXhr!=null&&m_nameSearchResultRecordListFullMatchXhr.abort()):(st=$("#searchPlaceHolderSimilar"),m_nameSearchResultRecordListSimilarXhr!=null&&m_nameSearchResultRecordListSimilarXhr.abort());ct="https://"+window.location.hostname+"/NameSearch/NameSearchResultRecordList?FirstName="+escape(n)+"&FirstNameIncludeSimilar="+t+"&Surname="+escape(i)+"&Unit="+escape(r)+"&SurnameIncludeSimilar="+u+"&RecordType="+f+"&Page="+e+"&RecordsPerPage="+o+"&RecordDateStartYear="+s+"&RecordDateEndYear="+h+"&ServiceNumber="+escape(c)+"&IncludeRecordsWithoutServiceNumber="+l+"&Nationality="+escape(a)+"&Service="+escape(v)+"&SurvivedActiveService="+y+"&DiedInActiveService="+p+"&YearOfDeath="+w+"&ReceivedGallantryAward="+b+"&MentionedInDespatches="+k+"&CollectionList="+d+"&AddedFrom="+g+"&ViewType="+nt+"&sortColumn="+tt+"&sortOrder="+it+"&loadElementId="+rt+"&previousSearch="+ut+"&useLastColumnSortInfo="+ft+"&newSearch="+et;ht=loadRecordList(rt,st,ct);rt==="nameSearchResultRecordListFullMatch"?m_nameSearchResultRecordListFullMatchXhr=ht:m_nameSearchResultRecordListSimilarXhr=ht;testTableScroll(rt)}function nameSearchLoadRecordListDesktopUri(n,t){var i,r;updateSearchCompleteStatus(t,!1);t==="nameSearchResultRecordListFullMatch"?(i=$("#searchPlaceHolderFull"),m_nameSearchResultRecordListFullMatchXhr!=null&&m_nameSearchResultRecordListFullMatchXhr.abort()):(i=$("#searchPlaceHolderSimilar"),m_nameSearchResultRecordListSimilarXhr!=null&&m_nameSearchResultRecordListSimilarXhr.abort());r=loadRecordList(t,i,n);t==="nameSearchResultRecordListFullMatch"?m_nameSearchResultRecordListFullMatchXhr=r:m_nameSearchResultRecordListSimilarXhr=r}function updateSearchCompleteStatus(n,t){n==="nameSearchResultRecordListFullMatch"?m_searchFullComplete=t:m_searchSimilarComplete=t;ShowHideLoader(n,!t)}function loadNameSearchLoadRecordListHtml(n,t,i){t.hide();n.css("height","auto");n.html("");n.html(i).foundation()}function checkForNoResults(){var n=$("#nameSearchResultRecordListFullMatch"),t=$("#nameSearchResultRecordListSimilar");n.html().indexOf("did not find")!==-1&&t.html().indexOf("no similar")!==-1&&$("#no-results").css("display","block");n.html().indexOf("did not find")!==-1&&$("#no-full-match").css("display","block")}function hideNoResultsMessage(){$("#no-results").css("display","none");$("#no-full-match").css("display","none")}function medievalSearchLoadRecordList(n,t,i,r){$("#medieval-search-result-record-list").html("");var u="/MedievalSearch/MedievalSearchResultRecordList?FirstName="+escape(n)+"&Surname="+escape(t)+"&page="+i+"&recordsPerPage="+r;$("#medieval-search-result-record-list").load(u,function(n,t,i){if(t==="error"){clearSearchResultLoadImage();var r="Sorry an error has occurred while retrieving your results: ";$("#error").html(r+i.status+" "+i.statusText);alert(r)}else clearSearchResultLoadImage()})}function unitSurnameSearchLoadRecordList(n,t,i,r,u,f,e,o,s,h,c){$("#"+n).html("");$("#"+t).css("display","block");$("#"+n).css("display","block");$("#"+i).css("display","block");var l="/UnitInfo/UnitSurnameSearchResultRecordList?unitName="+escape(u)+"&altNames="+escape(f)+"&surname="+escape(e)+"&recordType="+o+"&page="+s+"&recordsPerPage="+h+"&position="+c;$("#"+n).load(l,function(n,i,r){if(i==="error"){clearSearchResultLoadImage();var u="Sorry an error has occurred while retrieving your results: ";$("#error").html(u+r.status+" "+r.statusText);alert(u)}else i==="success"&&clearResultLoadImageById(t)})}function clearResultLoadImageById(n){$("#"+n).css("display","none")}function clearSearchResultLoadImage(){$("#search-result-load-img").hide()}function loadSortColToolTip(n,t){$(".tooltip").each(function(){var n=$(this);n.attr("style")&&n.removeAttr("style")});n.mouseover(function(){var i=$('<div id="'+n.attr("id")+'TooTip">'+t+"<\/div>").css("position","absolute").css("top",n.position().top).css("padding","4px 8px 4px 8px").css("backgroundColor","#666").css("color","#fff").css("fontWeight","normal","important").css("fontSize",12).appendTo($(n));i.css("top",n.position().top-i.height()-8)});n.mouseout(function(){$("#"+n.attr("id")+"TooTip").remove()});n.click(function(){$("#"+n.attr("id")+"TooTip").remove()})}function ShowHideLoader(n,t){disableCount=t?disableCount+1:disableCount-1;disableCount<0&&(disableCount=0);t?($("#step1-inputs :input").attr("disabled",!0),$("#"+n).css("opacity","0.5"),$("#results-spinner").show()):disableCount===0&&($("#step1-inputs :input").removeAttr("disabled"),$("#"+n).css("opacity","1"),$("#results-spinner").hide())}function loadRecordList(n,t,i){var r=$("#".concat(n));return t.show(),$.ajax({url:i,async:!0,success:function(i){r.css("opacity","1");loadNameSearchLoadRecordListHtml(r,t,i);checkForNoResults();updateSearchCompleteStatus(n,!0)},error:function(i){r.css("opacity","1");updateSearchCompleteStatus(n,!0);i.statusText==="abort"||loadNameSearchLoadRecordListHtml(r,t,'<div class="nameSearchRecordListResultSummary">Sorry, there was a problem loading your results. Please try again later.<\/div>')}})}var m_nameSearchLoadXhr,m_nameSearchResultRecordListFullMatchXhr=null,m_nameSearchResultRecordListSimilarXhr=null,m_searchFullComplete=!1,m_searchSimilarComplete=!1,disableCount=0