function SelectTip(oInput,oSelect)
{
this.Input = oInput;
this.Select = oSelect;
this.dsy = new Array();
this.initializeObject();
}
SelectTip.prototype.initializeObject = function()
{
var p = this.Input;
var s = this.Select;
for(var i=0;i< s.length;i++)
this.dsy[this.dsy.length] = [s[i].text,s[i].value];
var a = this.dsy;
p.onkeyup = function(){
s.length = 0;
for(var i = 0;i< a.length;i++)
if (a[i][0].indexOf(p.value) == 0)
s.options[s.length] = new Option(a[i][0],a[i][1]);
}
}
SelectTip.prototype.reset = function()
{
with(this.Select)
{
length = 0;
for(i=0;i< this.dsy.length;i++)
options[length] = new Option(this.dsy[i][0],this.dsy[i][1]);
}
this.Input.value = "";
this.Input.focus();
}
var test = new SelectTip(document.frm.elements["txt"],document.frm.elements["demo"]);
</SCRIPT>