(function(){var b=window.navigator.userAgent.toLowerCase(),a=/msie/.test(b),h=function(i){return document.createElement(i)},f=function(i){return i.replace(/^\s+/,"")};function g(i){return escape(i).replace(/(%[8-9,A-F][0-9,A-F]|(%u[0-9,A-F]{4}))/g,function(j){return unescape(j)}).replace(/\+/g,"%2B").replace(/\//g,"%2F")}function e(j){var i=document.getElementsByTagName("head")[0];var l=document.createElement("style");l.setAttribute("type","text/css");if(window.ActiveXObject){i.appendChild(l);l.styleSheet.cssText=j}else{try{l.appendChild(document.createTextNode(j))}catch(k){l.cssText=j}i.appendChild(l)}}e('.smart_pop{display:block;border:1px solid #6699cc;position:absolute;background-color:#fff;z-index:50;}#smart_arrow {cursor: pointer;position: absolute;width: 12x;padding: 0px 12px 0px 0px}#smart_arrow .hide {position: absolute;padding: 0px 12px 0px 0px;width:12x;background:url("http://cache.soso.com/img/smart01.gif") no-repeat center;}#smart_arrow .show {position: absolute;padding: 0px 12px 0px 0px;width:12x;background:url("http://cache.soso.com/img/smart02.gif") no-repeat center;}.smart_pop div.mouseover{background:#d8ecff;height:22px;line-height:22px;}.smart_pop div.mouseout{background:#ffffff;height:22px;line-height:22px;}.smart_pop div.right1{text-align:right;color:#666;margin:0px 3px 0px 0px;height:22px;line-height:22px;}.smart_pop div.font_blue {font-size:14px;color:#004bca;}.smart_pop div.font_black {color:#000;}.smart_close {color:#004bca;text-decoration:underline;background:#edf7ff;height:22px;line-height:22px;text-align:right;cursor:pointer;}.smart_close_link {text-align:right;height:22px;line-height:22px;margin:0px 3px 0px 0px;}.smart_pop span.pic{padding: 0px 12px 0px 0px;width:12px;height:14pt;background:url("http://cache.soso.com/img/sb0.gif") no-repeat center;}.smart_pop div.left1{padding:0px 0px 0px 5px;float:left;height:22px;line-height:22px;}');function d(o){var n=this,z={},G=false,I=-1,l=[],w=[],v=null,s=1,r=false,u=null,K=null,A=o.target,j="",J=A.value,p=null,D=function(){for(var L in l){l[L].className="mouseout"}},H=function(L){j=A.value=L},x=function(){i();G=false;if(o.callback){var L=w[I].word,N=w[I].hint;if(typeof o.callback=="function"){o.callback.call({},L,N)}else{eval(o.callback+'("'+L+'",'+N+')')}k()}else{var M="";if(o.tonoutf8){M=o.to+g(w[I].word)}else{M=o.to+encodeURIComponent(w[I].word)+"&ie=utf-8"}if(o.blank){window.open(M)}else{window.location=M}}},k=function(L){if(!L){I=-1;l=[];w=[]}if(u&&u!=null&&u.parentNode){u.style.display="none"}},F=function(){u=h("div");u.className="smart_pop";if(o.reverse){u.style.borderBottomWidth="0px";u.style.borderTop="1px solid #6699cc"}else{u.style.borderTopWidth="0px"}K=h("div");K.className="smart_close";K.innerHTML='<div class="left1"></div><div class="smart_close_link">'+decodeURIComponent("%E5%85%B3%E9%97%AD")+"</div>";if(o.reverse&&o.showclose){u.appendChild(K)}for(var N in w){var O=h("div");O.seq=parseInt(N);(function(){var P=O;n.Event.add(O,"mouseover",function(){D();P.className="mouseover";I=P.seq})})();(function(){n.Event.add(O,"mouseout",function(){D()})})();(function(){n.Event.add(O,"mousedown",function(){A.value=w[I].word;x()})})();var M=h("div");M.className="left1";M.innerHTML=w[N].word.replace(A.value,"<strong>"+A.value+"</strong>");O.appendChild(M);var L=h("div");L.className="right1";if(!o.nodesc){if(w[N].type!="0"){M.className+=" font_blue";if(o.zdqpic){tipPic=h("span");tipPic.className="pic";M.appendChild(tipPic);if(a){tipPic.style.display="inline-block"}}L.appendChild(document.createTextNode(w[N].hint))}else{L.appendChild(document.createTextNode(o.desc.replace("__num__",w[N].hint)))}}O.appendChild(L);u.appendChild(O);l.push(O)}if(!o.reverse&&o.showclose){u.appendChild(K)}return u},y=function(L){if(l.length==0){return}if(L.keyCode!=13){bCloseSmart=false}if(L.keyCode==13&&I!=-1){n.Event.stop(L);x()}else{if(L.keyCode==38){n.Event.stop(L);if(u.style.display=="none"){u.style.display="block";if(I>=0){l[I].className="mouseover"}}else{D();--I;if(I==-1){H(J)}else{I=(I<0)?(l.length-1):I;l[I].className="mouseover";H(w[I].word)}}}else{if(L.keyCode==40){n.Event.stop(L);if(u.style.display=="none"){u.style.display="block";if(I>=0){l[I].className="mouseover"}}else{D();++I;if(I==l.length){H(J)}else{I=(I>l.length-1)?0:I;l[I].className="mouseover";H(w[I].word)}}}else{if(L.keyCode==27){n.Event.stop(L);D();k(1)}}}}},E=function(M){z={top:n.Locator.getY(A),left:n.Locator.getX(A),width:n.Locator.getW(A),height:n.Locator.getH(A)};locator=n.Locator;locator.setX(M,z.left);locator.setY(M,z.top+z.height);locator.setW(M,z.width-2);if(a){var L=parseFloat(navigator.userAgent.toUpperCase().match("MSIE (\\d+\\.\\d+);")[1]);if(document.compatMode=="BackCompat"||L<6){locator.setW(M,z.width)}}if(typeof bCloseSmart!="undefined"&&bCloseSmart){return}if(o.reverse){M.style.visibility="hidden";A.parentNode.appendChild(M);if(a){locator.setX(M,z.left+1)}locator.setY(M,z.top-M.offsetHeight);M.style.visibility="visible"}else{A.parentNode.appendChild(M)}n.Event.add(K,"click",function(){k()})},C=function(){G=false;var M=f(A.value);if(M.length==0){return;k()}var L="";if(o.fromnoutf8){L=o.from+g(f(A.value))}else{L=o.from+encodeURIComponent(f(A.value))}n.SimpleAjax(L,1000,function(N){G=true;k();w=m(N);if(w){E(F(w))}})},m=function(O){if(f(O)==""){return false}O=O.split("\n");var M=[];for(var L=0;L<O.length;L++){O[L]=O[L].split("\t");M.push({word:O[L][1],hint:O[L][0],type:O[L][2]})}if(o.zdqfirst){var N=0;for(var L=0;L<M.length;L++){if(M[L].type!=0){M.splice(N++,0,M.splice(L,1)[0])}}}return M},q=function(){i();v=setInterval(function(){t()},300)},i=function(){if(v!=null){clearInterval(v);v=null}},t=function(){var L=f(A.value);if(L.length==0){k()}if(j!=L&&!G){G=true}if(!G){return}if(j==L){if(s){s=0;C()}}else{s=1;j=L}},B=function(){n.Event.add(A,"focus",function(){r=false;q();G=true});n.Event.add(A,"blur",function(){i();G=false;k(1)});n.Event.add(A,"keydown",function(L){G=true;y(L);q()});n.Event.add(A,"keyup",function(L){if(L.keyCode!=38&&L.keyCode!=40){J=A.value;if(!r){r=true;j=""}}});n.Event.add(window,"resize",function(){G&&C()})};this.Event.add(window,"load",function(){B()})}d.prototype.SimpleAjax=function(j,m,n){var i=this;if(this.xhr){try{this.xhr.abort()}catch(l){}this.xhr=null}this.xhr=window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest();this.xhr.open("GET",j,true);var k=false;setTimeout(function(){k=true},m);this.xhr.onreadystatechange=function(){switch(i.xhr.readyState){case 1:break;case 2:break;case 3:break;case 4:if(i.xhr.status==200&&!k){n(i.xhr.responseText)}i.xhr=null;break;default:}};this.xhr.send(null)};d.prototype.Locator={getX:function(i){return i.offsetParent?i.offsetLeft+this.getX(i.offsetParent):i.offsetLeft},getY:function(i){return i.offsetParent?i.offsetTop+this.getY(i.offsetParent):i.offsetTop},getW:function(i){return i.offsetWidth},getH:function(i){return i.offsetHeight},setX:function(i,j){i.style.left=j+"px"},setY:function(i,j){i.style.top=j+"px"},setW:function(j,i){j.style.width=i+"px"},setH:function(j,i){j.style.height=i+"px"}};d.prototype.Event={add:function(i,k,j){if(i.addEventListener){i.addEventListener(k,j,false)}else{i.attachEvent("on"+k,j)}},remove:function(i,k,j){if(i.removeEventListener){i.removeEventListener(k,j,false)}else{i.detachEvent("on"+k,j)}},stop:function(i){if(i.preventDefault){i.preventDefault();i.stopPropagation()}else{i.cancelBubble=true;i.returnValue=false}}};function c(s){var l="smart_input",r=l+"-",n=r.length,I=document.getElementsByTagName("input");for(var G=0;G<I.length;++G){var w=I[G];if(w.type!="text"){continue}var v=w.id,y=w.className.split(/[\s]+/),J=false,B={},E=0;for(;E<y.length;++E){var K=y[E].toLowerCase();if(K.indexOf(l)==0){w.setAttribute("autocomplete","off");var x=y[E].substr(n).split("-");for(var D=0;D<x.length;++D){var p=x[D];if(p.length==0){continue}var t=p.indexOf("_");if(t==-1){B[p]=true}else{var A=p.substr(0,t),o=p.substr(t+1);if(!B[A]){B[A]=o}}}J=true;break}}if(!J||B.binded||B.noauto){if(B.noauto){y[E]=y[E].replace("-noauto","");w.className=y.join(" ")}continue}y[E]+="-binded";w.className=y.join(" ");var m=B;if(null!==s&&typeof s=="object"){if(s[0]){var u;for(u in s[0]){m[u]=s[0][u]}}if(v&&s[v]){for(u in s[v]){m[u]=s[v][u]}}}if(!m.desc){m.desc="__num__"+decodeURIComponent("%E7%BB%93%E6%9E%9C")}if(!m.from){var F=location.href.match(/(.*\/\/[^\/]*)/gi)[0];m.from=F+"/smart.q?"+(m.type?"type="+m.type+"&":"")+"w="}var z=function(k,j){var i=k;m.callback=function(L,O){var M=i.cloneNode(true),N=i.parentNode;M.value=L;N.replaceChild(M,i);C.submit()}};if(!m.callback&&!m.to){if(m.formid){var H=document.getElementById(m.formid);if(null!=H&&typeof H.submit=="function"){z(w,H)}}else{var C=w;while(1){var C=C.parentNode;var q=C.tagName.toUpperCase();if(q=="FORM"){z(w,C);break}else{if(q=="BODY"||typeof q=="undefined"){return false}}}}}m.target=w;new d(m)}}if(window.smartbox_config){c(window.smartbox_config)}else{c()}window.Smartbox=c})();
