function Suggestions(t,p,s){var o=this;this.c=-1;this.l=null;this.t=t;this.p=p;this.s=s?s:'suggestions';this.q=null;this.t.onkeyup=function(e){o.f2(e)};this.t.onkeydown=function(e){o.f3(e)};this.t.onblur=function(){o.f4()};this.f0()}Suggestions.prototype.f0=function(){this.l=document.createElement('div');this.l.className=this.s;this.l.style.visibility='hidden';this.l.style.width=this.t.offsetWidth;document.body.appendChild(this.l);var o=this;this.l.onmousedown=this.l.onmouseup=this.l.onmouseover=function(e){var e=e||window.event,t=e.target||e.srcElement;if(e.type=='mousedown'){o.t.value=t.firstChild.nodeValue;o.f4()}else if(e.type=='mouseover')o.f5(t);else o.t.focus()}};Suggestions.prototype.f1=function(a){if(a.length>0)this.f8(a);else this.f4()};Suggestions.prototype.f2=function(e){var e=e||window.event,i=e.keyCode,o=this;if(i==8||i==46)this.q=setTimeout(function(){o.p.f0(o)},20);else if(i<32||(i>=33&&i<=46)||(i>=112&&i<=123)){}else this.q=setTimeout(function(){o.p.f0(o)},20)};Suggestions.prototype.f3=function(e){var e=e||window.event;switch(e.keyCode){case 38:this.f10();break;case 40:this.f9();break;case 13:this.f4();break}};Suggestions.prototype.f4=function(){this.l.style.visibility='hidden';this.l.innerHTML=''};Suggestions.prototype.f5=function(n){for(var i=0;i<this.l.childNodes.length;i++){var o=this.l.childNodes[i];if(o==n)o.className='current';else if(o.className=='current')o.className=''}};Suggestions.prototype.f6=function(){var o=this.t,i=0;while(o.offsetParent&&o.tagName!='BODY'){i+=o.offsetLeft;o=o.offsetParent}return i};Suggestions.prototype.f7=function(){var o=this.t,i=0;while(o.offsetParent&&o.tagName!='BODY'){i+=o.offsetTop;o=o.offsetParent}return i};Suggestions.prototype.f8=function(a){var o=null;this.l.innerHTML='';for(var i=0;i<a.length;i++){o=document.createElement('div');o.appendChild(document.createTextNode(a[i]));this.l.appendChild(o)}this.l.style.left=this.f6()+'px';this.l.style.top=this.f7()+this.t.offsetHeight+'px';this.l.style.visibility='visible'};Suggestions.prototype.f9=function(){var n=this.l.childNodes;if(n.length>0){this.c=(this.c<n.length-1)?this.c+1:0;var o=n[this.c];this.f5(o);this.t.value=o.firstChild.nodeValue}};Suggestions.prototype.f10=function(){var n=this.l.childNodes;if(n.length>0){this.c=(this.c>0)?this.c-1:n.length-1;var o=n[this.c];this.f5(o);this.t.value=o.firstChild.nodeValue}};function Request(uri){this.http=this.f1();this.uri=uri}Request.prototype.f0=function(o){if(!this.http)return;o.c=-1;if(o.t.value.length<1){var a=new Array();o.f1(a);return}var r=this.http,s=this.uri+encodeURIComponent(o.t.value);if(r.readyState!=0)r.abort();r.open('get',s,true);r.onreadystatechange=function(){if(r.readyState==4){var a=eval(r.responseText);if(typeof a=='object')o.f1(a)}};r.send(null)};Request.prototype.f1=function(){try{return new XMLHttpRequest}catch(e){}try{return new ActiveXObject('Msxml2.XMLHttp.4.0')}catch(e){}try{return new ActiveXObject('Msxml2.XMLHttp.3.0')}catch(e){}try{return new ActiveXObject('Msxml2.XMLHttp.2.0')}catch(e){}try{return new ActiveXObject('Msxml2.XMLHttp')}catch(e){}try{return new ActiveXObject('Microsoft.XMLHTTP')}catch(e){}try{return window.createRequest()}catch(e){}return false};
