if(!window.myliv){window.myliv={}}if(!window.myliv["AutoComplete"]){myliv.AutoComplete=function(a,b,c){QKEXTDATA=[];QKTMPDATA=[];QKMOVEPOS=-1;QKCACHEHEAD="";QKSHOWTOP=20;QKVFUNC=null;QKFUNC=null;QKISLOADED=false;QKTYPE="";QKLASTTEXT="";QKQUERYOBJ=typeof a=="object"?a:null;QKSELFNAME=typeof b=="string"?b:"AutoComplete";QKNOTHIDEOBJ=[];this.Char_A="";this.Char_B="";this.Char_C=""};myliv.AutoComplete.prototype={setCallBackBySelected:function(a){QKFUNC=a},setCallBackByViewItem:function(a){QKVFUNC=a},setNotHideElement:function(a){QKNOTHIDEOBJ=a},ID:function(a){return document.getElementById(a)},TAG:function(a,b){return a.getElementsByTagName(b)},queryGO:function(b,d,c){if(typeof c=="undefined"){c="up"}QKQUERYOBJ=d;QKTYPE=c;var a=b.keyCode||b.which;if(c=="down"&&(38==a||40==a)){this.moveSelected(a,d)}else{if(c=="up"&&(38!=a&&40!=a)){this.searchKeyword(d.value)}}if(a==13){this.hideList(b,false)}},searchKeyword:function(b){var d=b;var e=this.ID("_qauto_");if(d.replace(/\s*/gi,"")==""){this.ID("auto1").style.display="none";return false}if(QKCACHEHEAD.indexOf((d+";"))==-1||(QKCACHEHEAD.indexOf((d+";"))==-1&&/^[a-zA-Z]+$/gi.test(d))&&d.length==1){QKMOVEPOS=-1;var c=document.getElementsByTagName("head");if(c.length==0){return""}if(e){c[0].removeChild(e)}var a=document.createElement("SCRIPT");a.src="http://www.myliving.cn/getautocomplete.php?t=0&q="+(d)+"&mt="+(new Date()).getTime();a.charset="gb2312";a.id="_qauto_";c[0].appendChild(a);QKCACHEHEAD+=d+";"}else{this.showAuto(d)}},moveSelected:function(a,g){if(this.ID("auto1").style.display=="none"){return}var d=false;var c=this.ID("auto");var h=this.TAG(c,"A");if(h.length>0){if(QKMOVEPOS==-1){QKLASTTEXT=g.value;d=true}if(QKMOVEPOS>=0&&QKMOVEPOS=h.length){QKMOVEPOS=-1}if(d&&38==a){QKMOVEPOS=h.length}if(40==a){QKMOVEPOS++}if(38==a){QKMOVEPOS--}if(QKMOVEPOS==-2){QKMOVEPOS=h.length-1}if(QKMOVEPOS<0||QKMOVEPOS>=h.length){this.setQValue(QKLASTTEXT,-1,false)}try{if(QKMOVEPOS>=0&&QKMOVEPOS1){this.setQValue(h[QKMOVEPOS].childNodes[0].innerHTML,b,false)}else{this.setQValue(h[QKMOVEPOS].innerHTML,b,false)}}}}catch(f){window.alert(f.message)}}},convertWord:function(c){if(c.value.replace(/\s*/gi,"")==""){return false}try{var a=QKTMPDATA[c.value][0].split(this.Char_A)[0];if(a.length==1){c.value=a[0];return false}else{if(a.length>1&&(QKMOVEPOS>=0&&QKMOVEPOS0){QKTMPDATA[a.k]=a.d}this.showAuto(a.k)},showAuto:function(f){var b=QKTMPDATA[f]||[];var g=[];try{for(var d=0,c=b.length;d0){if(this.ID("auto1").style.display=="none"){this.ID("auto1").style.display=""}if(this.ID("bgiframe")){this.ID("bgiframe").style.height=this.ID("auto1").clientHeight}}else{this.ID("auto1").style.display="none"}},setQValue:function(c,b,a){if(typeof b=="undefined"){b=0}if(QKQUERYOBJ==null){return}if(QKFUNC){QKFUNC(c,b)}QKQUERYOBJ.value=c;if(typeof a=="undefined"||a){this.ID("auto1").style.display="none"}},hideList:function(d,b){var a=d||window.event;var c=a.srcElement||a.target;if(typeof b=="undefined"){b=true}if((QKQUERYOBJ!=c&&!this.checkNotHide(c))||!b){this.ID("auto1").style.display="none"}},checkNotHide:function(c){if(QKNOTHIDEOBJ.length==0){return false}for(var b=0,a=QKNOTHIDEOBJ.length;b'+a[0]+"";this.pushExtData(a[0]);return b},isExists:function(d){var c=false;for(var b=0,a=QKEXTDATA.length;b