function Picker(url, width, height) { this.url = url; this.width = width ? width : 800; this.height = height ? height : 600; this.form = ''; this.input = ''; this.open = function(f, fe) { this.form = f; this.input = fe; remote = window.open(this.url,'Picker','width='+this.width+',height='+this.height+',scrollbars'); if (remote.opener == null) { remote.opener = window; } remote.opener.name = 'MainWindow'; remote.opener.picker = this; remote.moveTo((screen.width-this.width)/2, (screen.height-this.height)/2); } this.send = function(val) { obj = eval('document.'+this.form+'.'+this.input); obj.value = val; remote.close(); } }