dojo.require("dojo.back");var g_toppatent=new Array();var g_toppatent_100=new Array();var g_toppatentcolor=new Array();var g_toppatentRowArray1=new Array();var g_toppatentRowArray2=new Array();var currentTopIndex=0;var historyguid=0;var masterHistoryGuid="";var slaveHistoryGuid="";var colorControlContentMaster="";var colorControlContentSlave="";var currentFocusInput_start=0;var currentFocusInput_end=0;var searching=false;var lastPatentMapRadio=-1;var mouseInDiv=false;var isShowPatent=false;ApplicationState=function(a,c,b){this.dataform=new Object();this.dataform.ipi=a.ipi.value;this.dataform.sq=a.sq.value;this.dataform.sd=a.sd.value;this.dataform.idi=a.idi.value;this.dataform.iopt=a.iopt.value;this.dataform.sc=a.sc.value;this.dataform.sds=a.sds.value;this.dataform.sde=a.sde.value;this.dataform.ip=a.ip.value;this.dataform.sdf=a.sdf.value;this.dataform.sqf=a.sqf.value;this.datafulltext=c;this.datarelated=b};var downloadIpnsMap=new HashMap();var downloadIpnsMapSlave=new HashMap();var needMap=false;function changeLeftDivDisplay(a){var b=null;var d=null;var c=null;switch(a){case"p":b=dojo.byId("quickprojectlist-img");d=dojo.byId("quickprojectlist-contentdiv");c=dojo.byId("quickprojectlist-title-tr");break;case"h":b=dojo.byId("quickhistorylist-img");d=dojo.byId("quickhistorylist-tablediv");break;case"rk":b=dojo.byId("queryrelated-keywords-img");d=dojo.byId("queryrelated-keywords-tablediv");break;case"ro":b=dojo.byId("queryrelated-organizations-img");d=dojo.byId("queryrelated-organizations-tablediv");break;case"rc":b=dojo.byId("queryrelated-classes-img");d=dojo.byId("queryrelated-classes-tablediv");break;case"u":b=dojo.byId("userinfo-img");d=dojo.byId("signup-userinfo-tablediv");case"b":b=dojo.byId("quickbookmarklist-img");d=dojo.byId("quickbookmarklist-tablediv");c=dojo.byId("bookmark-quick-bookmarklist-title");break}if(d.style.display==""){d.style.display="none";if(c!=null){c.style.display="none"}b.src=c_sImgPath+"img/shrink.gif"}else{d.style.display="";if(c!=null){c.style.display=""}b.src=c_sImgPath+"img/expand.gif"}}function checkSearchMasterKey(a){a=a?a:(window.event?window.event:null);if(a.keyCode==13){prepareMasterSearch(null,-1,-1,null,null,null)}}function checkSearchSlaveKey(a){a=a?a:(window.event?window.event:null);if(a.keyCode==13){prepareSlaveSearch(null,-1,null,null,null,null)}}function checkAdvanceSearchKey(a){a=a?a:(window.event?window.event:null);if(a.keyCode==13){prepareAdvancedSearch()}}function setSearchTypeCheckbox(i){var k=parseInt(i);var f=dojo.byId("searchtype-p");var t=dojo.byId("searchtype-a");var q=dojo.byId("searchtype-c");var b=dojo.byId("searchtype-r");var m=dojo.byId("searchtype-e");var u=dojo.byId("searchtype-w");var v=dojo.byId("searchtype-s");var l=dojo.byId("searchtype-j");var h=dojo.byId("searchtype-o");var n=dojo.byId("searchtype-d");var g=dojo.byId("searchtype-ce");if(f!=null&&f.style.display=="none"&&(k&1)==1){k-=1}if(t!=null&&t.style.display=="none"&&(k&2)==2){k-=2}if(q!=null&&q.style.display=="none"&&(k&4)==4){k-=4}if(b!=null&&b.style.display=="none"&&(k&8)==8){k-=8}if(m!=null&&m.style.display=="none"&&(k&16)==16){k-=16}if(l!=null&&l.style.display=="none"&&(k&32)==32){k-=32}if(h!=null&&h.style.display=="none"&&(k&64)==64){k-=64}if(n!=null&&n.style.display=="none"&&(k&128)==128){k-=128}if(g!=null&&g.style.display=="none"&&(k&256)==256){k-=256}if(k<=0){if(f!=null&&f.style.display==""){k=1}else{if(t!=null&&t.style.display==""){k=2}else{if(q!=null&&q.style.display==""){k=4}else{if(b!=null&&b.style.display==""){k=8}else{if(m!=null&&m.style.display==""){k=16}else{if(l!=null&&l.style.display==""){k=32}else{if(h!=null&&h.style.display==""){k=64}else{if(n!=null&&n.style.display==""){k=128}else{if(g!=null&&g.style.display==""){k=256}}}}}}}}}}setSearchTypeCheckBoxByType(k);setSearchTypeSpan(k)}function setSearchTypeValue(c){var b=null;if(c=="0"){b=dojo.byId("search-form-master")}else{b=dojo.byId("search-form-slave")}if(!basic_search){var a=dojo.byId("searchtype-span").getAttribute("typevalue");b.idi.value=a}else{b.idi.value=DB_MX|DB_MC}return true}function checkSearchRankKey(a,b){a=a?a:(window.event?window.event:null);if(a.keyCode==13){setSearchRank(b)}}function setSearchRank(g){var c="";var a="";var d="";if(isChildOf(g,dojo.byId("search-master-querylist"))){c="sm";a="querylist-searchrank-input";d="queryrelated-queryexp"}else{c="sl";a="querylist-searchrank-input_s";d="queryrelated-queryexp_s"}var f=dojo.byId(a).value;if(parseInt(f)<0||parseInt(f)>100){alert(c_sERROR_SEARCH_RANK);return}var e=dojox.data.dom.textContent(dojo.byId(d));var h=e.indexOf("REL/");if(h==-1){e=e+" and REL/"+f;if(c=="sm"){prepareMasterSearch(e,-1,-1,null,null,null)}else{prepareSlaveSearch(e,-1,null,null,null,null)}}else{var b=h;for(;b<e.length;b++){if(e.charAt(b)==" "){break}}e=e.substring(0,h)+"REL/"+f+e.substring(b);if(c=="sm"){prepareMasterSearch(e,-1,-1,null,null,null)}else{prepareSlaveSearch(e,-1,null,null,null,null)}}}function setPatentDisplayColor(b,a){if(isChildOf(b,dojo.byId("search-master-querylist"))){prepareMasterSearch(null,-1,-1,null,a,null)}else{prepareSlaveSearch(null,-1,-1,a,null,null)}}function onSelectTypeChange(e,i,c){if(Wizard_JS==false){LoadWizardJsFile(onSelectTypeChange,arguments);return false}var g=dojo.byId("help-selecttype-div");var f=dojo.byId("newusertoread");if(f!=null){f.style.display=c==null?"none":c}if(g!=null){g.style.visibility="hidden"}if(!isNullorEmpty(e)){setPageView("search",false)}var d=dojo.byId("search-advancedinput-div");if(d!=null&&e!="a"){d.style.display="none"}var h=dojo.byId("search-booleaninput-div");if(SearchBooleaninput_Load==false&&e=="b"){dload("search-booleaninput-div","searchbooleaninput.htm");SearchBooleaninput_Load=true;var n=new Array("booleaninput-select-1-value","booleaninput-select-2-value","booleaninput-select-3-value","booleaninput-select-4-value");var b=new Array(c_sCheckKW,c_sCheckKW,c_sCheckKW,c_sCheckKW);var m=new Array("KWList","KWList","KWList","KWList");initComboBoxDataUrl(n,b,m);initBooleanInput();if(h!=null){h.style.display="none"}}if(h!=null&&e!="b"){h.style.display="none"}var l=dojo.byId("search-wizardinput-div");if(SearchWizardinput_Load==false&&e=="c"){l.style.display="";LoadJsCssFile("css/statistic.css","css");dload("search-wizardinput-div","wizardinput.htm");var n=new Array("wizardsearch-conceptinput-value","wizardsearch-booleaninput-value","wizardsearch-otherinput-value");var b=new Array(c_sCheckKW,c_sCheckKW,c_sCheckAN);var m=new Array("KWList","KWList","ANList");initComboBoxDataUrl(n,b,m);SearchWizardinput_Load=true;if(l!=null){l.style.display="none"}}if(l!=null&&e!="c"){l.style.display="none"}var a=dojo.byId("search-advancedsearch-div");if(a!=null&&e!="t"){a.style.display="none"}var k=dojo.byId("search-newuser-div");if(e!="n"&&k!=null){k.style.display="none"}var j=dojo.byId("preference-preferencelist");if(e=="p"&&PreferencePreferencelist_Load==false){dload("preference-preferencelist","preference.htm");PreferencePreferencelist_Load=true}if(e!="p"&&j!=null&&j.style.display==""){j.style.display="none";updatePreference()}if(isNullorEmpty(e)){if(dojo.byId("search-master-searchtype-select")!=null){dojo.byId("search-master-searchtype-select").value=""}}else{switch(e){case"n":LoadHlepJsFile();if(dojo.byId("search-master-searchtype-select")!=null){dojo.byId("search-master-searchtype-select").value=(k.style.display=="none"?"n":"")}k.style.display=(k.style.display=="none"?"":"none");if(i!=null){dojo.byId("helptype-span").innerHTML=i}if(k.style.display==""){showNewUserSearch()}break;case"c":if(dojo.byId("search-master-searchtype-select")!=null){dojo.byId("search-master-searchtype-select").value=(l.style.display=="none"?"c":"")}l.style.display=(l.style.display=="none"?"":"none");if(i!=null){dojo.byId("helptype-span").innerHTML=i;dojo.byId("helptype-span").style.color="Black"}break;case"b":if(dojo.byId("search-master-searchtype-select")!=null){dojo.byId("search-master-searchtype-select").value=(h.style.display=="none"?"b":"")}h.style.display=(h.style.display=="none"?"":"none");if(i!=null){dojo.byId("helptype-span").innerHTML=i;dojo.byId("helptype-span").style.color="Black"}if(h.style.display==""){showBooleanInputSearch()}break;case"t":if(dojo.byId("search-master-searchtype-select")!=null){dojo.byId("search-master-searchtype-select").value=(a.style.display=="none"?"t":"")}a.style.display=(a.style.display=="none"?"":"none");if(i!=null){dojo.byId("helptype-span").innerHTML=i;dojo.byId("helptype-span").style.color="Black"}if(a.style.display==""){if(SearchAdvancedSearch_Load==false){if(g_version=="eng"){dload("search-advancedsearch-div","advancedsearch.htm")}else{showAdvancedSearch()}SearchAdvancedSearch_Load=true}}break;case"o":if(i!=null){dojo.byId("helptype-span").innerHTML=i;dojo.byId("helptype-span").style.color="Gray"}break;case"a":if(dojo.byId("search-master-searchtype-select")!=null){dojo.byId("search-master-searchtype-select").value=(d.style.display=="none"?"a":"")}d.style.display=(d.style.display=="none"?"":"none");if(i!=null){dojo.byId("helptype-span").innerHTML=i;dojo.byId("helptype-span").style.color="Black"}if(d.style.display==""){showAdvancedInputSearch()}break;case"p":if(j.style.display==""){updatePreference()}j.style.display=(j.style.display=="none"?"":"none");break}}}function selectAllRegion(e){var a=dojo.byId("search-master-database-span");var f=a.getElementsByTagName("input");var d=false;var c=true;if(e.src.indexOf("check.gif")!=-1||e.src.indexOf("check-active.gif")!=-1){e.src=c_sImgPath+"img/cancel.gif";e.alt=e.title="ȡ��"}else{e.src=c_sImgPath+"img/check.gif";c=false;e.alt=e.title="ѡ������"}for(var b=0;b<f.length;b++){f[b].checked=c}}function getDatabaseSpan(){var a=' style="display:none"';if(ABSTRACT_FULLTEXT_DIV){a=""}if(g_funcArray[141]==0){return""}if(basic_search){if(g_versionSpan.indexOf("Chinese")!=-1){return'<span id="database-type-span" class="header-menu-mouseover" onclick="changeDatabaseRadio();"'+a+">FullText</span>&nbsp;&nbsp;&nbsp;&nbsp;"}else{return'<span id="database-type-span" class="header-menu-mouseover" onclick="changeDatabaseRadio();"'+a+">ȫ��</span>&nbsp;&nbsp;&nbsp;&nbsp;"}}else{if(g_versionSpan.indexOf("Chinese")!=-1){return'<span id="database-type-span" class="header-menu-mouseover" onclick="changeDatabaseRadio();"'+a+">Abstract</span>&nbsp;&nbsp;&nbsp;&nbsp;"}else{return'<span id="database-type-span" class="header-menu-mouseover" onclick="changeDatabaseRadio();"'+a+">��ժ</span>&nbsp;&nbsp;&nbsp;&nbsp;"}}}function changeDatabaseRadio(h,b){if(g_pagetype=="i"){dijit.byId("index-body").layout();return}if(searching){return}var g=dojo.byId("database-type-span");if(!isNullorEmpty(g)&&b==null){if(g.innerHTML=="Abstract"){h=0;g.innerHTML="FullText"}else{if(g.innerHTML=="��ժ"){h=0;g.innerHTML="ȫ��"}else{if(g.innerHTML=="FullText"){h=1;g.innerHTML="Abstract"}else{h=1;g.innerHTML="��ժ"}}}}if(isNullorEmpty(dojo.byId("login-form-div"))||dojo.byId("login-form-div").style.dispaly=="none"){setPageView("search",false)}dojo.byId("search-master-querylist").innerHTML="";dojo.byId("search-slave-querylist").innerHTML="";var d=dojo.byId("index-body");if(d!=null){var c=d.childNodes;for(var f=0;f<c.length;f++){if(c[f].className=="dojoSplitContainerSizerH"){if(h==1){c[f].style.display=""}else{c[f].style.display="none"}}}}if(h==0){basic_search=true;dojo.byId("search-master-database-span").style.display="";if(dojo.byId("command-search")!=null){dojo.byId("command-search").style.display=""}if(dojo.byId("bestmode-search")!=null){dojo.byId("bestmode-search").style.display=""}if(dojo.byId("helptype-container-div")!=null){dojo.byId("helptype-container-div").style.display="none"}if(dojo.byId("search-master-searchtype-select")!=null){dojo.byId("search-master-searchtype-select").style.display="none"}dojo.byId("search-master-sd-type").style.display="none";dojo.byId("searchtype-container-div").style.display="none";dojo.byId("search-master-sd-BOOL").checked=true;dojo.byId("search-master-import-img").style.display="none";dojo.byId("search-master-searchfilter-span").style.display="none";dojo.byId("search-master-addtocase-img").style.display="none";dojo.byId("search-slave-addtocase-img").style.display="none";dojo.byId("search-master-addtoemailcase-img").style.display="none";g_funcArray[61]=0;g_funcArray[62]=0;g_funcArray[63]=0;g_funcArray[80]=0;dijit.byId("index-right").sizeShare=100;dijit.byId("index-left").sizeShare=0;dijit.byId("index-body").layout();dojo.byId("index-left").style.display="none";var e=dijit.byId("submenuns");if(e!=null){var m=dijit.byId("subnsconcept");if(m!=null){e.removeChild(m)}var o=dijit.byId("submenurs");var l=dijit.byId("subrsconcept");var n=dijit.byId("subrsrank");if(l!=null){o.removeChild(l)}if(n!=null){o.removeChild(n)}}if(dojo.byId("search-advancedsearch-div")!=null){dojo.byId("search-advancedsearch-div").style.display="none"}if(dojo.byId("search-basicsearch-div")!=null){dojo.byId("search-basicsearch-div").style.display=""}dojo.byId("index-right").style.left="3px";dojo.byId("header-menu-sep2").style.display="none";dojo.byId("header-menu-class").style.display="none";dojo.byId("header-menu-sep3").style.display="none";dojo.byId("header-menu-statistic").style.display="none";dojo.byId("header-menu-sep4").style.display="none";dojo.byId("header-menu-analysis").style.display="none";dojo.byId("header-menu-sep5").style.display="none";dojo.byId("header-menu-history").style.display="none";dojo.byId("header-menu-sep6").style.display="none";dojo.byId("header-menu-project").style.display="none";if(dojo.byId("popupdiv-clipboardpn-project")!=null){dojo.byId("popupdiv-clipboardpn-project").style.display="none"}if(dojo.byId("popupdiv-clipboardfig-project")!=null){dojo.byId("popupdiv-clipboardfig-project").style.display="none"}dojo.byId("classinfo-div").style.display="none";dojo.byId("statistic-statisticlist").style.display="none";dojo.byId("history-historylist").style.display="none";dojo.byId("document-documentlist").style.display="none";dojo.byId("project-projectlist").style.display="none"}else{basic_search=false;g_funcArray[61]=g61;g_funcArray[62]=g62;g_funcArray[63]=g63;g_funcArray[80]=g80;dojo.byId("search-master-database-span").style.display="none";if(dojo.byId("command-search")!=null){dojo.byId("command-search").style.display=""}if(dojo.byId("bestmode-search")!=null){dojo.byId("bestmode-search").style.display=""}if(dojo.byId("helptype-container-div")!=null){dojo.byId("helptype-container-div").style.display=""}if(dojo.byId("search-master-searchtype-select")!=null){dojo.byId("search-master-searchtype-select").style.display=""}dojo.byId("search-master-sd-type").style.display=(g_funcArray[151]==0?"none":"");dojo.byId("searchtype-container-div").style.display="";dojo.byId("search-master-import-img").style.display=(g_funcArray[39]==0?"none":"");dojo.byId("search-master-advancesearch-span").style.display="";if(g_isLogin){dojo.byId("search-master-addtocase-img").style.display="";dojo.byId("search-slave-addtocase-img").style.display="";dojo.byId("search-master-searchfilter-span").style.display="";dojo.byId("search-master-addtoemailcase-img").style.display=(g_funcArray[63]==0?"none":"")}dijit.byId("index-right").sizeShare=80;dijit.byId("index-left").sizeShare=20;dijit.byId("index-body").layout();dojo.byId("index-left").style.display="";var k=new Array("subnsconcept","subnsboolean","subnsttl","subnsabst","subnsaclm","subnsspec","subnsan","subnsin","subnsccl","subnsicl");var j=new Array("subrsconcept","subrsrank","subrsboolean","subrsttl","subrsabst","subrsaclm","subrsspec","subrsan","subrsin","subrsccl","subrsicl");var e=dijit.byId("submenuns");if(e!=null){for(var f=1;f<k.length;f++){var a=dijit.byId(k[f]);if(a!=null){e.removeChild(a)}}for(var f=0;f<k.length;f++){var a=dijit.byId(k[f]);if(a!=null){e.addChild(a)}}}var o=dijit.byId("submenurs");if(o!=null){for(var f=2;f<j.length;f++){var a=dijit.byId(j[f]);if(a!=null){o.removeChild(a)}}for(var f=0;f<j.length;f++){var a=dijit.byId(j[f]);if(a!=null){o.addChild(a)}}}if(dojo.byId("search-basicsearch-div")!=null){dojo.byId("search-basicsearch-div").style.display="none"}if(dojo.byId("header-menu-class")!=null){dojo.byId("header-menu-class").style.display=(g_funcArray[17]==0?"none":"");dojo.byId("header-menu-sep2").style.display=(g_funcArray[17]==0?"none":"")}if(dojo.byId("header-menu-statistic")!=null){dojo.byId("header-menu-statistic").style.display=(g_funcArray[18]==0?"none":"");dojo.byId("header-menu-sep3").style.display=(g_funcArray[18]==0?"none":"")}if(dojo.byId("header-menu-analysis")!=null){dojo.byId("header-menu-analysis").style.display=(g_funcArray[19]==0?"none":"");dojo.byId("header-menu-sep4").style.display=(g_funcArray[19]==0?"none":"")}if(dojo.byId("header-menu-history")!=null){dojo.byId("header-menu-history").style.display=(g_funcArray[20]==0?"none":"");dojo.byId("header-menu-sep5").style.display=(g_funcArray[20]==0?"none":"")}if(dojo.byId("header-menu-project")!=null){dojo.byId("header-menu-project").style.display=(g_funcArray[21]==0?"none":"");dojo.byId("header-menu-sep6").style.display=(g_funcArray[21]==0?"none":"");if(dojo.byId("popupdiv-clipboardpn-project")!=null){dojo.byId("popupdiv-clipboardpn-project").style.display=(g_funcArray[21]==0?"none":"")}if(dojo.byId("popupdiv-clipboardfig-project")!=null){dojo.byId("popupdiv-clipboardfig-project").style.display=(g_funcArray[21]==0?"none":"")}}}}function isUSAPnum(d){var a=d.length;var b=false;for(var c=0;c<a;c++){if(d[c]>="0"&&d[c]<="9"){continue}else{if(d[c]=="/"&&b==false){b=true}else{return false}}}return true}function prepareMasterSearch(k,i,h,b,e,f,d){hiddenTips();if(k==c_sMasterInputHint||k==c_sMasterInputHint_chs||k==c_sMasterInputHint_en){return}if(dojo.byId("search-master-queryinput").style.color=="gray"){if(k==null){return}dojo.byId("search-master-queryinput").style.color="black"}LoadQueryJsFile();commandDown();bestModeDown();if(dojo.byId("newusertoread")!=null){toReadDown()}if(!g_isLogin&&isClient&&isNullorEmpty(d)){return window.external.ShowLoginDialog()}var a=c_sQueryFulltext+"&foo=SEARCH-MASTER&fooShowPN="+f;var c=false;var j=false;var m=dojo.byId("search-form-master");if(basic_search){a=a+"&ibasic=1"}m.spn.value=f;m.ibm.value=0;var l=false;if(i>=0){m.ipi.value=i}else{if(e!=null){m.ipi.value=0;m.sc.value=e}else{if(h!=-1){if(isNullorEmpty(m.sq.value)){return}m.ipi.value=0;if(!isNullorEmpty(m.sq.value)){m.sq.value=m.sq.value+' and proj/"'+h+'"'}else{m.sq.value='proj/"'+h+'"'}dojo.byId("search-master-queryinput").value=m.sq.value;j=true}else{if(!isNullorEmpty(b)){if((parseInt(m.iopt.value)&1)==parseInt(b)){return}if(parseInt(b)==1){m.iopt.value=parseInt(m.iopt.value)+1}else{m.iopt.value=parseInt(m.iopt.value)-1}m.ipi.value=0}else{m.sd.value=getFormElementValue(m,"radiosd");m.ipi.value=0;m.sc.value="";var g=dojo.byId("search-bookmark-select");if(g!=null){m.sbm.value=((g.value==-1||g.value==0)?"":g.value);if(g_isLogin&&g.value=="Temp"){m.ibm.value=1}}c=true;if(!isNullorEmpty(k)){dojo.byId("search-master-queryinput").value=k}if(isNullorEmpty(dojo.string.trim(dojo.byId("search-master-queryinput").value))){dojo.byId("search-master-querylist").innerHTML="";dojo.byId("search-master-queryrelated").innerHTML="";m.sq.value="";g_toppatent=new Array();g_toppatent_100=new Array();g_toppatentcolor=new Array();g_toppatentRowArray1=new Array();g_toppatentRowArray2=new Array();if(dojo.isIE&&window.external&&isClient){window.external.Sync(2)}return}m.sq.value=dojo.byId("search-master-queryinput").value;if(m.sd.value==c_sC&&isUSAPnum(m.sq.value)){m.sq.value=c_sCONCEPT+m.sq.value}l=true;j=true}}}}if(m.sq.value=="SHOWHISTORY"){a=c_sShowHistory_Search;dojo.byId("search-master-queryrelated").innerHTML="";c=false}if(c){g_toppatent=new Array();g_toppatent_100=new Array();g_toppatentcolor=new Array();g_toppatentRowArray1=new Array();g_toppatentRowArray2=new Array()}onSelectTypeChange(null);if(!isNullorEmpty(m.sq.value)){checkQuery(m.sq.value)}else{checkQuery(dojo.byId(search-master-queryinput).innerHTML)}if(!setSearchTypeValue("0")){return}if(i==-1){downloadIpnsMap.clear()}doMasterSearch(a,c,j)}function prepareSlaveSearch(k,i,d,f,a,g,b){LoadQueryJsFile();if(!g_isLogin&&isClient){return window.external.ShowLoginDialog()}var c=c_sQueryFulltext+((g_pagetype=="s"||g_pagetype=="i")?"&foo=SEARCH-SLAVE":"")+"&fooShowPN="+g;if(g_pagetype=="i"){c=c+"&fooIndex=1"}if(g_pagetype=="f"){c=c+"&foo=SEARCH-FIG"}if(basic_search){c=c+"&ibasic=1"}var e=false;var j=false;var l=dojo.byId("search-form-slave");l.spn.value=g;l.ibm.value=0;if(i!=null&&i!="#"&&i>=0){l.ipi.value=i}else{if(f!=null){l.ipi.value=0;l.sc.value=f}else{if(!isNullorEmpty(d)){if((parseInt(l.iopt.value)&1)==parseInt(d)){return}if(parseInt(d)==1){l.iopt.value=parseInt(l.iopt.value)+1}else{l.iopt.value=parseInt(l.iopt.value)-1}l.ipi.value=0}else{if(i!="#"){if(!setSearchTypeValue("1")){return}}l.ipi.value=0;l.sc.value="";var h=dojo.byId("search-bookmark-select");if(h!=null){l.sbm.value=((h.value==-1||h.value==0)?"":h.value)}l.sd.value=getFormElementValue(dojo.byId("search-form-master"),"radiosd");e=true;if(!isNullorEmpty(k)){dojo.byId("search-slave-queryinput").value=k}else{l.ip.value=0}if(g_pagetype=="f"&&g_toppatent.length>=1){g_toppatent=new Array();g_toppatent_100=new Array();g_toppatentcolor=new Array();g_toppatentRowArray1=new Array();g_toppatentRowArray2=new Array()}if(isNullorEmpty(dojo.string.trim(dojo.byId("search-slave-queryinput").value))){dojo.byId("search-slave-querylist").innerHTML="";dojo.byId("search-slave-queryrelated").innerHTML="";if(dojo.isIE&&window.external&&isClient){window.external.Sync(4)}return}l.sq.value=dojo.byId("search-slave-queryinput").value;j=true}}}if(l.sq.value=="SHOWHISTORY"){c=c_sShowHistory_Search;dojo.byId("search-slave-queryrelated").innerHTML="";e=false}onSelectTypeChange(null);if(b!=null){l.ibm.value=1;l.sbm.value="`null`"}if(i==-1){downloadIpnsMapSlave.clear()}doSlaveSearch(c,e,j,a)}var g_EmailSending=false;function doMailSearchResults(a){getUserLoginState2(doMailSearchResults1,[a])}var g_emailformtype;function doMailSearchResults1(g){var d=g[0];g_emailformtype=g[0];if(!g_isLogin){prepareLogin();return}if(g_EmailSending){alert(c_ERROR_MAILSENDING);return}fulltextImgClick(dojo.byId("queryfulltext_mail_"+d),1,1);var e=dojo.byId("prepare-emailsend-div");var k=document.body.clientHeight;var c=document.body.clientWidth;var i=200;var a=40;var f=(c-i)/2;var j=(k-a)/6;if(f<0){f=0}if(j<0){j=0}e.style.top=j+"px";e.style.left=f+"px";e.style.display="";e.style.visibility="visible";var b=c_sUserGet+"&it=1&random="+Math.random();var h={url:b,handleAs:"json",sync:true,load:function(m,l){if(m.Error!=null){alert(m.Error);prepareLogin(doMailSearchResults,d)}else{if(m.User!=null){dojo.byId("user-email-input").value=m.User.Email}}},error:function(m,l){alert(m.message)}};dojo.xhrGet(h)}function doMailSearchResultsCancel(){var a=dojo.byId("prepare-emailsend-div");a.style.display="none";a.style.visibility="hidden"}function getClickedFulltextImg(b){var c=b.parentNode.getElementsByTagName("img");for(var a=0;a<c.length;a++){if(c[a].getAttribute("state")=="clicked"){return c[a]}}return null}function doMailSearchResultsOK(){var e=g_emailformtype;var c=dojo.byId("prepare-emailsend-div");var o=dojo.byId("queryfulltext_mail_SEARCH-MASTER");if(e=="SEARCH-SLAVE"){o=dojo.byId("queryfulltext_mail_SEARCH-SLAVE")}var j=1;var l=getClickedFulltextImg(o);if(l!=null){if(l.getAttribute("id").indexOf("queryfulltext_querystat")!=-1){j=2}else{if(l.getAttribute("id").indexOf("queryfulltext_clusterpatent")!=-1){j=3}}}var k=c.getElementsByTagName("input");var a="";var f=dojo.byId("querylist-emailsend-div");var n=document.body.clientHeight;var d=document.body.clientWidth;f.style.top=(n-f.offsetHeight)/2+"px";f.style.left=(d-f.offsetWidth)/2+"px";f.style.display="";f.style.visibility="visible";for(var h=0;h<k.length;h++){if(k[h].className=="emailaddress"&&!isNullorEmpty(k[h].value)){a+=k[h].value+"@_@"}}if(isNullorEmpty(a)){return}c.style.display="none";c.style.visibility="visible";g_EmailSending=true;var m=(e=="SEARCH-MASTER")?dojo.byId("search-form-master"):dojo.byId("search-form-slave");m.sems.value=a;var p=dojo.byId("user-email-words");if(!isNullorEmpty(p.value)){m.saw.value=p.value}var b=c_sMailResultSet+"&icl=1&imf="+j+"&random="+Math.random();var g={url:b,handleAs:"json",form:m,load:function(q,i){g_EmailSending=false;f.style.display="none";f.style.visibility="hidden";if(q.Error!=null){alert(c_ERROR_MAIL+q.Error)}else{alert(c_SUCCESS_MAIL)}},error:function(q,i){g_EmailSending=false;f.style.display="none";f.style.visibility="hidden";alert(q.message)}};dojo.xhrPost(g)}function doExportSearchResults(b,a){getUserLoginState2(doExportSearchResults1,[b,a])}function downloadFulltextOrPdf(h){if(downloadIpnsMap.size()>0){var k=downloadIpnsMap.keys();for(var e=0;e<k.length;e++){if(!isNullorEmpty(k[e])){var b=downloadIpnsMap.get(k[e]);if(b!=null){window.external.DownloadDpg(h+k[e]+"&"+b,0)}}}}else{var c=dojo.byId("querylist-queryresult-table-SEARCH-MASTER");if(c!=null){var g=c.getElementsByTagName("tr");if(g!=null&&g.length>1){for(var e=1;e<g.length;e=e+2){var b=g[e].children[0].children[1].getAttribute("value");var a=g[e].children[0].children[0].getAttribute("pn");a=a.replace(",","");for(var d=0;d<10;d++){a=a.replace("/","");a=a.replace(",","")}var f=/^([0-9])/;if(f.test(a)){a="US"+a}if(a.indexOf("CN")==0){a=g[e].children[0].children[1].getAttribute("apn")+"&"+a}else{a=a+"&"+a}window.external.DownloadDpg(h+b+"&"+a,0)}}}}}var g_exportform="";function doExportSearchResults1(b){var d=b[0];var a=b[1];if(isNullorEmpty(a)){a="0"}if(g_EmailSending){alert(c_ERROR_MAILSENDING);return}if(g_cluster){alert(c_ERROR_ClUSTER);return}var c=(d=="SEARCH-MASTER")?dojo.byId("search-form-master"):dojo.byId("search-form-slave");g_exportform=c;if(EXPORT_WORD){if(dijit.byId("exportResultDialog")){dijit.byId("exportResultDialog").show();return}}else{c.action=c_sQueryResultSetBinary}if(basic_search){c.action=c.action+"&ibasic=1"}c.action+="&iopn="+a;c.submit();return}function exportWordFormat(){g_exportform.action=c_sQueryResultSetBinary+"&iw=1";g_exportform.submit();dijit.byId("exportResultDialog").hide();return}function exportTxtFormat(){g_exportform.action=c_sQueryResultSetBinary;g_exportform.submit();dijit.byId("exportResultDialog").hide();return}function getWebRelatedSearch(k,f,o){if(isNullorEmpty(k)){return}var d=dojo.byId("search-slave-queryrelated");var b=c_sQueryRelated+"&is="+(f*c_iRELATEDWORDCOUNT)+"&fooPageIndex="+f;var n=c_sXslFileQueryRelated_Web;var j=-1;if(strContainChinese(k)){j=12}else{if(getPatentNumIDI(k)==12){j=12}else{if(k.length>3){var e=k.substring(3);if(getPatentNumIDI(e)==12){j=12}}}}if(j==-1){j=3}var c=document.createElement("form");var m=document.createElement("textarea");m.name="sq";m.value=k;c.appendChild(m);var g=document.createElement("textarea");g.name="idi";g.value=j;c.appendChild(g);var l=document.createElement("textarea");l.name="ss";l.value="web";c.appendChild(l);var a=document.createElement("textarea");a.name="fooQueryTerm";a.value=k;c.appendChild(a);var i=document.createElement("textarea");i.name="fooType";i.value=o;c.appendChild(i);d.innerHTML=c_sLoading;var h={url:b,handleAs:"text",form:c,load:function(q,p){d.innerHTML=XSLTtrans(q,n)},error:function(q,p){d.innerHTML=q.message}};dojo.xhrPost(h)}function getRelatedSearch(j,c,d,e,k,g){if(g_pagetype=="i"){return}var h=((j==0)?dojo.byId("search-master-queryrelated"):dojo.byId("search-slave-queryrelated"));var m=((j==0)?dojo.byId("search-master-querylist"):dojo.byId("search-slave-querylist"));var b=((j==0)?dojo.byId("search-form-master"):dojo.byId("search-form-slave"));var l=((j==0)?"":"_s");var a=((j==0)?c_sQueryRelated_SearchMaster:c_sQueryRelated_SearchSlave);a+="&is="+(c*c_iRELATEDWORDCOUNT)+"&fooPageIndex="+c;var i=((j==0)?c_sXslFileQueryRelated_SearchMaster:c_sXslFileQueryRelated_SearchSlave);h.innerHTML=c_sLoading;var f={url:a,handleAs:"text",form:b,load:function(o,n){h.style.display="none";h.innerHTML=XSLTtrans(o,i);if(j==0){SetSystemDynamicDisplayByFuncArray("QueryRelated_SEARCH-MASTER",h)}else{SetSystemDynamicDisplayByFuncArray("QueryRelated_SEARCH-SLAVE",h)}if(e){h.style.display="none"}else{h.style.display=""}if(d!=null){d.datarelated=h.innerHTML}if(c==0){if(window.location.href.indexOf(c_sFigComparePage)==-1){logQuickHistory(l)}doMark(m,l,(b.idi.value>=4&&b.idi.value<=12))}if(g!=null){var p=new ApplicationState(k,g,h.innerHTML);dojo.back.addToHistory(p)}},error:function(o,n){h.innerHTML=o.message}};dojo.xhrPost(f)}function syncClient(b){if(dojo.isIE&&window.external&&isClient){if(b==2){window.external.Sync(0)}else{window.external.Sync(b)}if(needMap){if(b==0){editSearchResult("checkAllClient","querylist-queryresult-table-SEARCH-MASTER")}else{if(b==1){editSearchResult("checkAllClientSlave","querylist-queryresult-table-SEARCH-SLAVE")}else{if(b==2){var c="querylist-queryresult-table-SEARCH-MASTER";if(dojo.byId(c)==null){c="querylist-queryresult-table-SEARCH-MASTER-TOP"}editSearchResult("checkAllClient",c,1)}}}}var a;if(b==0){window.external.SetQueryExpr(0,getResultNumber("1"),dojo.byId("search-form-master").sq.value)}else{window.external.SetQueryExpr(1,getResultNumber("0"),dojo.byId("search-form-slave").sq.value)}}}function doMasterSearch(i,d,n){var o=dojo.byId("index-master");if(g_currentView!="search"){setPageView("search",false)}else{if(dojo.byId("queryrelated-cluster-div")!=null){dojo.byId("queryrelated-cluster-div").style.display="none"}dojo.byId("search-master-subget").style.display="none";dojo.byId("search-master-querylist").style.display="";if(dojo.byId("search-master-rotate-div")!=null){dojo.byId("search-master-rotate-div").style.display="none"}}var c=dojo.byId("search-master-querylist");var e=c.clientWidth;var g=8;var j=16;var b=16;var h=40;var q=60;var r=60;var p=parseInt((e-h-q-r)*100/e-g-j-b);var s="p"+g+"t"+p+"a"+j+"i"+b+"c"+h+"l"+q+"r"+r;c.innerHTML=c_sLoading;var a=dojo.byId("search-form-master");a.sdf.value=s;if(g_queryfilter!=""&&!g_queryfilter_disable){if(g_queryfilter!=a.sqf.value){a.sqf.value=g_queryfilter}}else{a.sqf.value=""}if(DESIGN_PATENT_MAP){if(isLocarNoGroup(a.idi.value)){a.sd.value="B";dojo.byId("search-master-sd-BOOL").checked=true}}if(basic_search){var m=getBasicSearchND();if(m!=""){a.sq.value=a.sq.value+" and ("+m.substring(4)+")"}a.idi.value=64}searching=true;var f;var k;var l;addCookie("sqmaster",a.sq.value,24*30);if(g_pagetype=="i"){i=i+"&fooIndex=1"}dojo.xhrPost({url:i,handleAs:"text",form:a,load:function(u,J){if(dojo.byId("newusertoread")!=null){dojo.byId("newusertoread").style.display="none"}lastPatentMapRadio=-1;c.style.display="none";c.innerHTML=XSLTtrans(u,c_sXslFileQueryFulltext);if(dojo.byId("changedquery")!=null){if(dojo.byId("changedquery").value!=null&&dojo.byId("changedquery").value!=""){var R=confirm(c_sChangedQuery.replace("##",dojo.byId("changedquery").value));if(R){dojo.byId("search-master-queryinput").value=dojo.byId("changedquery").value;prepareMasterSearch(null,-1,-1,null,null,null)}}else{if(dojo.byId("suggestedquery").value!=null&&dojo.byId("suggestedquery").value!=""){var R=confirm(c_sSuggestedQuery.replace("##",dojo.byId("suggestedquery").value));if(R){dojo.byId("search-master-queryinput").value=dojo.byId("suggestedquery").value;prepareMasterSearch(null,-1,-1,null,null,null)}}}}if(dojo.byId("changelan")!=null){if(dojo.byId("changelan").value==1){setSearchTypeCheckBoxByType(4);setSearchTypeSpan(4)}}SetSystemDynamicDisplayByFuncArray("QueryFulltext_SEARCH-MASTER",c);if(a.idi!=null&&(a.idi.value&4)){var E=dojo.byId("querylist-queryresult-table-SEARCH-MASTER");if(E!=null){var U=E.getElementsByTagName("td");if(U.length>4){U[4].innerHTML=c_sECLAName}}}if(basic_search){var T=c.getElementsByTagName("img");if(T.length>8){T[0].style.display="none";T[1].style.display="none";T[6].style.display="none";T[7].style.display="none";T[8].style.display="none"}if(dojo.byId("querylist-goPatent-SEARCH-MASTER")!=null){var M=dojo.byId("querylist-goPatent-SEARCH-MASTER").innerHTML;if(M=="����ר��"||M=="LocatePN"){dojo.byId("querylist-goPatent-SEARCH-MASTER").style.display="none";findSiblingBefore(dojo.byId("querylist-goPatent-SEARCH-MASTER"),"input",1).style.display="none"}}}var E=dojo.byId("querylist-queryresult-table-SEARCH-MASTER");if(E!=null){for(var Z=1;Z<E.rows.length;Z+=2){var H=E.rows[Z].cells[0];var K=dojox.data.dom.textContent(H);if(dojo.indexOf(visited_array,K)!=-1){var W=H.getElementsByTagName("span")[0];if(W.getAttribute("class")!="querylist-toppatent-p"&&W.className!="querylist-toppatent-p"){W.style.color=visited_color}}}}c.style.display="";searching=false;k=c.innerHTML;var I=dojo.byId("querylist-queryresult-pageindex-SEARCH-MASTER");var t=1;if(I!=null){t=I.value}setSortImgDisplay("");if(c.getElementsByTagName("DIV").length==0){syncClient(0);return}var A=dojo.byId("querylist-color-control-div-SEARCH-MASTER");if(A!=null){if(n){A.style.display="inline";colorControlContentMaster=A.innerHTML}else{A.innerHTML=colorControlContentMaster;A.style.display="inline"}}dojo.byId("search-form-slave").ip.value=c.getElementsByTagName("DIV")[0].innerHTML;var z=false;if(!isNullorEmpty(a.spn.value)&&isNullorEmpty(c.getElementsByTagName("div")[0].getAttribute("showpn"))){z=confirm(c_sERROR_SHOWPN_NOTFOUND_MASTER.replace("##",a.spn.value))}if(dojo.byId("querylist-input-SEARCH-MASTER")!=null){currentFocusInput=dojo.byId("querylist-input-SEARCH-MASTER")}currentTopIndex=0;var x=false;if(d){var L=document.createElement("div");L.innerHTML=c.innerHTML;var E=null;var O=L.getElementsByTagName("table");if(O==null){syncClient(0);return}for(var Z=0;Z<O.length;Z++){if(O[Z].id=="querylist-queryresult-table-SEARCH-MASTER"){E=O[Z];break}}getRelatedSearch(0,0,this,null,a,k);x=true;if(g_isLogin&&dojo.byId("search-bookmark-select").value=="Temp"){loadBookmarkCombobox("search-bookmark-select","Temp",2)}if(E!=null){for(var Z=1;Z<E.rows.length;Z+=2){var Q=E.rows[Z];if(Q==null||dojox.data.dom.textContent(Q.cells[1])==""){continue}var P=E.rows[Z+1];if(Q.cells[Q.cells.length-1].getElementsByTagName("span").length>0&&dojo.string.trim(dojox.data.dom.textContent(Q.cells[Q.cells.length-1].getElementsByTagName("span")[0]))=="100%"){var B=getNormalizedPN(Q.cells[0].getElementsByTagName("span")[0].firstChild.data);var V=false;for(var Y=0;Y<g_toppatent.length;Y++){if(g_toppatent[Y]==B){V=true;break}}if(!V){g_toppatent[g_toppatent.length]=B;g_toppatent_100[g_toppatent_100.length]=1;g_toppatentcolor[g_toppatentcolor.length]=Q.getAttribute("Color");g_toppatentRowArray1[g_toppatentRowArray1.length]=Q;g_toppatentRowArray2[g_toppatentRowArray2.length]=P}}else{for(var Y=E.rows.length-1;Y>=Z;Y--){E.deleteRow(Y)}break}}}}else{if(t==1){var E=dojo.byId("querylist-queryresult-table-SEARCH-MASTER");if(dojo.byId("search-master-queryrelated")!=null){f=dojo.byId("search-master-queryrelated").innerHTML}else{f=""}doMark(c,"",(a.idi.value>=4&&a.idi.value<=12));for(var Z=g_toppatent.length-1;Z>=0;Z--){if(g_toppatent_100[Z]==null||g_toppatent_100[Z]==0){addPatentToMasterQuerylist(g_toppatent[Z],g_toppatentcolor[Z],null,null,false)}}}else{if(t!=1){if(dojo.byId("search-master-queryrelated")!=null){f=dojo.byId("search-master-queryrelated").innerHTML}doMark(c,"",(a.idi.value>=4&&a.idi.value<=12));for(var Z=g_toppatent.length-1;Z>=0;Z--){addPatentToMasterQuerylist(g_toppatent[Z],g_toppatentcolor[Z],null,null,false)}}}}var ac=dojo.byId("querylist-queryresult-table-SEARCH-MASTER");for(var S=0;S<g_toppatent_c.length;S++){var ad=g_toppatentRowArray1_c[S];var ab=g_toppatentRowArray2_c[S];var y=g_toppatentcolor_c[S];var aa=ac.rows[0].cells.length;var F=ac.insertRow(1);if(currentTopIndex++%2==0){F.className="querylist-dark"}else{F.className="querylist-light"}if(!isNullorEmpty(y)){F.style.backgroundColor=y}var C=false;for(var Z=0;Z<aa;Z++){var N=F.insertCell(Z);if(Z<ad.cells.length){N.innerHTML=ad.cells[Z].innerHTML}else{N.innerHTML=""}}if(C){F.insertCell(Z).innerHTML=""}var D=ac.insertRow(2);D.className=ab.className;D.style.display="none";var N=D.insertCell(0);N.colSpan=aa;N.align="center";N.innerHTML=ab.cells[0].innerHTML}if(ac!=null){var v=ac.getElementsByTagName("tr");for(var Z=0;Z<v.length;Z++){if(v[Z].className=="querylist-showpn"){MyScorllIntoView(v[Z]);if(o!=null){o.scrollTop=v[Z].offsetTop}break}}}if(z&&!isNullorEmpty(a.spn.value)&&isNullorEmpty(c.getElementsByTagName("div")[0].getAttribute("showpn"))){var w=dojo.byId("resultparamdiv");var X="";if(w!=null){X=w.getAttribute("conceptterm");if(X==null||X=="null"||X=="undefined"){X=""}}if(X==""){X=null}addPatentToMasterQuerylist(a.spn.value,null,null,X)}if(!x){var G=new ApplicationState(a,k,f);dojo.back.addToHistory(G)}syncClient(0);MarkProject("SEARCH-MASTER")},error:function(u,t){c.innerHTML=u.message}});dojo.xhrGet({url:"bbs/forum.php",handleAs:"text",load:function(u,t){},error:function(u,t){}})}function doSlaveSearch(b,d,m,a){showSlaveDiv("index-right","index-master","index-slave",30,true);var f=dojo.byId("search-slave-querylist");var l=f.clientWidth;var i=8;var g=16;var q=16;var p=40;var o=60;var h=60;var n=parseInt((l-p-o-h)*100/l-i-g-q);var k="p"+i+"t"+n+"a"+g+"i"+q+"c"+p+"l"+o+"r"+h;f.innerHTML=c_sLoading;var c=dojo.byId("search-form-slave");c.sdf.value=k;if(g_queryfilter!=""&&!g_queryfilter_disable){if(g_queryfilter!=c.sqf.value){c.sqf.value=g_queryfilter}}else{c.sqf.value=""}if(basic_search){c.idi.value=64;var e=getBasicSearchND();if(e!=""){c.sq.value=c.sq.value+" and ("+e.substring(4)+")"}}searching=true;addCookie("sqslave",c.sq.value,24*30);var j={url:b,handleAs:"text",form:c,load:function(r,w){f.style.display="none";f.innerHTML=XSLTtrans(r,c_sXslFileQueryFulltext);if(dojo.byId("querylist-input-SEARCH-MASTER")!=null){currentFocusInput=dojo.byId("querylist-input-SEARCH-SLAVE")}SetSystemDynamicDisplayByFuncArray("QueryFulltext_SEARCH-SLAVE",f);if(c.idi!=null&&(c.idi.value&4)){var B=dojo.byId("querylist-queryresult-table-SEARCH-SLAVE");if(B!=null){var t=B.getElementsByTagName("td");if(t.length>4){t[4].innerHTML=c_sECLAName}}}if(basic_search){var v=f.getElementsByTagName("img");if(v.length>6){v[0].style.display="none";v[2].style.display="none";v[3].style.display="none";v[6].style.display="none"}if(dojo.byId("querylist-goPatent-SEARCH-SLAVE")!=null){var D=dojo.byId("querylist-goPatent-SEARCH-SLAVE").innerHTML;if(D=="����ר��"||D=="LocatePN"){dojo.byId("querylist-goPatent-SEARCH-SLAVE").style.display="none";findSiblingBefore(dojo.byId("querylist-goPatent-SEARCH-SLAVE"),"input",1).style.display="none"}}}f.style.display="";searching=false;var x=f.getElementsByTagName("tr");for(var u=0;u<x.length;u++){if(x[u].className=="querylist-showpn"){MyScorllIntoView(x[u]);break}}if(a!=null){getQueryResultStat("SEARCH-SLAVE",true)}this.datafulltext=f.innerHTML;setSortImgDisplay("_s");var z=dojo.byId("querylist-color-control-div-SEARCH-SLAVE");if(z!=null){if(m){z.style.display="inline";colorControlContentSlave=z.innerHTML}else{z.innerHTML=colorControlContentSlave;z.style.display="inline"}}if(d){getRelatedSearch(1,0,null);if(basic_search){if(dojo.byId("search-slave-queryrelated")!=null){dojo.byId("search-slave-queryrelated").display="none"}}}else{doMark(f,"_s",(c.idi.value>=4&&c.idi.value<=12))}if(c.ibm.value=="1"){getQueryResultStatBookmarks()}if(b.indexOf("SEARCH-FIG")>-1){for(var u=g_toppatent.length-1;u>=0;u--){addPatentToMasterQuerylist(g_toppatent[u],g_toppatentcolor[u],false)}}if(!isNullorEmpty(c.spn.value)&&f.getElementsByTagName("div")[0]!=null&&isNullorEmpty(f.getElementsByTagName("div")[0].getAttribute("showpn"))){var A=dojo.byId("search-master-querylist");if(A!=null){var s=confirm(c_sERROR_SHOWPN_NOTFOUND_MASTER.replace("##",c.spn.value));if(s){var y=dojo.byId("resultparamdiv");var C="";if(y!=null){C=y.getAttribute("conceptterm");if(C==null||C=="null"||C=="undefined"){C=""}}if(C==""){C=null}addPatentToMasterQuerylist(c.spn.value,null,null,C)}}else{alert(c_sERROR_SHOWPN_NOTFOUND.replace("##",c.spn.value))}}syncClient(1);MarkProject("SEARCH-SLAVE")},error:function(s,r){f.innerHTML=s.message}};dojo.xhrPost(j)}function doMasterSearchBySlaveSearch(){var a=dojo.byId("search-form-master");var b=dojo.byId("search-form-slave");a.sds.value=b.sds.value;a.sde.value=b.sde.value;a.sc.value=b.sc.value;setFormElementValue(a,"radiosd",c_sC);prepareMasterSearch(b.sq.value,-1,-1,null,null,null)}function onPtMenuClick(){var a=1;switch(dojo.byId("ptmenuitem").type){case"a":a=2;break;case"c":a=3;break;case"l":a=4;break;case"w":a=7;break}showProjectDiv(g_curImgObj,null,dojo.byId("ptmenuitem").msg,a)}function onTCMenuClick(){var c=dojo.string.trim(htmlDecode(g_selHTML));var d=/<\/?(SUB|SUP)>/ig;var b=/<\/?.*?>/ig;var a=/[\n\r]+/ig;c=c.replace(a," ").replace(d," ").replace(b,"");addClipboardKeyword(c)}function onMenuClickCopy(){var e=dojo.string.trim(htmlDecode(g_selHTML));var f=/<\/?(SUB|SUP)>/ig;var d=/<\/?.*?>/ig;var b=/[\n\r]+/ig;e=e.replace(b," ").replace(f," ").replace(d,"");if(window.clipboardData){clipboardData.setData("text",e)}else{if(window.netscape){var a="firefoxcopier";if(!document.getElementById(a)){var g=document.createElement("div");g.id=a;document.body.appendChild(g)}dojo.byId(a).innerHTML="";var c='<input id = "_firefox_copier_input_" type="hidden" value="'+e+'"</input>';document.getElementById(a).innerHTML=c}}}var g_clipData;function onMenuClickPaste(){var a;if(window.clipboardData){a=clipboardData.getData("text");g_clipData=a}else{if(window.netscape){var b=dojo.byId("_firefox_copier_input_");if(b!=null){a=b.value;g_clipData=a}else{return}}}setTimeout("doWaitAndFocus()",100)}function doWaitAndFocus(){currentFocusInput.focus();if(typeof(currentFocusInput.selectionStart)=="number"){start=currentFocusInput.selectionStart;end=currentFocusInput.selectionEnd;var b=currentFocusInput.value.substr(0,start);var a=currentFocusInput.value.substr(end);currentFocusInput.value=b+g_clipData+a}else{currentFocusInput.value=g_clipData}}function onInputFocus(a){currentFocusInput=a}function doSearchByMenuClick(c,d){var a=normalizeQueryStr(g_selHTML,d);if(c=="r"){var b="";if(dojo.byId("queryrelated-queryexp")!=null){b=dojox.data.dom.textContent(dojo.byId("queryrelated-queryexp"))}if(d=="R"&&dojo.byId("queryrelated-querycoreexp")!=null){b=dojox.data.dom.textContent(dojo.byId("queryrelated-querycoreexp"))}if(!isNullorEmpty(b)){a=b+" and "+a}}if(c=="r"||c=="n"){prepareSlaveSearch(a,-1,null,null,null,null)}else{doWebSearch(c,a)}}function doWebSearch(d,b){if(isNullorEmpty(b)){b=dojo.byId("search-slave-queryinput").value}else{dojo.byId("search-slave-queryinput").value=b}showSlaveDiv("index-right","index-master","index-slave",30,true);var g=dojo.byId("search-slave-querylist");g.innerHTML=c_sLoading;var c;var f=document.createElement("form");var a=document.createElement("textarea");a.name="sq";if(d!=1&&g_scholarPn!=null&&g_scholarPn!=""){c="invokexml.do?sf=QueryFulltext&foo=SEARCH-SLAVE";if(g_scholarType=="i"){a.value="@_@:author:"+b+"@_@"+g_scholarPn}else{a.value="@_@:"+b+"@_@"+g_scholarPn}b='C/"'+g_scholarPn+'"';getWebRelatedSearch(b,0,d)}else{c=c_sQueryWeb+"&sm="+(d==1?"web":"scholar");a.value=b;getWebRelatedSearch(b,0,d)}f.appendChild(a);var e={url:c,handleAs:"text",form:f,load:function(i,h){if(d!=1&&g_scholarPn!=null&&g_scholarPn!=""){g.innerHTML=XSLTtrans(i,c_sXslFileQueryFulltext)}else{g.innerHTML=i}},error:function(i,h){g.innerHTML=i.message}};dojo.xhrPost(e)}function setSortImgDisplay(e){var b=null;if(isNullorEmpty(e)){b=dojo.byId("search-form-master")}else{b=dojo.byId("search-form-slave")}var f=dojo.byId("querylist-sort-img-rate"+e);var c=findSiblingBefore(f,"span",1);var a=dojo.byId("querylist-sort-img-pn"+e);var d=findSiblingBefore(a,"span",1);if((b.iopt.value&1)==0){if(f!=null){f.style.display="none"}if(a!=null){a.style.display=""}if(d!=null){d.className=""}if(c!=null){c.className="querylist-sortedColumn"}}else{if(f!=null){f.style.display=""}if(a!=null){a.style.display="none"}if(d!=null){d.className="querylist-sortedColumn"}if(c!=null){c.className=""}}}function loadQuickHistoryList(){var c=dojo.byId("quickhistorylist-tablediv");c.innerHTML=c_sLoading;var a=c_sShowHistory_Quick+"&iid=0&random="+Math.random();var b={url:a,handleAs:"text",load:function(e,d){var g=document.createElement("div");g.innerHTML=XSLTtrans(e,c_sXslFileShowHistory_Quick);var h=g.getElementsByTagName("table")[0];if(h!=null){for(var f=h.rows.length-1;f>=16;f--){h.deleteRow(f)}}c.innerHTML=g.innerHTML},error:function(e,d){alert(e.message);c.innerHTML='<table id="search-quickhistory-table"></table>'}};dojo.xhrGet(b)}function showQuickHistoryRow(a){var b=dojo.byId("search-quickhistory-hiddenrow-"+a);var c=dojo.byId("search-quickhistory-img-"+a);if(c.src.indexOf("/s.gif")!=-1){return}if(b.style.display=="none"){b.style.display="";c.src=c_sImgPath+"img/minus.gif"}else{b.style.display="none";c.src=c_sImgPath+"img/plus.gif"}}function logQuickHistory(b){if(g_pagetype=="f"){return}var m="queryrelated-queryexp"+b;var u="querylist-result-total-span"+b;var w=dojo.byId(m);var p=dojo.byId(u);if(w==null||isNullorEmpty(w.innerHTML)||p==null||isNullorEmpty(p.innerHTML)){return}var g=dojo.string.trim(dojox.data.dom.textContent(w).toString());var a=g;if(g.length>=50){a=dojo.string.trim(g.substring(0,50))+"..."}var h=dojox.data.dom.textContent(p).toString();var c=dojo.byId("search-quickhistory-table");for(var s=0;s<c.rows.length;s=s+2){var r=c.rows[s].cells[1].getElementsByTagName("span")[0];if(dojox.data.dom.textContent(r).toString()==a){if(s==0){return}else{var j=c.rows[s];var v=c.rows[s+1];var e=c.insertRow(0);e.insertCell(0).innerHTML=j.cells[0].innerHTML;e.insertCell(1).innerHTML=j.cells[1].innerHTML;e.cells[0].style.verticalAlign="top";e.cells[1].getElementsByTagName("span")[0].style.textDecoration="none";var d=c.insertRow(1);d.id=v.id;if(isNullorEmpty(b)){masterHistoryGuid=v.id}else{slaveHistoryGuid=v.id}d.style.display=v.style.display;var f=d.insertCell(0);f.colSpan=2;f.style.paddingLeft="10px";f.innerHTML=v.cells[0].innerHTML;c.deleteRow(s+3);c.deleteRow(s+2);return}}}if(c.rows.length==16){c.deleteRow(c.rows.length-1);c.deleteRow(c.rows.length-1)}historyguid++;var q='<img style="vertical-align:middle" src="'+c_sImgPath+'img/s.gif" id="search-quickhistory-img-'+historyguid+'" onclick="showQuickHistoryRow('+historyguid+')" />';var t="";if(g.length<50){t='<span onclick="onQuickHistoryTableClick(this, &#39;q&#39;)" class="quickhistory-queryterm" onmouseover="onQuickHistoryTableMouseOver(this)" onmouseout="onQuickHistoryTableMouseOut(this)">'+g+"</span>"}else{t='<span onclick="onQuickHistoryTableClick(this, &#39;q&#39;)" title="'+g.replace(/'/g,"&#39;").replace(/"/g,"&#34;")+'" class="quickhistory-queryterm" onmouseover="onQuickHistoryTableMouseOver(this)" onmouseout="onQuickHistoryTableMouseOut(this)">'+a+"</span>"}var o='<img class="imglink" style="vertical-align:middle"  onmouseover="this.src=&#39;'+c_sImgPath+'img/more3-active.gif&#39;" onmouseout="this.src=&#39;'+c_sImgPath+'img/more3.gif&#39;" src="'+c_sImgPath+'img/more3.gif" title="Filter with current display" alt="Filter with current display" onclick="onQuickHistoryTableClick(this, &#39;i&#39;)"/>';var k=t+"("+h+")&nbsp;"+o;var e=c.insertRow(0);var n=e.insertCell(0);n.style.verticalAlign="top";n.innerHTML=q;var l=e.insertCell(1);l.innerHTML=k;var d=c.insertRow(1);d.id="search-quickhistory-hiddenrow-"+historyguid;if(isNullorEmpty(b)){masterHistoryGuid=d.id}else{slaveHistoryGuid=d.id}var f=d.insertCell(0);f.colSpan=2;f.style.paddingLeft="10px";f.innerHTML='<table cellspacing="0" cellpadding="0" ></table>';d.style.display="none"}function logPnQuickHistory(j){var k=findParentNode(j,"tr",1);if(k==null){return}var e=dojox.data.dom.textContent(k.cells[0]).toString();var m=dojox.data.dom.textContent(k.cells[1]).toString();var d='<a target="_blank" href="'+c_sShowPatent+"&spn= "+e+'">'+e+"</a>";var l='<span class="quickhistory-queryterm" onmouseover="onQuickHistoryTableMouseOver(this)" onmouseout="onQuickHistoryTableMouseOut(this)" onclick="onQuickHistoryTableClick(&#39;'+e+'&#39;,&#39;t&#39;)">'+m+"</span>";var c=dojo.byId("search-quickhistory-table");if(c!=null&&c.rows.length>1){var b=null;if(isChildOf(j,dojo.byId("search-master-querylist"))){b=masterHistoryGuid}else{if(isChildOf(j,dojo.byId("search-slave-querylist"))){b=slaveHistoryGuid}}var q=0;for(var h=1;h<c.rows.length;h++){if(c.rows[h].id==b){q=h;break}}if(q==0){return}var g=c.rows[q-1].cells[0].getElementsByTagName("img")[0];var n=c.rows[q].cells[0];var a=n.getElementsByTagName("span");if(a!=null&&a.length>0){for(var h=0;h<a.length;h++){if(a[h].innerHTML==e){return}}}var p=n.getElementsByTagName("table")[0];if(p!=null){var r=p.insertRow(p.rows.length);var f=r.insertCell(0);f.style.verticalAlign="top";f.innerHTML=d;var o=r.insertCell(1);o.innerHTML=l;o.style.verticalAlign="top";o.style.paddingLeft="5px";if(g!=null&&g.src.indexOf("/s.gif")!=-1){g.className="imglink";g.src=c_sImgPath+"img/plus.gif"}}}}function onQuickHistoryTableClick(c,b){if(b=="t"){if(dojo.byId("search-master-querylist").innerHTML==""){prepareMasterSearch("pns/"+c,-1,-1,null,null,null)}else{addPatentToMasterQuerylist(c)}return}else{if(b=="q"){if(isNullorEmpty(c.title)){prepareMasterSearch(dojox.data.dom.textContent(c).toString(),-1,-1,null,null,null)}else{prepareMasterSearch(c.title,-1,-1,null,null,null)}}else{if(b=="i"){var a=getMasterQueryListPatentIDs();c=findSiblingBefore(c,"span",1);if(!isNullorEmpty(a)){if(isNullorEmpty(c.title)){prepareSlaveSearch(dojox.data.dom.textContent(c).toString()+" and pns/"+a,-1,null,null,null,null)}else{prepareSlaveSearch(c.title+" and pns/"+a,-1,null,null,null,null)}}}}}}function onQuickHistoryTableMouseOver(a){a.style.textDecoration="underline"}function onQuickHistoryTableMouseOut(a){a.style.textDecoration="none"}function addQuickProjectPatentsToMasterQuerylist(c,a){setPageView("search",false);var e=dojo.byId("search-master-querylist");if(dojo.string.trim(e.innerHTML)==""){e.innerHTML=c_sLoading}var b=c_sQueryFulltext+'&ipt=0&ips=100&idi=15&iopt=0&foo=SEARCH-MASTER-TOP&sq=proj/"'+c+'"&random='+Math.random();var d={url:b,handleAs:"text",load:function(m,q){var l=false;if(dojo.string.trim(e.innerHTML)==c_sLoading){e.innerHTML=XSLTtrans(m,c_sXslFileQueryFulltext);l=true}var h=document.createElement("div");h.innerHTML=XSLTtrans(m,c_sXslFileQueryFulltext);var v=h.getElementsByTagName("table");if(v==null){return}for(var o=0;o<v.length;o++){if(v[o].id=="querylist-queryresult-table-SEARCH-MASTER-TOP"){w=v[o];break}}if(w==null){return}var w=h.getElementsByTagName("table")[1];var p=dojo.byId("querylist-queryresult-table-SEARCH-MASTER");if(p==null){p=dojo.byId("querylist-queryresult-table-SEARCH-MASTER-TOP")}for(var o=1;o<w.rows.length;o+=2){var t=w.rows[o];if(t==null||dojox.data.dom.textContent(t.cells[1])==""){continue}var r=w.rows[o+1];if(!l){var u=p.rows[0].cells.length;var g=p.insertRow(1);g.className=t.className;g.style.backgroundColor=t.style.backgroundColor;for(var n=0;n<u;n++){var s=g.insertCell(n);if(n<t.cells.length){s.innerHTML=t.cells[n].innerHTML}else{s.innerHTML=""}}var f=p.insertRow(2);f.className=r.className;f.style.display="none";var s=f.insertCell(0);s.colSpan=u;s.align="center";s.innerHTML=r.cells[0].innerHTML}var k=t.cells[0].getElementsByTagName("span")[0].pn;g_toppatent[g_toppatent.length]=getNormalizedPN(k);g_toppatent_100[g_toppatent_100.length]=0;g_toppatentcolor[g_toppatentcolor.length]=t.getAttribute("Color");g_toppatentRowArray1[g_toppatentRowArray1.length]=t;g_toppatentRowArray2[g_toppatentRowArray2.length]=r;currentTopIndex++}},error:function(g,f){e.innerHTML=g.message}};dojo.xhrGet(d)}function onQuickProjectPatentRankClick(b){var d=getQueryTypeMatcher("r",c_sCONCEPT);var e=b;var c="";if(dojo.byId("queryrelated-querycoreexp")!=null){c=dojox.data.dom.textContent(dojo.byId("queryrelated-querycoreexp"))}var a=getQueryString(d,e,c,"and");prepareSlaveSearch(a,-1,null,null,null,null)}function QuickProjectPatentsFulltextView(a){var b=c_sProjectPatentGetJson+"&ipid="+a+"&random="+Math.random();var c=new dojo.io.Request(b,"text/json",null,false);var c={url:b,handleAs:"json",load:function(h,g){if(h.Error!=null){alert("Get Project failed!"+h.Error)}else{var e="";var d=(h.TermList.length<=16?h.TermList.length:16);for(var j=0;j<d;j++){e+=h.TermList[j]+"~"}if(e==""){return}var f="pncompare.htm?pnlist="+e;window.open(f,"_blank")}},error:function(e,d){divobj.innerHTML=e.message}};dojo.xhrGet(c)}function showQuickProjectPatents(g,h,i){var c=dojo.byId("search-quickproject-patentlist-div-"+g);var b=dojo.byId("search-quickproject-hiddenrow-"+g);var j=dojo.byId("search-quickproject-img-"+g);if(c==null){return}if(i=="quick"){b.style.display="";j.src=c_sImgPath+"img/minus.gif"}else{if(b.style.display=="none"){b.style.display="";j.src=c_sImgPath+"img/minus.gif"}else{b.style.display="none";j.src=c_sImgPath+"img/plus.gif";return}}c.innerHTML=c_sLoading;var f="&fooType="+h;var d="&fooProjectID="+g;var a=null;if(h=="1"){a=c_sQueryFulltext+"&ipt=0&ips=100&idi="+DATABASE_ALL+"&iopt=0&sq=proj/"+g+f+d+"&random="+Math.random()}else{a=c_sProjectPatentGet+"&ipid="+g+f+d+"&random="+Math.random()}var e={url:a,handleAs:"text",load:function(l,k){c.innerHTML=XSLTtrans(l,c_sXslFileQuickProjectTerms)},error:function(l,k){c.innerHTML=l.message}};dojo.xhrGet(e)}function showQuickProjectPatents_b(a,c,g){var h=dojo.byId("search-quickproject-patentlist-div-"+a);var e=dojo.byId("search-quickproject-hiddenrow-"+a);var f=dojo.byId("search-quickproject-img-"+a);if(h==null){return}if(g=="quick"){e.style.display="";f.src=c_sImgPath+"img/minus.gif"}else{if(e.style.display=="none"){e.style.display="";f.src=c_sImgPath+"img/minus.gif"}else{e.style.display="none";f.src=c_sImgPath+"img/plus.gif";return}}h.innerHTML=c_sLoading;var b=null;if(c=="1"){b=c_sQueryFulltextJson+"&ipt=0&ips=100&idi="+DATABASE_ALL+"&iopt=0&sq=proj/"+a+"&random="+Math.random()}else{b=c_sProjectPatentGetJson+"&ipid="+a+"&random="+Math.random()}var d={url:b,handleAs:"json",load:function(l,k){if(l.Error!=null){h.innerHTML="Get Project failed!"+l.Error}else{var n='<table cellspacing="0" cellpadding="0"  style="width:100%">';if(l.PatentList!=null||l.TermList!=null){if(c=="1"){for(var m=0;m<l.PatentList.length;m++){n+="<tr>";n+='<td valign="top"><a style="color:blue;cursor:pointer" title="View Fulltext" onclick="return checkInputFocus(event,this, &#39;'+l.PatentList[m].p+'&#39;);" href="#" tohref="pncompare.htm?'+c_sLang+"&pnlist="+l.PatentList[m].p+'">'+l.PatentList[m].p+"</a></td>";n+='<td style="padding-left:2px"><span class="quickproject-name" title="add patent to result list" onmouseover="onQuickProjectTableMouseOver(this)" onmouseout="onQuickProjectTableMouseOut(this)" onclick="onQuickProjectTableClick(&#39;'+l.PatentList[m].p+"&#39;, "+a+')">'+l.PatentList[m].t+'</span>&nbsp;</td><td align="right" style="padding-right:13px" width="42px"><img class="imglink"  onmouseover="this.src=&#39;'+c_sImgPath+'img/rankby-active.gif&#39;" onmouseout="this.src=&#39;'+c_sImgPath+'img/rankby.gif&#39;" src="'+c_sImgPath+'img/rankby.gif" title="rank result by this patent" onclick="onQuickProjectPatentRankClick(&#39;'+l.PatentList[m].p+'&#39;)"/><img class="imglink" onmouseover="this.src=&#39;'+c_sImgPath+'img/delete-active.gif&#39;" onmouseout="this.src=&#39;'+c_sImgPath+'img/delete.gif&#39;" src="img/delete.gif" title="Delete" onclick="doProjectPatentDelete(&#39;'+a+"&#39;,&#39;"+l.PatentList[m].p+'&#39;,&#39;quick&#39;);")/></td>';n+="</tr>"}}else{var j=null;switch(l.Type){case 2:j="a";for(var m=0;m<l.TermList.length;m++){n+="<tr>";n+='<td valign="top"><img class="imglink" style="vertical-align:middle"  title="Refine Search in ANN" src="'+c_sImgPath+'img/st.gif" onclick="onProjectTermIconClick(this, &#39;'+j+'&#39;)">';n+='<span class="quickproject-name" title="Search Patents of this company" onmouseover="onQuickProjectTableMouseOver(this)" onmouseout="onQuickProjectTableMouseOut(this)" onclick="onQuerylistRelatedClick(this, &#39;'+(j=="r"?"w":j)+'&#39;);">'+l.TermList[m]+"</span></td>";n+="</tr>"}break;case 3:j="c";for(var m=0;m<l.TermList.length;m++){n+="<tr>";n+='<td valign="top"><img class="imglink" style="vertical-align:middle"  title="Refine Search in CCL" src="'+c_sImgPath+'img/st.gif" onclick="onProjectTermIconClick(this, &#39;'+j+'&#39;)">';var o=l.TermList[m].replace("@_@"," ");n+='<span class="quickproject-name" title="search patents in this CCL" onmouseover="onQuickProjectTableMouseOver(this)" onmouseout="onQuickProjectTableMouseOut(this)" onclick="onQuerylistRelatedClick(this, &#39;'+(j=="r"?"w":j)+"&#39;, &#39;"+l.TermList[m]+'&#39;);">'+o+"</span></td>";n+="</tr>"}break;case 4:j="l";for(var m=0;m<l.TermList.length;m++){n+="<tr>";n+='<td valign="top"><img class="imglink" style="vertical-align:middle"  title="Refine Search in ICL" src="'+c_sImgPath+'img/st.gif" onclick="onProjectTermIconClick(this, &#39;'+j+'&#39;)">';n+='<span class="quickproject-name" title="search patents in this ICL" onmouseover="onQuickProjectTableMouseOver(this)" onmouseout="onQuickProjectTableMouseOut(this)" onclick="onQuerylistRelatedClick(this, &#39;'+(j=="r"?"w":j)+'&#39;);">'+l.TermList[m]+"</span></td>";n+="</tr>"}break;case 7:j="kwk";for(var m=0;m<l.TermList.length;m++){n+="<tr>";n+='<td valign="top"><img class="imglink" style="vertical-align:middle"  title="Refine Search in Index Words Field(IWK)" src="'+c_sImgPath+'img/st.gif" onclick="onProjectTermIconClick(this, &#39;'+j+'&#39;)">';n+='<span class="quickproject-name" title="Concept Search" onmouseover="onQuickProjectTableMouseOver(this)" onmouseout="onQuickProjectTableMouseOut(this)" onclick="onQuerylistRelatedClick(this, &#39;'+(j=="r"?"w":j)+'&#39;);">'+l.TermList[m]+"</span></td>";n+="</tr>"}break}}}n+="</table>";h.innerHTML=n}},error:function(j,i){h.innerHTML=j.message}};dojo.xhrGet(d)}function onQuickProjectTableClick(f,a){setPageView("search",true);if(a!=null){addPatentToMasterQuerylist(f,projectIdColorPair[a])}else{var e=dojox.data.dom.textContent(f);var d="";var b="queryrelated-queryexp";if(dojo.byId(b)!=null){d=dojox.data.dom.textContent(dojo.byId(b))}var c=getQueryString("ANN",e,d,"and");prepareSlaveSearch(c,-1,null,null,null,null)}}function onQuickProjectTableMouseOver(a){a.style.textDecoration="underline"}function onQuickProjectTableMouseOut(a){a.style.textDecoration="none"}function onAddPatentToMasterQuerylist(a){a=a?a:(window.event?window.event:null);if(a.keyCode==13){addPatentToMasterQuerylist(null)}}function addPatentToMasterQuerylistBasic(v,r,e,t){existtable=dojo.byId("querylist-queryresult-table-SEARCH-MASTER");if(existtable==null){existtable=dojo.byId("querylist-queryresult-table-SEARCH-MASTER-TOP")}var n=false;var f=null;var d=null;var l=null;var x=null;for(var u=0;u<g_toppatent.length;u++){if(v==g_toppatent[u]){n=true;f=g_toppatentRowArray1[u];d=g_toppatentRowArray2[u];l=g_toppatentcolor[u];x=u;break}}if(existtable!=null&&n){if(f!=null&&d!=null){if(existtable.rows.length>=x*2+2){var w=getNormalizedPN(existtable.rows[x*2+1].cells[0].getElementsByTagName("span")[0].getAttribute("pn"));if(w==v){existtable.deleteRow(x*2+2);existtable.deleteRow(x*2+1);for(var s=x-1;s>=0;s--){g_toppatentcolor[s+1]=g_toppatentcolor[s];g_toppatentRowArray2[s+1]=g_toppatentRowArray2[s];g_toppatentRowArray1[s+1]=g_toppatentRowArray1[s];g_toppatent[s+1]=g_toppatent[s]}g_toppatent[0]=v;g_toppatentRowArray1[0]=f;g_toppatentRowArray2[0]=d;g_toppatentcolor[0]=l}}var h=existtable.rows[0].cells.length;var b=existtable.insertRow(1);if(currentTopIndex++%2==0){b.className="querylist-dark"}else{b.className="querylist-light"}if(!isNullorEmpty(l)){b.style.backgroundColor=l}else{if(!isNullorEmpty(r)){b.style.backgroundColor=r}}for(var u=0;u<h;u++){var c=b.insertCell(u);if(u<f.cells.length){c.innerHTML=f.cells[u].innerHTML}else{c.innerHTML=""}}var a=existtable.insertRow(2);a.className=d.className;a.style.display="none";var c=a.insertCell(0);c.colSpan=h;c.align="center";c.innerHTML=d.cells[0].innerHTML;return}}var m;var g;var o=false;g=dojo.byId("search-master-querylist");if(dojo.byId("querylist-queryresult-table-SEARCH-MASTER")==null&&dojo.byId("querylist-queryresult-table-SEARCH-MASTER-TOP")==null){o=true}var p="";var y=getPatentNumIDI(v);if(y==-140){y=128}var q=dojo.byId("search-form-master").idi.value;if(o){p="&sdf=p8t42a16i16c50l70"}else{p="&sdf=p8t32a16i16c50l70r10"}m=c_sQueryFulltext+"&sq=pns/"+v+"&ipt=0&idi="+y+p+"&iopt=5&foo=SEARCH-MASTER-TOP&sid="+Math.random()+"&ibasic=1";var k={url:m,handleAs:"text",load:function(C,G){var B;var F=false;B=dojo.byId("search-master-querylist");var A=document.createElement("div");A.innerHTML=XSLTtrans(C,c_sXslFileQueryFulltext);var M=null;var L=A.getElementsByTagName("table");if(L==null){return}for(var D=0;D<L.length;D++){if(L[D].id=="querylist-queryresult-table-SEARCH-MASTER-TOP"){M=L[D];break}}if(M==null){return}var J=M.rows[1];if(J==null){return}if(dojox.data.dom.textContent(J.cells[1])==""){return}var H=M.rows[2];if(isNullorEmpty(J.Color)){if(currentTopIndex%2==0){J.className="querylist-dark"}else{J.className="querylist-light"}}currentTopIndex++;if(!n||f==null||d==null){if(n&&(f==null||d==null)){g_toppatent[x]=v;g_toppatent_100[g_toppatent_100.length]=1;g_toppatentRowArray1[x]=J;g_toppatentRowArray2[x]=H;J.insertCell(J.cells.length).innerHTML="100%"}else{for(var D=g_toppatent.length-1;D>=0;D--){g_toppatent[D+1]=g_toppatent[D];g_toppatentcolor[D+1]=g_toppatentcolor[D];g_toppatentRowArray1[D+1]=g_toppatentRowArray1[D];g_toppatentRowArray2[D+1]=g_toppatentRowArray2[D]}g_toppatent[0]=v;g_toppatentRowArray1[0]=J;g_toppatentRowArray2[0]=H;if(!isNullorEmpty(r)){g_toppatentcolor[0]=r}else{g_toppatentcolor[0]=J.Color}}}var E;E=dojo.byId("querylist-queryresult-table-SEARCH-MASTER");if(E==null){E=dojo.byId("querylist-queryresult-table-SEARCH-MASTER-TOP")}var K=E.rows[0].cells.length;var z=E.insertRow(1);z.className=J.className;if(!isNullorEmpty(r)){z.style.backgroundColor=r}else{z.style.backgroundColor=J.Color}for(var D=0;D<K;D++){var I=z.insertCell(D);if(D<J.cells.length){I.innerHTML=J.cells[D].innerHTML}else{I.innerHTML=""}}var j=E.insertRow(2);j.className=H.className;j.style.display="none";var I=j.insertCell(0);I.colSpan=K;I.align="center";I.innerHTML=H.cells[0].innerHTML},error:function(j,i){alert(i.message)}};dojo.xhrGet(k)}function addPatentToMasterQuerylist(C,y,f,A,q,F){C=ConvertTransPN(C,F);if(A==null){var v=dojo.byId("resultparamdiv");if(v!=null){A=v.getAttribute("conceptterm");if(A==null||A=="null"||A=="undefined"){A=""}}if(A==""){A=null}}if(isNullorEmpty(C)){C=dojo.byId("search-input-topquery").value;C=ConvertTransPN(C,F)}if(isNullorEmpty(C)){return}if(basic_search){return addPatentToMasterQuerylistBasic(C,y,f,A)}var d=false;var k=dojo.byId("querylist-queryresult-table-SEARCH-FIG");if(k!=null){d=true}C=getNormalizedPN(C);if(!d){k=dojo.byId("querylist-queryresult-table-SEARCH-MASTER");if(k==null){k=dojo.byId("querylist-queryresult-table-SEARCH-MASTER-TOP")}}if(g_ClipboardTopPNNum!=null&&C!=getNormalizedPN(g_ClipboardTopPNNum)){LoadQueryJsFile();clearClipboardTopPN();g_ClipboardTopPNNum=C;var t=dojo.byId("toppnspan");var r=t.childNodes;for(var B=0;B<r.length;B++){if(r[B].nodeType=="3"){t.removeChild(r[B])}}var m=document.createTextNode(C);t.appendChild(m)}var s=false;var g=null;var e=null;var o=null;var E=null;for(var B=0;B<g_toppatent.length;B++){if(C==g_toppatent[B]){s=true;g=g_toppatentRowArray1[B];e=g_toppatentRowArray2[B];o=g_toppatentcolor[B];E=B;break}}if(k!=null&&s){if(g!=null&&e!=null){if(k.rows.length>=E*2+2){var D=getNormalizedPN(k.rows[E*2+1].cells[0].getElementsByTagName("span")[0].getAttribute("pn"));var F=parseInt(k.rows[E*2+1].cells[0].getElementsByTagName("input")[0].value);D=ConvertTransPN(D,F);if(D==C){k.deleteRow(E*2+2);k.deleteRow(E*2+1);for(var z=E-1;z>=0;z--){g_toppatentcolor[z+1]=g_toppatentcolor[z];g_toppatentRowArray2[z+1]=g_toppatentRowArray2[z];g_toppatentRowArray1[z+1]=g_toppatentRowArray1[z];g_toppatent[z+1]=g_toppatent[z]}g_toppatent[0]=C;g_toppatentRowArray1[0]=g;g_toppatentRowArray2[0]=e;g_toppatentcolor[0]=o}}var l=k.rows[0].cells.length;var b=k.insertRow(1);if(currentTopIndex++%2==0){b.className="querylist-dark"}else{b.className="querylist-light"}if(!isNullorEmpty(o)){b.style.backgroundColor=o}else{if(!isNullorEmpty(y)){b.style.backgroundColor=y}}for(var B=0;B<l;B++){var c=b.insertCell(B);if(B<g.cells.length){c.innerHTML=g.cells[B].innerHTML}else{c.innerHTML=""}}var a=k.insertRow(2);a.className=e.className;a.style.display="none";var c=a.insertCell(0);c.colSpan=l;c.align="center";c.innerHTML=e.cells[0].innerHTML;if(q!=false){MyScorllIntoView(b)}syncClient(2);return}}var p;var h;var u=false;if(d){h=dojo.byId("search-slave-querylist");if(dojo.byId("querylist-queryresult-table-SEARCH-FIG")==null&&dojo.byId("querylist-queryresult-table-SEARCH-MASTER-TOP")==null){u=true}}else{h=dojo.byId("search-master-querylist");if(dojo.byId("querylist-queryresult-table-SEARCH-MASTER")==null&&dojo.byId("querylist-queryresult-table-SEARCH-MASTER-TOP")==null){u=true}}if(d){p=c_sQueryFulltext+"&sq=pns/"+C+"&ipt=0&idi=15&iopt=5&foo=SEARCH-MASTER-TOP"}else{var w="";var G=getPatentNumIDI(C);if(G==-140){G=128}var x=dojo.byId("search-form-master").idi.value;if(u){w="&sdf=p8t42a16i16c50l70"}else{w="&sdf=p8t32a16i16c50l70r10"}if(A!=null){p=c_sQueryFulltext+"&sq=pns/"+C+' and r/"'+encodeURI(A)+'"&ipt=0&idi='+G+w+"&iopt=5&foo=SEARCH-MASTER-TOP&sid="+Math.random()}else{p=c_sQueryFulltext+"&sq=pns/"+C+"&ipt=0&idi="+G+w+"&iopt=5&foo=SEARCH-MASTER-TOP&sid="+Math.random()}}var n={url:p,handleAs:"text",load:function(I,T){var L;var R=false;if(d){L=dojo.byId("search-slave-querylist");if(dojo.byId("querylist-queryresult-table-SEARCH-FIG")==null&&dojo.byId("querylist-queryresult-table-SEARCH-MASTER-TOP")==null){R=true}}else{L=dojo.byId("search-master-querylist");if(dojo.byId("querylist-queryresult-table-SEARCH-MASTER")==null&&dojo.byId("querylist-queryresult-table-SEARCH-MASTER-TOP")==null){R=true}}if(R){L.innerHTML=XSLTtrans(I,c_sXslFileQueryFulltext);if(g_ClipboardTopPNNum!=null&&C!=getNormalizedPN(g_ClipboardTopPNNum)){LoadQueryJsFile();clearClipboardTopPN();g_ClipboardTopPNNum=C;var P=dojo.byId("toppnspan");var O=P.childNodes;for(var U=0;U<O.length;U++){if(O[U].nodeType=="3"){P.removeChild(O[U])}}var N=document.createTextNode(C);P.appendChild(N)}g_toppatent[g_toppatent.length]=C;g_toppatent_100[g_toppatent_100.length]=0;var S=document.createElement("div");S.innerHTML=XSLTtrans(I,c_sXslFileQueryFulltext);var W=null;var Q=S.getElementsByTagName("table");if(Q==null){return}for(var U=0;U<Q.length;U++){if(Q[U].id=="querylist-queryresult-table-SEARCH-MASTER-TOP"){W=Q[U];break}}if(W==null){return}var X=W.rows[1];if(X==null){return}if(dojox.data.dom.textContent(X.cells[1])==""){return}var V=W.rows[2];if(!isNullorEmpty(y)){g_toppatentcolor[g_toppatentcolor.length]=y}else{g_toppatentcolor[g_toppatentcolor.length]=X.getAttribute("Color")}g_toppatentRowArray1[g_toppatentRowArray1.length]=X;g_toppatentRowArray2[g_toppatentRowArray2.length]=V;syncClient(2)}else{var S=document.createElement("div");S.innerHTML=XSLTtrans(I,c_sXslFileQueryFulltext);if(g_ClipboardTopPNNum!=null&&C!=getNormalizedPN(g_ClipboardTopPNNum)){LoadQueryJsFile();clearClipboardTopPN();g_ClipboardTopPNNum=C;var P=dojo.byId("toppnspan");var O=P.childNodes;for(var U=0;U<O.length;U++){if(O[U].nodeType=="3"){P.removeChild(O[U])}}var N=document.createTextNode(C);P.appendChild(N)}var W=null;var Q=S.getElementsByTagName("table");if(Q==null){return}for(var U=0;U<Q.length;U++){if(Q[U].id=="querylist-queryresult-table-SEARCH-MASTER-TOP"){W=Q[U];break}}if(W==null){return}var X=W.rows[1];if(X==null){return}if(dojox.data.dom.textContent(X.cells[1])==""){return}var V=W.rows[2];if(isNullorEmpty(X.Color)){if(currentTopIndex%2==0){X.className="querylist-dark"}else{X.className="querylist-light"}}currentTopIndex++;if(!s||g==null||e==null){if(s&&(g==null||e==null)){g_toppatent[E]=C;g_toppatent_100[g_toppatent_100.length]=1;g_toppatentRowArray1[E]=X;g_toppatentRowArray2[E]=V;X.insertCell(X.cells.length).innerHTML="100%"}else{for(var U=g_toppatent.length-1;U>=0;U--){g_toppatent[U+1]=g_toppatent[U];g_toppatent_100[U+1]=g_toppatent_100[U];g_toppatentcolor[U+1]=g_toppatentcolor[U];g_toppatentRowArray1[U+1]=g_toppatentRowArray1[U];g_toppatentRowArray2[U+1]=g_toppatentRowArray2[U]}g_toppatent[0]=C;g_toppatent_100[0]=0;g_toppatentRowArray1[0]=X;g_toppatentRowArray2[0]=V;if(!isNullorEmpty(y)){g_toppatentcolor[0]=y}else{g_toppatentcolor[0]=X.Color}}}var H;if(d){H=dojo.byId("querylist-queryresult-table-SEARCH-FIG")}else{H=dojo.byId("querylist-queryresult-table-SEARCH-MASTER")}if(H==null){H=dojo.byId("querylist-queryresult-table-SEARCH-MASTER-TOP")}var M=H.rows[0].cells.length;var J=H.insertRow(1);J.className=X.className;if(!isNullorEmpty(y)){J.style.backgroundColor=y}else{J.style.backgroundColor=X.Color}for(var U=0;U<M;U++){var K=J.insertCell(U);if(U<X.cells.length){K.innerHTML=X.cells[U].innerHTML}else{K.innerHTML=""}}var j=H.insertRow(2);j.className=V.className;j.style.display="none";var K=j.insertCell(0);K.colSpan=M;K.align="center";K.innerHTML=V.cells[0].innerHTML;MyScorllIntoView(J);syncClient(2)}},error:function(j,i){alert(j.message)}};dojo.xhrGet(n)}function resetAdvancedSearch(){var b=dojo.byId("advancedsearch-form-2");for(var a=0;a<b.length;a++){if(b[a].type!="button"){b[a].value=""}}b=dojo.byId("advancedsearch-form-1");for(var a=0;a<b.length;a++){if(b[a].type!="button"){b[a].value=""}}}function showinputtip(a,d,c,b){var e=dojo.byId("search-inputtipsdiv");if(e==null){return}b=b?b:(window.event?window.event:null);if(d){if(isNullorEmpty(g_inputValue[a])&&isNullorEmpty(g_inputBasicValue[a])){return}if(a=="ND"){e.innerHTML=g_inputBasicValue[a]}else{e.innerHTML=g_inputValue[a]}if(basic_search){if(a=="PN"||a=="APN"){e.innerHTML=g_inputBasicValue[a]}}e.style.visibility="visible";e.style.width=230;e.style.left=b.clientX+10+document.body.scrollLeft+"px";e.style.top=b.clientY+10+document.body.scrollTop+"px"}else{e.style.visibility="hidden"}}function prepareAdvancedSearch(){var g="";var e=dojo.byId("advancedsearch-form-1");if(!isNullorEmpty(e.w1.value)){var h=e.w1.value.split(";");for(var f=0;f<h.length;f++){g+=normalize("B",h[f])}}if(!isNullorEmpty(e.w2.value)){g+=normalize("B",e.w2.value)}if(!isNullorEmpty(e.w3.value)){var h=e.w3.value.split(";");var a="";for(var f=0;f<h.length;f++){a+=" or B/"+h[f]}if(a!=""){a=a.substring(4,a.length)}g+=" and ("+a+")"}var b=dojo.byId("advancedsearch-form-2");if(!isNullorEmpty(b.rankby.value)){g+=normalize("R",b.rankby.value)}if(!isNullorEmpty(b.concept.value)){g+=normalize(c_sC,b.concept.value)}if(!isNullorEmpty(b.pn.value)){g+=normalize("PN",b.pn.value)}if(!isNullorEmpty(b.inv.value)){g+=normalize("IN",b.inv.value)}if(!isNullorEmpty(b.icn.value)){g+=normalize("ICN",b.icn.value)}if(!isNullorEmpty(b.is.value)){g+=normalize("IS",b.is.value)}if(!isNullorEmpty(b.ic.value)){g+=normalize("IC",b.ic.value)}if(!isNullorEmpty(b.ttl.value)){g+=normalize("TTL",b.ttl.value)}if(!isNullorEmpty(b.abst.value)){g+=normalize("ABST",b.abst.value)}if(!isNullorEmpty(b.aclm.value)){g+=normalize("ACLM",b.aclm.value)}if(!isNullorEmpty(b.spec.value)){g+=normalize("SPEC",b.spec.value)}if(!isNullorEmpty(b.kw.value)){g+=normalize("IW",b.kw.value)}if(!isNullorEmpty(b.kwk.value)){g+=normalize("IWK",b.kwk.value)}if(!isNullorEmpty(b.an.value)){g+=normalize("AN",b.an.value)}if(!isNullorEmpty(b.ann.value)){g+=normalize("ANN",b.ann.value)}if(!isNullorEmpty(b.acn.value)){g+=normalize("ACN",b.acn.value)}if(!isNullorEmpty(b.as.value)){g+=normalize("AS",b.as.value)}if(!isNullorEmpty(b.ac.value)){g+=normalize("AC",b.ac.value)}if(!isNullorEmpty(b.ccl.value)){g+=normalize("CCL",b.ccl.value)}if(!isNullorEmpty(b.cclm.value)){g+=normalize("CCLM",b.cclm.value)}if(!isNullorEmpty(b.ccls.value)){g+=normalize("CCLS",b.ccls.value)}if(!isNullorEmpty(b.icl.value)){g+=normalize("ICL",b.icl.value)}if(!isNullorEmpty(b.apn.value)){g+=normalize("APN",b.apn.value)}if(!isNullorEmpty(b.parn.value)){g+=normalize("PARN",b.parn.value)}if(!isNullorEmpty(b.refe.value)){g+=normalize("REF",b.refe.value)}if(!isNullorEmpty(b.fref.value)){g+=normalize("FREF",b.fref.value)}if(!isNullorEmpty(b.oref.value)){g+=normalize("OREF",b.oref.value)}if(!isNullorEmpty(b.prir.value)){g+=normalize("PRIR",b.prir.value)}if(!isNullorEmpty(b.pex.value)){g+=normalize("EXP",b.pex.value)}if(!isNullorEmpty(b.asex.value)){g+=normalize("EXA",b.asex.value)}if(!isNullorEmpty(b.agt.value)){g+=normalize("LREP",b.agt.value)}if(!isNullorEmpty(b.govt.value)){g+=normalize("GOVT",b.govt.value)}if(!isNullorEmpty(b.rlap.value)){g+=normalize("RLAP",b.rlap.value)}if(!isNullorEmpty(b.pct.value)){g+=normalize("PCT",b.pct.value)}if(!isNullorEmpty(b.apt.value)){g+=normalize("APT",b.apt.value)}if(!isNullorEmpty(b.fig.value)){g+=normalize("FIG",b.fig.value)}if(!isNullorEmpty(b.pab.value)){g+=normalize("PAB",b.pab.value)}if(!isNullorEmpty(b.inf.value)){g+=normalize("INF",b.inf.value)}if(!isNullorEmpty(b.cite.value)){g+=normalize("CITE",b.cite.value)}if(!isNullorEmpty(b.pns.value)){g+=normalize("PNS",b.pns.value)}if(!isNullorEmpty(b.proj.value)){g+=normalize("PROJ",b.proj.value)}if(!isNullorEmpty(b.rel.value)){g+=normalize("REL",b.rel.value)}if(!isNullorEmpty(b.di.value)){g+=normalize("DI",b.di.value)}if(!isNullorEmpty(b.da.value)){g+=normalize("DA",b.da.value)}var d=new Date();var j=new Date(d.getFullYear(),d.getMonth(),d.getDate()+1);var c=j.getFullYear()+"-"+(j.getMonth()+1)+"-"+j.getDate();if(!isNullorEmpty(b.isd.value)&&!isNullorEmpty(b.isdto.value)){g+=" and ISD/"+dojo.string.trim(b.isd.value)+"->"+dojo.string.trim(b.isdto.value)}else{if(!isNullorEmpty(b.isd.value)){g+=" and ISD/"+dojo.string.trim(b.isd.value)+"->"+c}else{if(!isNullorEmpty(b.isdto.value)){g+=" and ISD/1970-01-01->"+dojo.string.trim(b.isdto.value)}}}if(!isNullorEmpty(b.apd.value)){g+=" and APD/"+dojo.string.trim(b.apd.value)}if(!isNullorEmpty(e.w4.value)){var h=e.w4.value.split(";");var a="";for(var f=0;f<h.length;f++){a+=" andnot B/"+h[f]}g+=a}if(g!=""){if(g.indexOf(" andnot")==0){alert("Queryterm can not only have andnot!");return}g=g.substring(5,g.length);prepareMasterSearch(g,-1,-1,null,null,null)}}function resetBasicSearch(){var b=dojo.byId("basicsearch-form");for(var a=0;a<b.length;a++){if(b[a].type!="button"){b[a].value=""}}}function checkBasicSearchKey(a){a=a?a:(window.event?window.event:null);if(a.keyCode==13){prepareBasicSearch()}}function getBasicSearchND(){var a=dojo.byId("search-master-database-span");if(a==null){return""}var d=a.getElementsByTagName("input");var b="";for(var c=0;c<d.length;c++){if(d[c].checked){b+=" or ND/"+d[c].name}}return b}function prepareBasicSearch(){var a="";var c=dojo.byId("basicsearch-form");if(!isNullorEmpty(c.pn.value)){a+=normalize("PN",c.pn.value)}if(!isNullorEmpty(c.apn.value)){a+=normalize("APN",c.apn.value)}if(!isNullorEmpty(c.ttl.value)){a+=normalize("TTL",c.ttl.value)}if(!isNullorEmpty(c.abst.value)){a+=normalize("ABST",c.abst.value)}if(!isNullorEmpty(c.inv.value)){a+=normalize("IN",c.inv.value)}if(!isNullorEmpty(c.an.value)){a+=normalize("AN",c.an.value)}if(!isNullorEmpty(c.icl.value)){a+=normalize("ICL",c.icl.value)}if(!isNullorEmpty(c.isd.value)){a+=" and ISD/"+dojo.string.trim(c.isd.value)}if(!isNullorEmpty(c.apd.value)){a+=" and APD/"+dojo.string.trim(c.apd.value)}if(a!=""){var b=getBasicSearchND();if(b!=""){a+=" and ("+b.substring(4)+")"}if(a.indexOf(" andnot")==0){alert("Queryterm can not only have andnot!");return}a=a.substring(5,a.length);prepareMasterSearch(a,-1,-1,null,null,null)}else{prepareMasterSearch(null,-1,-1,null,null,null)}}function normalize_bak(b,c,a){c=dojo.string.trim(c.replace(/"/g," "));if(c.indexOf(" ")!=-1){c='"'+c+'"'}if(isNullorEmpty(a)){a="and"}return" "+a+" "+b+"/"+c}function getMasterQueryListPatentIDs(){var d=dojo.byId("search-master-querylist");var c=dojo.byId("querylist-queryresult-table-SEARCH-MASTER");if(c==null||c.rows.length<=1){return null}var b="";for(var a=1;a<c.rows.length;a+=2){b+=dojox.data.dom.textContent(c.rows[a].cells[0])+" "}return'"'+b+'"'}function showTempSub(){var b=dojo.byId("search-master-subget");if(b.style.display==""){b.style.display="none";return}b.style.display="";b.innerHTML=c_sLoading;var a={url:c_sBookmarkGet+"&random="+Math.random(),handleAs:"text",load:function(d,c){b.innerHTML=XSLTtrans(d,c_sXslFileBookmarkGet)},error:function(d,c){b.innerHTML=d.message}};dojo.xhrGet(a)}function onSubGetTableClick(d,a,c){var b=dojox.data.dom.textContent(d);setSearchTypeCheckbox(parseInt(a));setSearchTypeValue("1");dojo.byId("search-form-slave").value=parseInt(c);prepareSlaveSearch(b,-1,null,null,null,null)}function prepareSubSearch(c){var d=dojo.byId("search-master-subget-table");var f="";var b=0;for(var a=1;a<d.rows.length-1;a++){var e=d.rows[a].cells[0].getElementsByTagName("input")[0];if(e.checked){f+="QUERY/"+dojox.data.dom.textContent(d.rows[a].cells[0].getElementsByTagName("span")[0])+c;var g=d.rows[a].cells[1].getElementsByTagName("input")[0].value;b=b|g}}if(f!=""){f=f.substring(0,f.length-c.length)}setSearchTypeCheckbox(b);setSearchTypeValue("0");prepareMasterSearch(f,-1,-1,null,null,null)}function prepareChangeLan(b){var c=dojo.byId("search-form-master");var d=getFormElementValue(dojo.byId("search-form-master"),"radiosd");var a=dojo.byId("searchtype-span").getAttribute("typevalue");addCookie("st",a,24*30);addCookie("sd",d,24*30);addCookie("sq",dojo.byId("search-master-queryinput").value,24*30);if(b==1){if(g_pagetype=="i"){window.location.href="indexcn.htm"}else{window.location.href="searchcn.htm"}}else{if(b==2){if(g_pagetype=="i"){window.location.href="index.htm"}else{window.location.href="search.htm"}}else{if(g_version=="eng"){window.location.href="index.htm"}else{window.location.href="indexcn.htm"}}}}function openQueryFulltextDrawing(a){getUserLoginState2(openQueryFulltextDrawing1,[a])}function openQueryFulltextDrawing1(e){var c=e[0];if(c==null){fulltextImgClick(dojo.byId("queryfulltext_statdrawing_SEARCH-MASTER"))}var h=dojo.byId("querylist-queryresultchart-div-SEARCH-MASTER");if(h.style.display==""&&c!=true){h.style.display="none";return}HiddenQueryListIcon("SEARCH-MASTER");h.style.display="";var b="invokebinary.do?sf=QueryFulltextDrawing";b+="&ig="+dojo.byId("statistic-itselect").value;var d=dojo.byId("search-form-master");b+="&sq="+encodeURI(d.sq.value);b+="&idi="+d.idi.value;b+="&sd="+d.sd.value;var g=dojo.byId("searchtype-span").typevalue;if(g>4){g=4}b+="&st="+g;var d=dojo.byId("search-form-master");var f=dojo.byId("statistic-sizeselect").value;switch(f){case"1":b+="&iwpx=600&ihpx=400";break;case"2":b+="&iwpx=800&ihpx=600";break;case"3":b+="&iwpx=1024&ihpx=768";break}var a='<img  src="'+b+'"/>';dojo.byId("statistic-picdiv").innerHTML=a}function setLanguage(){var a;if(g_version=="chn"){a=1}else{a=2}dojo.xhrGet({url:c_sLanguageSet+"&type="+a+"&random="+Math.random(),handleAs:"json",load:function(c,b){},error:function(c,b){}})}function getPatentInfo(){dojo.xhrGet({url:c_sQueryPatentInfo,handleAs:"json",sync:true,load:function(b,a){if(b.error==null){for(var c=1;c<6;c++){var e=dojo.byId("patent-counter-"+c);var d=dojo.byId("patent-date-"+c);if(e){e.innerHTML=b.TotalNumList[c-1]}if(d){d.innerHTML=b.StartDateList[c-1]+"~"+b.EndDateList[c-1]}}}},error:function(b,a){}})}function SetInitPermission(a){if(g_pagetype=="i"){return}var b={url:"invokejson.do?sf=PermissionCheck&random="+Math.random(),handleAs:"json",sync:true,load:function(d,c){if(d.PermissionList!=null){var e=ABSTRACT_FULLTEXT_DIV;ABSTRACT_FULLTEXT_DIV=(d.PermissionList[0]&1);if(a!=null&&e==1&&ABSTRACT_FULLTEXT_DIV==0){dojo.byId("database-type-span").style.display="none";changeDatabaseRadio(0,1)}else{if(ABSTRACT_FULLTEXT_DIV){if(dojo.byId("database-type-span")!=null){dojo.byId("database-type-span").style.display=""}}}}}};dojo.xhrGet(b)}function ClearMasterInput(){if(dojo.byId("search-master-queryinput").value==c_sMasterInputHint||(dojo.byId("search-master-queryinput").style&&dojo.byId("search-master-queryinput").style.color=="gray")){dojo.byId("search-master-queryinput").value="";dojo.byId("search-master-queryinput").style.color="black"}}var canShow=false;function showTips(){dijit.byId("search-master-tooltip").open(dojo.byId("search-master-queryinput"))}function hiddenTips(){dijit.byId("search-master-tooltip").close();canShow=false}function ShowExampleInputQuery(a){dojo.byId("search-master-queryinput").value=a.innerText;dojo.byId("search-master-queryinput").style.color="black"}function InitTips(){dijit.byId("search-master-tooltip")._onTargetFocus=function(a){if(a.ctrlKey||a.altKey||a.shiftKey){return}this._focus=true};dijit.byId("search-master-tooltip")._onHover=function(b){if(!this._focus){return}if(!this._showTimer){var a=b.target;this._showTimer=setTimeout(dojo.hitch(this,function(){this.open(a)}),this.showDelay)}};dijit.byId("search-master-tooltip").open=function(a){if(canShow==false){return}if(dojo.byId("popupdiv-searchhelp").style.visibility=="visible"){return}if(this._showTimer){clearTimeout(this._showTimer);delete this._showTimer}dijit.showTooltip(this.label||this.domNode.innerHTML,a,this.position);this._connectNode=a;this.onShow(a,this.position)};dijit.Tooltip.defaultPosition=["above","below"];dojo.byId("search-master-queryinput").onclick=function(){canShow=true;showTips()}}dojo.addOnLoad(function(){if(dojo.isIE&&typeof(window.external)!="undefined"&&typeof(window.external.CallJavascriptCallBack)!="undefined"){isClient=true}InitTips();setCopyright();if(g_pagetype=="f"){var k=new ACComponent("search-slave-queryinput","popupdiv-searchhelp","/",true,prepareSlave);return}var m=new ACComponent("search-master-queryinput","popupdiv-searchhelp","/",true,prepareMaster);var k=new ACComponent("search-slave-queryinput","popupdiv-searchhelp","/",true,prepareSlave);if(dojo.byId("simpleadvancedsearch-allwords")!=null){var j=new ACComponent("simpleadvancedsearch-allwords","popupdiv-searchhelp","",true,prepareSlave)}if(dojo.byId("simpleadvancedsearch-exactwords")!=null){var g=new ACComponent("simpleadvancedsearch-exactwords","popupdiv-searchhelp","",true,prepareSlave)}if(dojo.byId("simpleadvancedsearch-atleastwords")!=null){var e=new ACComponent("simpleadvancedsearch-atleastwords","popupdiv-searchhelp","",true,prepareSlave)}if(dojo.byId("simpleadvancedsearch-withoutwords")!=null){var d=new ACComponent("simpleadvancedsearch-withoutwords","popupdiv-searchhelp","",true,prepareSlave)}if(dojo.byId("simpleadvancedsearch-anninput")!=null){var b=new ACComponent("simpleadvancedsearch-anninput","popupdiv-searchhelp","",true,prepareSlave);b.fixedQueryType="ann"}if(dojo.byId("ai-guide-patentability")!=null){dojo.byId("ai-guide-patentability").checked=true}initcalendar("#065f6c");if(INIT_PERMISSION){SetInitPermission()}SetInitConfig();if(typeof initGlobalValInputTip=="function"){initGlobalValInputTip()}onSelectTypeChange(null,null,"");var q=null;var a=null;var r=null;var o=null;var n=new UrlBuilder(window.location.href);n.GetValue("");if(n.m_Params!=null){q=n.m_Params.st;a=n.m_Params.sd;r=decodeURI(n.m_Params.sq);o=n.m_Params.login}if(isNullorEmpty(r)&&navigator.cookieEnabled){q=getCookie("st");a=getCookie("sd");r=getCookie("sq");o=getCookie("login")}changeDatabaseRadio(g_funcArray[140]);if(o=="1"){var v=dojo.byId("login-result-div");var l=getDatabaseSpan();v.innerHTML=l+g_loginSpan;v.style.display="";prepareLogin()}else{var p=getConfig(PAGEVIEW_CONFIG);setPageView(p,true)}if(!isNullorEmpty(a)){setFormElementValue(dojo.byId("search-form-master"),"radiosd",a)}if(!isNullorEmpty(q)){setSearchTypeCheckbox(q);setSearchTypeValue("0")}else{setSearchTypeCheckbox(INIT_DATABASE);setSearchTypeValue("0")}if(dojo.byId("preference-pabdate-input")!=null){dojo.byId("preference-pabdate-input").value=""}if(dojo.byId("preference-infdate-input")!=null){dojo.byId("preference-infdate-input").value=""}if((navigator.systemLanguage!=null&&navigator.systemLanguage.indexOf("zh")!=-1)||navigator.userAgent.indexOf("zh-CN")!=-1||window.location.href.indexOf("searchcn")!=-1){if(dojo.byId("newuser-search")!=null){dojo.byId("newuser-search").style.display=""}}if(!isNullorEmpty(r)&&(r!=c_sMasterInputHint&&r!=c_sMasterInputHint_chs)){if(o=="1"){dojo.byId("search-master-queryinput").value=r}else{prepareMasterSearch(r,-1,-1,null,null,null,true)}}else{if(dojo.byId("search-master-queryinput").value=="proj/client"){setDisplay(dojo.byId("newusertoread"),"none");prepareMasterSearch(r,-1,-1,null,null,null,true)}else{dojo.byId("search-master-queryinput").style.color="gray";if(window.location.href.indexOf("searchcn")!=-1){dojo.byId("search-master-queryinput").value=c_sMasterInputHint_chs}else{dojo.byId("search-master-queryinput").value=c_sMasterInputHint_en}}if(dojo.byId("newusertoread")!=null){toReadUp()}}var c=getCookie("sqmaster");var f=getCookie("sqslave");if(isNullorEmpty(r)&&!isNullorEmpty(c)){dojo.byId("search-master-queryinput").value=c;dojo.byId("search-master-queryinput").style.color="black"}if(!isNullorEmpty(f)){dojo.byId("search-slave-queryinput").value=f}deleteCookie("sd");deleteCookie("sq");deleteCookie("login");if(isClient){var t=dojo.byId("contact-info");if(t!=null){t.style.display="none"}}if(dojo.isIE){var u=dojo.byId("newusertoread");var h=u.getElementsByTagName("input");if(h!=null){for(var s=0;s<h.length;s++){if(h[s].className.indexOf("ffcss")!=-1){h[s].className=h[s].className.replace("ffcss","iecss")}}}}dojo.extend(ApplicationState,{back:function(){setPageViewDisplay("search");dojo.byId("search-master-querylist").innerHTML=this.datafulltext;dojo.byId("search-master-queryrelated").innerHTML=this.datarelated;var i=dojo.byId("search-form-master");i.ipi.value=this.dataform.ipi;i.sq.value=this.dataform.sq;i.sd.value=this.dataform.sd;i.idi.value=this.dataform.idi;i.iopt.value=this.dataform.iopt;i.sc.value=this.dataform.sc;i.sds.value=this.dataform.sds;i.sde.value=this.dataform.sde;i.ip.value=this.dataform.ip;i.sqf.value=this.dataform.sqf;i.sdf.value=this.dataform.sdf;dojo.byId("search-master-queryinput").value=this.dataform.sq;setSearchTypeCheckbox(parseInt(this.dataform.idi));setFormElementValue(i,"radiosd",this.dataform.sd)},forward:function(){setPageViewDisplay("search");dojo.byId("search-master-querylist").innerHTML=this.datafulltext;dojo.byId("search-master-queryrelated").innerHTML=this.datarelated;var i=dojo.byId("search-form-master");i.ipi.value=this.dataform.ipi;i.sq.value=this.dataform.sq;i.sd.value=this.dataform.sd;i.idi.value=this.dataform.idi;i.iopt.value=this.dataform.iopt;i.sc.value=this.dataform.sc;i.sds.value=this.dataform.sds;i.sde.value=this.dataform.sde;i.ip.value=this.dataform.ip;i.sdf.value=this.dataform.sdf;i.sqf.value=this.dataform.sqf;dojo.byId("search-master-queryinput").value=this.dataform.sq;setSearchTypeCheckbox(parseInt(this.dataform.idi));setFormElementValue(i,"radiosd",this.dataform.sd)}});dojo.back.setInitialState({back:function(){setPageViewDisplay("search");dojo.byId("search-master-querylist").innerHTML="";dojo.byId("search-master-queryrelated").innerHTML="";var i=dojo.byId("search-form-master");i.ipi.value=0;i.sq.value="";i.sd.value=c_sC;i.idi.value=1;i.iopt.value=5;i.sc.value="";i.sds.value="";i.sde.value="";i.ip.value=0;dojo.byId("search-master-queryinput").value="";setSearchTypeCheckbox(1);setFormElementValue(i,"radiosd",c_sC)},forward:function(){setPageViewDisplay("search");dojo.byId("search-master-querylist").innerHTML="";dojo.byId("search-master-queryrelated").innerHTML="";var i=dojo.byId("search-form-master");i.ipi.value=0;i.sq.value="";i.sd.value=c_sC;i.idi.value=1;i.iopt.value=5;i.sc.value="";i.sds.value="";i.sde.value="";i.ip.value=0;dojo.byId("search-master-queryinput").value="";setSearchTypeCheckbox(1);setFormElementValue(i,"radiosd",c_sC)}})});function doSearchHelpSelect(b){var a=dojo.byId("popupdiv-searchhelp");a.comObject.selectRowFunction(b)}function doSelectSearchHelpRow(b){var a=dojo.byId("popupdiv-searchhelp");a.comObject.enterRowFunction(b,a.comObject.selectedRowIndex)}function onImportDocumentTypeClick(e){var b=dojo.byId("search-importpatent-form");var a=dojo.byId("popupdiv-importpatent-tr1");var f=dojo.byId("popupdiv-importpatent-tr2");var d=dojo.byId("popupdiv-importpatent-tr3");var c=dojo.byId("popupdiv-importpatent-tr4");if(e=="u"){a.style.display="none";f.style.display="none";d.style.display="";c.style.display=""}else{a.style.display="";f.style.display="";d.style.display="none";c.style.display="none"}}function prepareImportPatents2(){var a=dojo.byId("upload_form");a.action="invokehtml.do?sf=TextImportFromFile&sx=uploaddocument";a.submit();a.reset()}function importDocumentByUrl(){var c=dojo.byId("search-importpatent-form");if(isNullorEmpty(c.su.value)){alert(c_sERROR_IMPORTDOCUMENT);return}var d=document.createElement("form");var a=document.createElement("textarea");a.name="su";a.value=c.su.value;d.appendChild(a);dojo.byId("popupdiv-importpatent-importresult").innerHTML=c_sLoading;var b={url:c_sImportDocumentFormHtml,handleAs:"json",form:d,load:function(f,e){dojo.byId("popupdiv-importpatent-importresult").innerHTML="";if(f.Error!=null){alert(f.Error)}else{dojo.byId("document-newtitle-input").value=f.Title;dojo.byId("document-newan-input").value=f.An;dojo.byId("document-newcontent-textarea").value=f.Text;dojo.byId("document-newclaim-textarea").value=f.Claim;dojo.byId("document-newabst-textarea").value=f.Abst;dojo.byId("document-newauthor-input").value=dojo.byId("search-importpatent-form").su.value;dojo.byId("popupdiv-importpatent").style.visibility="hidden"}},error:function(f,e){alert(f.message)}};dojo.xhrPost(b)}function prepareImportCatalog(b,a){prepareImportPatents(b,"c",a)}function prepareImportPatents3(c){var a=c_sUserGet+"&it=1&random="+Math.random();var b={url:a,handleAs:"json",load:function(e,d){if(e.Error==null&&e.User!=null){var h=dojo.byId("popupdiv-importpatent3");h.style.display="";var g=dojo.byId("importpatents_form");g.action="invokehtml.do?sf=ImportResults&sx="+c_sUPLOADPATENTSXSL;dojo.byId("popupdiv-importpatent3-result").style.display="";h.style.visibility="visible";var f=getElementPos("search-master-import-img");h.style.left=(f.x-50)+"px";h.style.top=f.y+20+"px";dojo.byId("search-master-import-img").src=c_sImgPath+"img/uploadpatent.gif";g.submit();g.reset();moveinputout("search-master-import-span","importpatents_input")}else{setPageViewDisplay("login");alert(c_sERROR_QUERYRESULTSET_NOTLOGIN)}},error:function(e,d){setPageViewDisplay("login");alert(c_sERROR_QUERYRESULTSET_NOTLOGIN)}};dojo.xhrGet(b)}function onCloseUploadPatents(){dojo.byId("popupdiv-importpatent3").style.display="none"}function prepareImportPatents(f,b,a){var d;if(b=="c"&&f!=null){d=f.getAttribute("NodeId")}if(f==null){f=a}var c=c_sUserGet+"&it=1&random="+Math.random();var e={url:c,handleAs:"json",load:function(o,n){if(o.Error==null&&o.User!=null){var h=dojo.byId("popupdiv-importpatent");h.style.width="200px";if(b=="u2"){h.style.width="500px"}if(h.style.visibility=="visible"){h.style.visibility="hidden";return}if(b=="c"||b=="u2"){if(dojo.byId("search-importpatent-uploadtype-u")){dojo.byId("search-importpatent-uploadtype-u").style.visibility="hidden"}if(dojo.byId("search-importpatent-uploadtype-u-text")){dojo.byId("search-importpatent-uploadtype-u-text").style.visibility="hidden"}if(dojo.byId("search-importpatent-uploadtype-f")){dojo.byId("search-importpatent-uploadtype-f").style.visibility="hidden"}if(dojo.byId("search-importpatent-uploadtype-f-text")){dojo.byId("search-importpatent-uploadtype-f-text").style.visibility="hidden"}}else{if(dojo.byId("search-importpatent-uploadtype-u")){dojo.byId("search-importpatent-uploadtype-u").style.visibility=""}if(dojo.byId("search-importpatent-uploadtype-u-text")){dojo.byId("search-importpatent-uploadtype-u-text").style.visibility=""}if(dojo.byId("search-importpatent-uploadtype-f")){dojo.byId("search-importpatent-uploadtype-f").style.visibility=""}if(dojo.byId("search-importpatent-uploadtype-f-text")){dojo.byId("search-importpatent-uploadtype-f-text").style.visibility=""}}var g=dojo.byId("search-importpatent-form");var m=dojo.byId("popupdiv-importpatent-tr1");var l=dojo.byId("popupdiv-importpatent-tr2");var k=dojo.byId("popupdiv-importpatent-tr3");var j=dojo.byId("popupdiv-importpatent-tr4");if(b=="u"||b=="u2"){dojo.byId("search-importpatent-uploadtype-u").checked=true;m.style.display="none";l.style.display="none";k.style.display="";j.style.display=""}else{dojo.byId("search-importpatent-uploadtype-f").checked=true;m.style.display="";l.style.display="";k.style.display="none";j.style.display="none";if(b=="p"){g.action="invokehtml.do?sf=ImportResults&sx=uploadpatent"}else{if(b=="d"){g.action="invokehtml.do?sf=TextImportFromFile&sx=uploaddocument"}else{if(b=="c"){g.action="invokehtml.do?sf=CatalogImport&sx=uploadpersonalclass&icid="+d+"&"+c_sLang}}}}dojo.byId("popupdiv-importpatent-result").style.display="none";h.style.visibility="visible";var i=calculateOffset(f,"offsetLeft")-100;var p=calculateOffset(f,"offsetTop");var q=calculateOffset(f,"scrollTop");h.style.left=(parseInt(i)-2)+"px";var r=h.style.height.substring(0,h.style.height.length-2);r=p-q+17;if(r<0){r=0}h.style.top=r+"px"}else{setPageViewDisplay("login");alert(c_sERROR_QUERYRESULTSET_NOTLOGIN)}},error:function(h,g){setPageViewDisplay("login");alert(c_sERROR_QUERYRESULTSET_NOTLOGIN)}};dojo.xhrGet(e)}function closeLogin(){if(dojo.byId("login-form-div")!=null){dojo.byId("login-form-div").style.display="none";dojo.byId("login-form-div").style.visibility="hidden"}if(dojo.byId("shadowDiv")!=null){dojo.byId("shadowDiv").style.display="none";dojo.byId("shadowDiv").style.visibility="hidden"}}function appendQuery(b,c){var a=dojo.byId(b).value;if(a==c_sMasterInputHint||a==c_sMasterInputHint_chs||a==c_sMasterInputHint_en){dojo.byId(b).value=""}else{if(dojo.byId(b).value!=""){if(!dojo.byId(b).value.charAt(dojo.byId(b).value.length-1)==" "){dojo.byId(b).value+=" "}dojo.byId(b).value+="and "}}if(dojo.byId(b).style.color=="gray"){dojo.byId(b).style.color="black"}dojo.byId(b).value+=c}function commandPopup(c){if(dojo.byId("search-bestmode")!=null&&dojo.byId("search-bestmode").style.visibility=="visible"){bestModeDown()}if(SearchSimple_Load==false){dload("search-simple","searchsimple.htm");SearchSimple_Load=true}if(dojo.byId("search-simple").style.visibility=="visible"){commandDown();return}var g;var f;if(c!=null&&c.clientX>0&&c.clientY>0){g=c.clientX;f=c.clientY+10}else{var a=document.body.clientHeight;var e=document.body.clientWidth;var b=400;var d=300;g=(e-b)/2;f=(a-d)/2;if(g<0){g=0}if(f<0){f=0}}dojo.byId("search-simple").style.left=g+"px";dojo.byId("search-simple").style.top=f+"px";dojo.byId("search-simple").style.display="";dojo.byId("search-simple").style.visibility="visible"}function commandDown(){if(dojo.byId("search-simple")!=null){dojo.byId("search-simple").style.display="none";dojo.byId("search-simple").style.visibility="hidden"}}function movefiletohere(e,a){var b=document.getElementById(e);var d=a.layerY-5;var c=a.layerX-5;b.style.top=d+"px";b.style.left=c+"px"}function moveinput(d,a){var b=document.getElementById(a);var c=getElementPos(d);b.style.top=c.y-5+"px";b.style.left=c.x-45+"px";if(dojo.isIE>=9){b.style.left=c.x-5+"px";b.style.width="50px";b.style.visibility="visible"}}function moveinputtoimportpatents(d,a){if(dojo.byId("search-master-import-img")!=null){dojo.byId("search-master-import-img").src=c_sImgPath+"img/uploadpatent-active.gif"}if(dojo.byId("importpatents_input")!=null){dojo.byId("importpatents_input").style.display=""}var b=document.getElementById(a);var c=getElementPos(d);if(c.x==null||c.y==null){return}if(c!=null){b.style.top=c.y-25+"px";b.style.left=c.x-25+"px";if(dojo.isIE>=9){b.style.top=c.y-20+"px";b.style.left=c.x-35+"px";b.style.height="100px"}}b.style.visibility="visible"}function getElementPos(h){var a=navigator.userAgent.toLowerCase();var b=(a.indexOf("opera")!=-1);var e=(a.indexOf("msie")!=-1&&!b);var d=document.getElementById(h);if(d==null||d.parentNode==null||d.style.display=="none"){return false}var l=null;var k=[];var i;if(d.getBoundingClientRect){i=d.getBoundingClientRect();var c=Math.max(document.documentElement.scrollTop,document.body.scrollTop);var f=Math.max(document.documentElement.scrollLeft,document.body.scrollLeft);return{x:i.left+f,y:i.top+c}}else{if(document.getBoxObjectFor){i=document.getBoxObjectFor(d);var j=(d.style.borderLeftWidth)?parseInt(d.style.borderLeftWidth):0;var g=(d.style.borderTopWidth)?parseInt(d.style.borderTopWidth):0;k=[i.x-j,i.y-g]}else{k=[d.offsetLeft,d.offsetTop];l=d.offsetParent;if(l!=d){while(l){k[0]+=l.offsetLeft;k[1]+=l.offsetTop;l=l.offsetParent}}if(a.indexOf("opera")!=-1||(a.indexOf("safari")!=-1&&d.style.position=="absolute")){k[0]-=document.body.offsetLeft;k[1]-=document.body.offsetTop}}}if(d.parentNode){l=d.parentNode}else{l=null}while(l&&l.tagName!="BODY"&&l.tagName!="HTML"){k[0]-=l.scrollLeft;k[1]-=l.scrollTop;if(l.parentNode){l=l.parentNode}else{l=null}}return{x:k[0],y:k[1]}}function moveinputout(d,a){var c=dojo.byId(d);if(c!=null){dojo.byId("search-master-import-span").src=c_sImgPath+"img/uploadpatent.gif"}var b=dojo.byId(a);if(b!=null){b.style.top="0px";b.style.left="0px";b.style.visibility="hidden"}}function classsearch(a){if(a.keyCode==13){dojo.byId("class-search-button").click()}}function doPatentMap(c,b,a){getUserLoginState2(doPatentMap1,[c,b,a])}function closeSwfByClick(a){fulltextImgClick(dojo.byId("doPatentMap_SEARCH-MASTER"));doPatentMap1(a)}function closeSwf(a){if(dojo.byId("querylist-patentmap-keyword").checked){dojo.byId("querylist-patentmap-pn").checked=true;doPatentMap("SEARCH-MASTER","radio")}else{dojo.byId("querylist-patentmap-div-swf-SEARCH-MASTER").style.display="none"}}var LastConceptTerm="";function doPatentMap1(j){var h;var c=false;if(j.length>0){if(j[0]=="SEARCH-MASTER"||j=="SEARCH-MASTER"){h=dojox.data.dom.textContent(dojo.byId("queryrelated-queryexp"))}else{if(j[0]=="SEARCH-SLAVE"||j=="SEARCH-SLAVE"){h=dojox.data.dom.textContent(dojo.byId("queryrelated-queryexp_s"))}else{return}}if(j.length>1){if(j[1]=="radio"){c=true}}if(j.length>2&&j!="SEARCH-MASTER"&&!c){if(j[2]!=null){fulltextImgClick(j[2])}}}else{return}var g=dojo.byId("search-form-master").idi.value;var d=dojo.byId("querylist-patentmap-div-SEARCH-MASTER");if(d.style.display==""&&(c==false)){d.style.display="none";return}else{if(!c){HiddenQueryListIcon(j)}}if(dojo.byId("querylist-patentmap-div-swf-SEARCH-MASTER").style.display=="none"){dojo.byId("querylist-patentmap-div-swf-SEARCH-MASTER").style.display=""}if(c==false){if(!isNullorEmpty(h)){if(LastConceptTerm==h&&dojo.byId("querylist-patentmap-div-swf-SEARCH-MASTER").innerHTML!=""){dojo.byId("querylist-patentmap-div-SEARCH-MASTER").style.display="";return}else{LastConceptTerm=h}}else{return}HiddenQueryListIcon(j);d.style.display="";dojo.byId("querylist-patentmap-div-swf-SEARCH-MASTER").innerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="swflash.cab#version=10" height="0" width="0"><object type="application/x-shockwave-flash" height="0" width="0">'}else{if(lastPatentMapRadio==0&&dojo.byId("querylist-patentmap-keyword").checked){return}if(lastPatentMapRadio==1&&dojo.byId("querylist-patentmap-pn").checked){return}d.style.display=""}var b=new SWFObject("PatentMap.swf","mymovie","800","400","10","#ffffff");var e="";for(var f=0;f<h.length;f++){if(h.charAt(f)==":"){e+=" "}else{e+=h.charAt(f)}}var a=encodeURI(e);b.addVariable("FunctionName","QueryRelatedClusterSwf");b.addVariable("QueryTerm",a);b.addVariable("Database",g);b.addVariable("DivType",j[0]);if(dojo.byId("querylist-patentmap-keyword").checked){b.addVariable("Type",0);lastPatentMapRadio=0}if(dojo.byId("querylist-patentmap-pn").checked){b.addVariable("Type",1);lastPatentMapRadio=1}b.write("querylist-patentmap-div-swf-SEARCH-MASTER")}function bestModePopup(c){if(dojo.byId("search-simple").style.visibility=="visible"){commandDown()}if(dojo.byId("search-bestmode").style.visibility=="visible"){bestModeDown();return}var g;var f;if(c!=null&&c.clientX>0&&c.clientY>0){g=c.clientX;f=c.clientY+10}else{var a=document.body.clientHeight;var e=document.body.clientWidth;var b=400;var d=300;g=(e-b)/2;f=(a-d)/2;if(g<0){g=0}if(f<0){f=0}}dojo.byId("search-bestmode").style.left=g+"px";dojo.byId("search-bestmode").style.top=f+"px";dojo.byId("search-bestmode").style.display="";dojo.byId("search-bestmode").style.visibility="visible"}function bestModeDown(){if(dojo.byId("search-bestmode")!=null){dojo.byId("search-bestmode").style.display="none";dojo.byId("search-bestmode").style.visibility="hidden"}}function checkInputFocus(i,d,a){if(i.shiftKey){d.setAttribute("href","");d.setAttribute("target","");if(currentFocusInput==null||currentFocusInput==""){currentFocusInput=dojo.byId("search-master-queryinput")}if(currentFocusInput.id=="search-slave-queryinput"||currentFocusInput.id=="search-master-queryinput"){if(currentFocusInput.value.length>0){var h=currentFocusInput.value.charAt(currentFocusInput.length-1);if(h==" "||h=="/"||h=='"'){currentFocusInput.value+=a}else{currentFocusInput.value+=" "+a}}else{currentFocusInput.value=a}}else{if(currentFocusInput.className=="querylist-pagerinput"){currentFocusInput.value=a;var f=findSiblingAfter(currentFocusInput,"span",2);if(f==null){f=findSiblingAfter(currentFocusInput,"span",1);if(f==null){return false}}f.onclick()}else{if(currentFocusInput.className=="querylist-pn-input"){currentFocusInput.value=a;var e=findSiblingAfter(currentFocusInput,"img",1);if(e==null){return false}e.onclick()}else{if(currentFocusInput.value.length>0){var h=currentFocusInput.value.charAt(currentFocusInput.length-1);if(h==" "||h=="/"||h=='"'){currentFocusInput.value+=a}else{currentFocusInput.value+=" "+a}}else{currentFocusInput.value=a}}}}return false}else{if(dojo.isIE&&window.external&&isClient){var b=a;for(var c=0;c<10;c++){b=b.replace("/","");b=b.replace(",","")}var g=/^([0-9])/;if(g.test(b)){b="US"+b}window.external.viewFullTextFromPN(d.getAttribute("pn")+"&"+b);return}d.setAttribute("href",d.getAttribute("tohref"));d.setAttribute("target","_blank");return true}}function setClient(){isClient=true}function setClientVersion(a){clientVersion=Number(a)}function editMasterSearchResult(){editSearchResult("checkAllClient","querylist-queryresult-table-SEARCH-MASTER");var a=needMap;editSearchResult("checkAllClientSlave","querylist-queryresult-table-SEARCH-SLAVE");needMap=a}function editSearchResult(p,c,l){var k="0";if(p=="checkAllClientSlave"){k="1"}needMap=true;var o=dojo.byId(p);var h=null;if(o!=null&&isNullorEmpty(l)){if(o.style.display=="none"){h=""}else{downloadIpnsMap.clear();downloadIpnsMapSlave.clear();h="none";needMap=false}o.style.display=h}var q=null;var g=false;q=dojo.byId(c);if(q==null){q=dojo.byId(c+"-TOP");if(q==null){return}}var n;if(isNullorEmpty(l)||(!isNullorEmpty(l)&&(o==null))){if(h==null){n=q.rows[0].insertCell(q.rows[0].children.length);n.innerHTML='<input type="checkbox" id="'+p+'" onclick="checkAllClient(this,'+k+')"></input>';n.style.width="10px"}else{q.rows[0].children[q.rows[0].children.length-1].style.display=h;q.rows[0].children[q.rows[0].children.length-1].children[0].checked=false}}for(var e=1;e<q.rows.length;e+=2){var m=q.rows[e];if(h==null||!isNullorEmpty(l)){if(isNullorEmpty(l)){n=m.insertCell(m.children.length)}else{if(o==null){n=m.insertCell(m.children.length)}else{n=m.children[m.children.length-1]}}var b=m.children[0].children[1].getAttribute("value");var a=m.children[0].children[0].getAttribute("pn");a=a.replace(",","");for(var d=0;d<10;d++){a=a.replace("/","");a=a.replace(",","")}var f=/^([0-9])/;if(f.test(a)){a="US"+a}if(a.indexOf("CN")==0){a=m.children[0].children[0].getAttribute("apn")+"&"+m.children[0].children[0].getAttribute("pn")}else{a=a+"&"+a}n.innerHTML='<input type="checkbox" onclick="setDownloadipn(this,'+k+');" value="'+b+'" pn="'+a+'"></input>';if((k=="0"&&downloadIpnsMap.containsKey(b))||(k=="1"&&downloadIpnsMapSlave.containsKey(b))){n.children[0].checked=true}}else{m.children[m.children.length-1].style.display=h;m.children[m.children.length-1].children[0].checked=false}if(!isNullorEmpty(l)){return}}}function checkAllClient(e,c){var d=dojo.byId("querylist-queryresult-table-SEARCH-MASTER");if(c==1){d=dojo.byId("querylist-queryresult-table-SEARCH-SLAVE")}else{if(d==null){d=dojo.byId("querylist-queryresult-table-SEARCH-MASTER-TOP")}}var a=d.getElementsByTagName("input");for(var b=0;b<a.length;b++){if(a[b].type=="checkbox"&&a[b].getAttribute("id")!="checkAllClient"){a[b].checked=e.checked;setDownloadipn(a[b],c)}}}function setDownloadipn(d,c){var a=d.getAttribute("value");var b=d.getAttribute("pn");if(d.checked){if(c==0){downloadIpnsMap.put(a,b)}else{downloadIpnsMapSlave.put(a,b)}}else{if(c==0){downloadIpnsMap.remove(a)}else{downloadIpnsMapSlave.remove(a)}}}function queryPatentsPns(){var c=dojo.byId("search-form-master");var a=c_sQueryFulltextJson+"&ips=40000&sdf=p&"+Math.random();var b={url:a,form:c,handleAs:"json",load:function(e,d){if(e.PatentList==null){return}var g="";for(var f=0;f<e.PatentList.length;f++){g+=e.PatentList[f].PN+";"}window.external.SetPatentsPns(g)},error:function(e,d){}};dojo.xhrPost(b)}function doMasterSearchByClient(a){if(!isNullorEmpty(a)){prepareMasterSearch(a,-1,null,null,null,null)}}function doSlaveSearchByClient(a){if(!isNullorEmpty(a)){prepareSlaveSearch(a,-1,null,null,null,null)}}function parsePatentNumber(a){var b=dojo.byId(a);if(b!=null){var d=b.getElementsByTagName("table");if(d!=null&&d.length>0){var g=d[0];var k=g.getElementsByTagName("span");if(k!=null&&k.length>0){var h=k[0].innerHTML;for(var e=0;e<h.length;e++){var j=h.charAt(e);if(j>="0"&&j<="9"){var f=h.substring(e);return parseInt(f)}}}}}return 0}function getResultNumber(a){if(a=="1"){if(typeof(downloadIpnsMap.size)!="undefiend"&&downloadIpnsMap.size()>0){return downloadIpnsMap.size()}else{return parsePatentNumber("search-master-querylist")}}else{if(typeof(downloadIpnsMapSlave.size)!="undefiend"&&downloadIpnsMapSlave.size()>0){return downloadIpnsMapSlave.size()}else{return parsePatentNumber("search-slave-querylist")}}}function queryProjectClient(e,d){var g=document.createElement("form");var c=document.createElement("textarea");var a=document.createElement("textarea");a.name="spns";a.value=d;g.appendChild(a);var b="invokexml.do?sf=SetProjClient&it="+e+"&random="+Math.random();var f={url:b,form:g,handleAs:"text",load:function(i,h){if(e=="0"){dojo.byId("search-master-queryinput").value="proj/client";dojo.byId("search-master-queryinput").style.color="black";prepareMasterSearch(null,-1,-1,null,null,null)}else{if(e=="1"){dojo.byId("search-slave-queryinput").value="proj/sclient";dojo.byId("search-slave-queryinput").style.color="black";prepareSlaveSearch(null,-1,null,null,null,null)}}},error:function(i,h){alert(i)}};dojo.xhrPost(f)}function queryPN(f,c){var e=document.createElement("form");var b=document.createElement("textarea");b.name="spn";b.value=f;e.appendChild(b);var a;if(clientVersion>1){if(c=="0"){a="invoketext.do?sf=QueryPatentPNFromDocid"}else{if(c=="1"){a="invoketext.do?sf=QueryPatentDocidFromPN"}}}else{if(c=="0"){a="invokexml.do?sf=QueryPatentPNFromDocid"}else{if(c=="1"){a="invokexml.do?sf=QueryPatentDocidFromPN"}}}var d={url:a,form:e,handleAs:"text",load:function(h,g){if(c=="0"){window.external.QueryPN(h)}else{if(c=="1"){window.external.QueryDocid(h)}}},error:function(h,g){alert(h);if(c=="0"){window.external.QueryPN("")}else{if(c=="1"){window.external.QueryDocid("")}}}};dojo.xhrPost(d)}function invokeJavascript(e,i,d,f){var c=document.createElement("form");if(i=="1"||i=="2"){var h=document.createElement("textarea");h.name="idi";if(isNullorEmpty(f)){h.value=dojo.byId("search-form-slave").idi.value}else{h.value=f}c.appendChild(h)}var a=document.createElement("textarea");a.name="sq";a.value=e;c.appendChild(a);var b;if(i=="1"){b=c_sQueryFulltext+"&ips=100000&ipi=0&iclient=1&random="+Math.random()}else{if(i=="2"){b=c_sQueryFulltextCluster+"&random="+Math.random()}else{if(i=="3"){b="invokexml.do?sf=CatalogImportFromString&ramdon="+Math.random()}else{if(i=="4"){b="invokexml.do?sf=QueryPatentFamilyAll&iclient=1&sdf=p8t45a16i16c40l60r60&ipn="+e+"&ids="+f;c=dojo.byId("search-form-master")}else{if(i=="5"){b=c_sQueryFulltext+"&ips=1000000&ipi=0&iclient=1&isetProj=3&idi=1&random="+Math.random()}}}}}var g={url:b,form:c,handleAs:"text",load:function(k,j){if(i=="1"||i=="4"){window.external.ReservedCallBack(k)}else{if(i=="2"){window.external.ClusterCallBack(k,d)}else{if(i=="3"){window.external.ClassExportToCustomed(k)}else{if(i=="5"){window.external.SavePatentsPart(k)}}}}},error:function(k,j){alert(k.message)}};dojo.xhrPost(g)}var langlocale;function setlang(a){langlocale=a}function downloadPatents(j,e,B,C,A,E,w,m,u,h,p,f){var F=true;var c=PATENTBILITY_DATABASE_EN;var x="0";var q=0;var z=8;var v=0;if(!isNullorEmpty(u)){z=u}if(!isNullorEmpty(B)){c=B}if(!isNullorEmpty(w)){x=w}if(!isNullorEmpty(m)){q=m}if(!isNullorEmpty(m)){v=p}var G=1000;if(!isNullorEmpty(e)){if(e=="1"){F=false}else{if(e=="2"||e=="3"||e=="4"||e=="5"||e=="6"||e=="7"||e=="8"||e=="9"||e=="10"||e=="11"){var b=document.createElement("form");if(e!="5"&&e!="7"&&e!="8"&&e!="9"){var n=document.createElement("textarea");n.name="sq";if(e=="6"&&!isNullorEmpty(C)){n.value=j+" and "+C}else{n.value=j}b.appendChild(n)}else{if((e=="8"||e=="5")&&downloadIpnsMap.size()>0){var k="";var s=downloadIpnsMap.keys();for(var y=0;y<s.length;y++){if(!isNullorEmpty(s[y])){k+=s[y];if(y<s.length-1){k+=" "}}}window.external.DocumentAnalysisByPns(k);return}else{if((e=="7"||e=="9")&&downloadIpnsMapSlave.size()>0){var k="";var s=downloadIpnsMapSlave.keys();for(var y=0;y<s.length;y++){if(!isNullorEmpty(s[y])){k+=s[y];if(y<s.length-1){k+=" "}}}window.external.DocumentAnalysisByPns(k);return}}}if(e=="5"||e=="6"||e=="7"||e=="8"||e=="9"){G=1000000;var r=document.createElement("textarea");r.name="idi";if(e=="6"&&!isNullorEmpty(j)&&j.charAt(0)!="C"){r.value=3}else{if(e=="7"){r.value=dojo.byId("search-form-slave").idi.value}else{r.value=dojo.byId("search-form-master").idi.value}}b.appendChild(r);if(e=="5"||e=="8"){var n=document.createElement("textarea");n.name="sq";var C=dojo.byId("search-form-master").sqf.value;if(!isNullorEmpty(C)){n.value=dojo.byId("search-form-master").sq.value+" and "+C}else{n.value=dojo.byId("search-form-master").sq.value}b.appendChild(n);var o=document.createElement("textarea");o.name="sdf";o.value="p8";b.appendChild(o)}else{if(e=="7"||e=="9"){var n=document.createElement("textarea");n.name="sq";n.value=dojo.byId("search-form-slave").sq.value;b.appendChild(n);var o=document.createElement("textarea");o.name="sdf";o.value="p8";b.appendChild(o)}}}else{if(e=="4"||e=="10"||e=="11"){G=100000}}var t=document.createElement("textarea");t.name="sd";t.value=dojo.byId("search-form-master").sd.value;b.appendChild(t);var g=c_sQueryFulltext+"&ips="+G+"&ipi=0&iclient=1&ioid="+x+"&random="+Math.random()+"&isetProj="+q;if(e=="3"){g=c_sQueryFulltextCluster+"&ict=5000&idi="+c+"&iclient=1&sdf=p8t38a16i16c40l60r60&ioid="+x+"&iclusterNum="+z+"&ifaref="+p+"&random="+Math.random()}if(!isNullorEmpty(h)){g+="&iopt="+h}g+="&sl="+langlocale;var d={url:g,form:b,handleAs:"text",load:function(H,i){if(e=="2"){window.external.InsertIntoClass(H,j)}else{if(e=="3"){window.external.QueryClusterBack(H)}else{if(e=="4"||e=="10"){window.external.ExportToLocal(H)}else{if(e=="5"||e=="7"||e=="8"||e=="9"){window.external.DocumentAnalysis(H)}else{if(e=="6"){window.external.QueryAnalysisResult(H)}else{if(e=="11"){window.external.RefineSearchOnlyDocid(H)}}}}}}},error:function(H,i){alert(H)}};dojo.xhrPost(d);return}}}var a=dojo.byId("search-form-master");if(!F){a=dojo.byId("search-form-slave")}var l=a.sq.value;var D=0;G=100000;if(!isNullorEmpty(A)){D=A}if(!isNullorEmpty(E)){G=E}if((downloadIpnsMap.size()>0&&F)||(downloadIpnsMapSlave.size()>0&&!F)){var b=document.createElement("form");var n=document.createElement("textarea");n.name="spns";n.value="";var s=downloadIpnsMap.keys();if(!F){s=downloadIpnsMapSlave.keys()}for(var y=0;y<s.length;y++){if(!isNullorEmpty(s[y])){n.value+=s[y];if(y<s.length-1){n.value+=" "}}}b.appendChild(n);var g=c_sQueryFulltextByPns+"&ips="+G+"&ids="+D+"&ipi=0&iclient=1&ioid="+x+"&random="+Math.random();g+="&sl="+langlocale;var d={url:g,form:b,handleAs:"text",load:function(H,i){if(isNullorEmpty(j)){window.external.SavePatents(H)}else{window.external.InsertIntoClass(H,l)}},error:function(H,i){alert(H)}};dojo.xhrPost(d)}else{var g="&ips="+G+"&ids="+D+"&ipi=0&iclient=1&ioid="+x+"&random="+Math.random()+"&isetProj="+q;g+="&sl="+langlocale;if(x=="1"&&clientVersion>1){if(!isNullorEmpty(f)&&f=="0"){g=c_sQueryFulltext+g}else{g="invoketext.do?sf=QueryFulltext&itxt=1"+g}}else{g=c_sQueryFulltext+g}var d={url:g,form:a,handleAs:"text",load:function(H,i){if(isNullorEmpty(j)){window.external.SavePatentsPart(H)}else{window.external.InsertIntoClass(H,l)}},error:function(H,i){}};dojo.xhrPost(d)}}function reloadCustomedClass(){setPageView("class",true)}function getSlaveString(){return dojo.byId("search-slave-queryinput").value}function getMasterString(){return dojo.byId("search-master-queryinput").value}function getMasterIdi(){return dojo.byId("search-form-master").idi.value}function getSlaveIdi(){return dojo.byId("search-form-slave").idi.value}function getSearchSpanValue(){return dojo.byId("searchtype-span").getAttribute("typevalue")}function queryXMLBysq(c,f){var e=document.createElement("form");var a=document.createElement("textarea");a.name="sq";a.value=f;e.appendChild(a);var b=c_sQueryFulltext+"&ips=1000000&iclient=1";var d={url:b,form:e,handleAs:"text",load:function(h,g){if(c=="0"){window.external.SetclassAnalysisResult(h)}},error:function(h,g){alert(h)}};dojo.xhrPost(d)}function ExportDetailed(b){var a;var c={url:b,sync:true,handleAs:"text",load:function(e,d){a=e},error:function(e,d){alert(e)}};dojo.xhrPost(c);return a}function GetUsername(){var c="";var a="invokejson.do?sf=UserGet";var b={url:c_sUserGet+"&random="+Math.random(),handleAs:"json",sync:true,load:function(e,d){if(e.User!=null){c=e.User.Id}}};dojo.xhrGet(b);return c}function GetLoginStatus(){var a;dojo.xhrGet({url:c_sUserGet+"&random="+Math.random(),handleAs:"json",sync:true,load:function(c,b){if(c.Error!=null){a=false}else{if(c.User!=null){a=true}else{a=false}}},error:function(c,b){}});return a}function GetRGB(c){var b=c>>16;var a=(c>>8)&255;var d=c&255;return"rgb("+b+","+a+","+d+")"}function MarkProject(b){var r=dojo.byId("querylist-queryresult-table-"+b);if(!(dojo.isIE&&window.external&&isClient)){return}if(typeof(window.external)!="undefined"&&typeof(window.external.QueryProjectColor)=="undefined"){return}if(r!=null){for(var k=1;k<r.rows.length;k+=2){var e=r.rows[k];var j=e.getElementsByTagName("td");var d=j[0].getElementsByTagName("span")[0].getAttribute("pn");var q=j[3].innerText;var p=j[1].innerText;var l=j[2].innerText;var f=j[4].innerText;var o=j[5].innerText;var g=window.external.QueryProjectColor(l,q,o,f,p,d);if(g!="error"){var a=g.split("#");window.external.ReleaseBSTR(g);if(a.length==3){var c=parseInt(a[0]);var h=parseInt(a[1]);var n=parseInt(a[2]);var m=0;switch(n){case 0:m=2;break;case 1:m=3;break;case 2:m=5;break;case 3:m=4;break;case 4:m=1;break;case 5:m=0;break}if(h!=c){j[m].style.color=GetRGB(h)}j[m].style.backgroundColor=GetRGB(c)}}}}};
