function checkAuthority(e){var a=seniorsearch_memberRole;""==a?($("#myModalRegister").modal("show"),setQiyeNumber()):"middle"==a||"senior"==a?(a=word_contextPath+"/client/"+e,window.location.href=a):$("#myModalRegister").on("show.bs.modal",centerModals)}function subscribe(){var e,a,t;$("#myModalRegister .login-btn").attr("href",url),""==$("#loginName").val()?($("#myModalRegister").modal("show"),setQiyeNumber()):remainMonitor<=0?$("#myModal-2").css("display","block"):(t=e="",null!=$("#ipSearchWordId").val()&&""!=$("#ipSearchWordId").val()&&(10<$("#ipSearchWordId").val().trim().length?e+=$("#ipSearchWordId").val().trim().substring(0,10)+",":e+=$("#ipSearchWordId").val().trim()+","),null!=$("#SearchWordId").val()&&""!=$("#SearchWordId").val()&&(10<$("#SearchWordId").val().trim().length?t+=$("#SearchWordId").val().trim().substring(0,10)+",":t+=$("#SearchWordId").val().trim()+","),0 li").each(function(){for(var e=0;e"+e.data.associativeWords[t]+"";o.eq(1).find("ul").html(a),$(".associational-word li").click(function(){$(this).parents(".input-item").find(".keywords").val($(this).text()),$(this).parents(".associational-word").hide()}),$(this).parents(".associational-word").show()}})}),$(".keywords").on("input",function(){var o=$(this).val().trim(),i=$(this).nextAll(),s=$(this);$.ajax({type:"POST",data:{keyword:o},url:word_contextPath+"/advsearch/associativeWords.do",success:function(e){var a="";0"+e.data.associativeWords[t]+"";i.eq(1).find("ul").html(a),$(".associational-word li").click(function(){$(this).parents(".input-item").find(".keywords").val($(this).text()),$(this).parents(".associational-word").hide()}),$(this).parents(".associational-word").show(),0===o.length&&setTimeout(function(){$(".associational-word").hide()},500)}})}),$("body").click(function(){$(".associational-word").hide()});var scrollEnough=!1;function getEnterpriseSearchRecords(i){$("#searchHistory").html(""),""===$(".search-box .search-input").val().trim()?($.ajax({type:"POST",url:word_contextPath+"/company-search!getEnterpriseSearchRecords.do",success:function(e){var a="";if(0"+e.data[o].keyword+"";$(".search-history .history-list").html(a),$(".search-history").show(),$(".search-history .history-list li").click(function(){$("#SearchInput").val($(this).html()),$("#divSearchWordId").val($(this).html()),$(".search-history").hide(),(i?tabQyreport:tabQy)($(this).html())})}}}),$(".search-history").show()):getEnterpriseWord(i)}function getEnterpriseWord(s){var r={companyName:$(".search-box .search-input").val().trim(),areaList:""};$.ajax({type:"POST",data:r,url:word_contextPath+"/advsearch/searchCompanyNameList.do",success:function(e){if(1e3===e.status){var a=e.data.companyNames,t=e.data.bidiIds,o="";if(0"+a[i]+"";else for(i=0;i<5;i++)o+="
  • "+a[i]+"
  • ";$(".associational .associational-list").html(o),$(".associational-list li").click(function(){$("#SearchInput1").val($(this).text()),tabQyreport(r.companyName)})}else{if(a.length<5)for(var i=0;i'+a[i]+"";else for(var i=0;i<5;i++)o+='
  • '+a[i]+"
  • ";$(".associational .associational-list").html(o)}$(".associational-list").show()}else $(".associational-list").hide();0===$(".search-box .search-input").val().length&&$(".associational-list").hide()}}})}function tabQy(e){""===e||e||(e=$("#SearchInput1").val()&&$("#SearchInput1").val().trim(),$("#isTopSearch").val(!0)),saveReportBuriedPoint("11001",2,e),""==e.trim()?window.open(word_contextPath+"company-search.do"):window.open(word_contextPath+"company-list.do?keyword="+encodeURI(e))}function tabHyreport(e){""!==e&&(e=e||$("#SearchInput1").val()&&$("#SearchInput1").val().trim()),saveReportBuriedPoint("21001",2,e),""==e.trim()?window.open(word_contextPath+"hyfxbg/"):window.open(word_contextPath+"industryReport.do?type=2&keyword="+encodeURI(e))}function tabQyreport(e){""!==e&&(e=e||$("#SearchInput1").val()&&$("#SearchInput1").val().trim()),saveReportBuriedPoint("11001",1,e),""==e.trim()?window.open(word_contextPath+"qyfxbg/"):window.open(word_contextPath+"enterpriseReport.do?type=2&keyword="+encodeURI(e))}function tab1InputClickSel(e){var a=e.target.value;$(".second-associational-word").hide(),scrollEnough?(e.stopPropagation(),0"+e.result[o].keyword+"";$(".suspend-search-history").show(),$(".suspend-search-history #searchHistory").html(a),$(".suspend-search-history .search-history").show(),$(".suspend-search-history #no-record").hide(),$(".suspend-search-history #knowledge").hide(),$("#searchHistory").html(a),$(".search-history").show(),$("#no-record").hide(),$("#knowledge").hide()}else $(".suspend-search-history").show(),$(".search-history").show(),""===$("#loginName").val()?($(".suspend-search-history .history-list").hide(),$(".suspend-search-history .no-record").hide(),$(".suspend-search-history #knowledge").show(),$(".suspend-search-history .index-header .search-history .prompt").css("padding-top","20px"),$(".history-list").hide(),$(".no-record").hide(),$("#knowledge").show(),$(".index-header .search-history .prompt").css("padding-top","20px")):($(".suspend-search-history .history-list").hide(),$(".suspend-search-history #no-record").show(),$(".suspend-search-history #knowledge").show(),$(".suspend-search-history .index-header .search-history .prompt").css("padding-top","0px"),$(".history-list").hide(),$("#no-record").show(),$("#knowledge").show(),$(".index-header .search-history .prompt").css("padding-top","0px"))}}))):(e.stopPropagation(),null!=a&&0"+e.result[o].keyword+"";$("#searchHistory").html(a),$(".search-history").show(),$("#no-record").hide(),$("#knowledge").hide()}else $(".search-history").show(),""===$("#loginName").val()?($(".history-list").hide(),$(".no-record").hide(),$("#knowledge").show(),$(".index-header .search-history .prompt").css("padding-top","20px")):($(".history-list").hide(),$("#no-record").show(),$("#knowledge").show(),$(".index-header .search-history .prompt").css("padding-top","0px"))}})))}$(document).scroll(function(){scrollEnough=480<=$(document).scrollTop()}),$(".history-list").on("click","li",function(){0==getTabIndex()&&($(".search-box .search-input").val($(this).text()),doSearch()),sessionStorage.getItem("searchValue")!==$(this).text()&&($(".ai-layer").hide(),$("#isFlickDialogBox").val(!0))}),$(".in-batch").click(function(){scrollEnough&&getPeerWords()}),$(".search-box .search-input").on("click",function(e){var a=getTabIndex();0==a?(tab1InputClickSel(e),tab1SelectClickIdontNo(e)):1==a?getEnterpriseSearchRecords():2==a&&getEnterpriseSearchRecords(1)}),$("#fdTabSearch").delegate("#divSearchWordId","click",function(e){var a=getTabIndex();0==a?(tab1InputClickSel(e),tab1SelectClickIdontNo(e)):1==a?getEnterpriseSearchRecords():2==a&&getEnterpriseSearchRecords(1)});{function debounce(t,o){var i=null;return o=o||1e3,function(){var e=this,a=arguments;i&&clearTimeout(i),i=setTimeout(function(){t.apply(e,a)},o)}}}var seaStopWord,seaAssociationalWord,getEnterpriseWordDb=debounce(getEnterpriseWord,500);function tab1InputInputEvent(){scrollEnough?(null!=$("#ipSearchWordId").val()&&$("#ipSearchWordId").val($("#divSearchWordId").val()),$("#divSearchWordId").val(),0<=$("#divSearchWordId").val().trim().length?(seaStopWord&&seaStopWord($("#divSearchWordId").val().trim()),seaAssociationalWord&&seaAssociationalWord($("#divSearchWordId").val().trim()),$(".search-history").hide(),$(".guanbi").show()):($(".stop-wolds").hide(),$(".associational-list").hide(),$(".guanbi").hide())):$("#ipSearchWordId")&&null!=$("#ipSearchWordId").val()&&0<=$("#ipSearchWordId").val().trim().length?(seaStopWord&&seaStopWord($("#ipSearchWordId").val().trim()),seaAssociationalWord&&seaAssociationalWord($("#ipSearchWordId").val().trim()),$(".search-history").hide(),$(".guanbi").show()):($(".stop-wolds").hide(),$(".associational-list").hide(),$(".guanbi").hide())}function enterHistory(){$.ajax({type:"POST",url:word_contextPath+"/head!getSearchword.do",success:function(e){if(0"+t[o].keyword+"";$(".fenbao-associational-list").html(a),$(".fenbao-associational-list").show(),$(".fenbao-associational-list li").click(function(){$("#fenbao-associational").val($(this).text()),$(".fenbao-associational-list").hide(),""!=$("#loginName").val()&&null!=$("#loginName").val()&&saveSearchWordRecord("90",$(this).text()),doSubmitDiqu()})}}})}"function"==typeof stopWord&&(seaStopWord=debounce(stopWord,500)),"function"==typeof getAssociationalWord&&(seaAssociationalWord=debounce(getAssociationalWord,500)),$(".search-box .search-input").on("input",function(){var e=getTabIndex();0==e?tab1InputInputEvent():($("#ipSearchWordId").val($(this).val()),$("#divSearchWordId").val($(this).val()),""==$(".search-box .search-input").val().trim()?$(".associational-list").hide():($(".search-history").hide(),1==e?getEnterpriseWordDb():2==e&&getEnterpriseWordDb(1)))}),$("#fdTabSearch").delegate("#divSearchWordId","input",function(){var e=getTabIndex();0==e?tab1InputInputEvent():($("#ipSearchWordId").val($(this).val()),$("#divSearchWordId").val($(this).val()),""==$(".search-box .search-input").val().trim()?$(".associational-list").hide():($(".search-history").hide(),1==e?getEnterpriseWordDb():2==e&&getEnterpriseWordDb(1)))}),$(".guanbi").click(function(){scrollEnough&&$("#ipSearchWordId").val(""),$(this).prev().val(""),$(".guanbi").hide(),$(".stop-wolds").hide(),$(".associational-list").hide()}),$("#SearchWordId").click(function(e){e.stopPropagation(),$(".associational-list").hide();var e=$(this).val().trim(),o=$(this).nextAll(),i=$(this);e.length<11&&$.ajax({type:"POST",data:{keyword:e},url:word_contextPath+"/advsearch/associativeWords.do",success:function(e){var a="";0"+e.data.associativeWords[t]+"";o.eq(2).find("ul").html(a),$(".second-associational-word li").click(function(){$(this).parents(".search-box").find("#SearchWordId").val($(this).text()),$(this).parents(".second-associational-word").hide(),""!=$("#loginName").val()&&null!=$("#loginName").val()&&saveSearchWordRecord("90",$(this).text()),secondarySearch()})}})}),$("#SearchWordId").on("input",function(){var o=$(this).val().trim(),i=$(this).nextAll(),s=$(this);o.length<11&&$.ajax({type:"POST",data:{keyword:o},url:word_contextPath+"/advsearch/associativeWords.do",success:function(e){var a="";0"+e.data.associativeWords[t]+"";i.eq(2).find("ul").html(a),$(".second-associational-word li").click(function(){$(this).parents(".search-box").find("#SearchWordId").val($(this).text()),$(this).parents(".second-associational-word").hide(),""!=$("#loginName").val()&&null!=$("#loginName").val()&&saveSearchWordRecord("90",$(this).text()),secondarySearch()}),0===o.length&&setTimeout(function(){$(".second-associational-word").hide()},500)}}),0"+e.data.associativeWords[t]+"";o.eq(1).html(a),$(".fenbao-associational-list li").click(function(){$(this).parents(".fenbao-father").find("#fenbao-associational").val($(this).text()),$(this).parents(".fenbao-associational-list").hide(),doSubmitDiqu()})}})}),$("#fenbao-associational").on("input",function(e){e.stopPropagation();var o=$(this).val().trim(),i=$(this).nextAll(),s=$(this);o.length<11&&$.ajax({type:"POST",data:{keyword:o},url:word_contextPath+"/advsearch/associativeWords.do",success:function(e){var a="";0"+e.data.associativeWords[t]+"";i.eq(1).html(a),$(".fenbao-associational-list li").click(function(){$(this).parents(".fenbao-father").find("#fenbao-associational").val($(this).text()),$(this).parents(".fenbao-associational-list").hide(),doSubmitDiqu()}),0===o.length&&setTimeout(function(){$(".fenbao-associational-list").hide()})}})}),$("#fenbao-associational").bind("keydown",function(e){"13"==e.keyCode&&(""!=$("#loginName").val()&&null!=$("#loginName").val()&&saveSearchWordRecord("90",$(this).text()),doSubmitDiqu())}),$("body").click(function(){$(this).find(".fenbao-associational-list").hide()}),$(".ai-close").click(function(){$(".ai-layer").hide(),$("#isFlickDialogBox").val(!1)});