function eSearchObj() { this.url = ''; this.value = ''; } eSearchObj.prototype.onClick = function(url) { this.url = url; window.location = this.url+escape(this.value)+'/'; return false; } eSearchObj.prototype.onBlur = function(o, title) { this.value = o.value; if(o.value == '') { o.value = title; } return false; } eSearchObj.prototype.onFocus = function(o, title, url) { if(o.value == title) { o.value = ''; } this.input = o; this.url = url; return false; } eSearchObj.prototype.onKeyUp = function(e) { if(!e) e = window.event; if((e.charCode) && (e.keyCode==0)) { key = e.charCode } else { key = e.keyCode; } switch(key) { case 13: this.onClick(); break; } return false; } eSearch = new eSearchObj();