function filterlist(a){this.selectobj=a;this.flags="i";this.match_text=true;this.match_value=false;this.show_debug=false;this.init=function(){if(!this.selectobj){return this.debug("selectobj not defined")}if(!this.selectobj.options){return this.debug("selectobj.options not defined")}this.optionscopy=new Array();if(this.selectobj&&this.selectobj.options){for(var b=0;b<this.selectobj.options.length;b++){this.optionscopy[b]=new Option();this.optionscopy[b].text=a.options[b].text;if(a.options[b].value){this.optionscopy[b].value=a.options[b].value}else{this.optionscopy[b].value=a.options[b].text}}}};this.reset=function(){this.set("")};this.set=function(g){var b=0,c=0,f,h;if(!this.selectobj){return this.debug("selectobj not defined")}if(!this.selectobj.options){return this.debug("selectobj.options not defined")}this.selectobj.options.length=0;try{f=new RegExp(g,this.flags)}catch(h){if(typeof this.hook=="function"){this.hook()}return}for(b=0;b<this.optionscopy.length;b++){var d=this.optionscopy[b];if((this.match_text&&f.test(d.text))||(this.match_value&&f.test(d.value))){this.selectobj.options[c++]=new Option(d.text,d.value,false)}}if(typeof this.hook=="function"){this.hook()}};this.set_ignore_case=function(b){if(b){this.flags="i"}else{this.flags=""}};this.debug=function(b){if(this.show_debug){alert("FilterList: "+b)}};this.init()};