function SuggestedItemSelection(n){var t=$("#global-search-value").attr("value"),i;setGlobalMode(t);i=t==3?"des":"key";urlHash=window.location.protocol+"//"+window.location.host+SearchResultsPage+"?"+i+"="+n+"&mode="+t;window.open(urlHash,"_self")}function setGlobalMode(n){$("#global-search-value").val(n);$(".pri-nav-searchinp").each(function(){switch(n){case 1:$(this).attr("name","key");break;case 2:$(this).attr("name","key");break;case 3:$(this).attr("name","des");break;case 4:$(this).attr("name","key");break;default:$(this).attr("name","key")}})}$(document).ready(function(){function n(){var n=$("#mobileSearchTerm").val();if(n.length<3){$("#mobileSuggestedTerms").html("");$("#mobileSuggestedTerms").hide();return}$.ajax({type:"Get",url:suggestedListUrl,data:{keyword:n},success:function(n){if($(n).find("li").length<=0){$("#mobileSuggestedTerms").html("");$("#mobileSuggestedTerms").hide();return}$("#mobileSuggestedTerms").html(n);$("#mobileSuggestedTerms").show()}})}setGlobalMode(1);$("#mobileSearchTerm").keyup(function(t){t.shiftKey||n(!0)});$(document).on("focus","#mobileSearchTerm",function(){($("#mobileSearchTerm").val()==$("#GlobalSearchValidationErrorMessage").val()||$("#mobileSearchTerm").val()==$("#GlobalSearchValidationErrorMessageMinimum").val())&&$("#mobileSearchTerm").val("")});$(document).on("click",".mobileSearchTerm",function(){var n=this.val();$("#mobileSearchTerm").val(n);$("#mobileGlobalSearch").click()});$("#mobileGlobalSearch").click(function(n){var u;$("#mobileSearchTerm").removeClass("error-state");$("#mobileSearchTerm").attr("placeholder",$("#MobileGlobalSearchPlaceholder").val());var r=$("#mobileSearchTerm").val(),i=$("#GlobalSearchValidationErrorMessage").val(),t=$("#GlobalSearchValidationErrorMessageMinimum").val();n.preventDefault();u=$.ajax({type:"POST",contentType:"application/json; charset=utf-8",url:searchBoxValidationUrl,data:"{'searchBoxText':"+JSON.stringify(r)+"}",dataType:"json",success:function(n){if(n.length==0||n==i)return $("#mobileSearchTerm").addClass("error-state"),$("#mobileSearchTerm").val(""),$("#mobileSearchTerm").attr("placeholder",$("#MobileGlobalSearchValidationErrorMessage").val()),!1;if(n.length>0&&n.length<3||n==t)return $("#mobileSearchTerm").addClass("error-state"),$("#mobileSearchTerm").val(""),$("#mobileSearchTerm").val(t),!1;if((n.length>3||n.length==3)&&n!=i&&n!=t){var r=n.replace(/&quot;/g,'"');r=r.replace(/&amp;/g,"&");$("#mobileSearchTerm").val(r);$("#mobileGlobalSearch").submit()}$("#mobileSearchTerm").blur()}})})})