document.getElementById('domain').focus();

var form = document.getElementsByTagName('form')[0];
form.onsubmit = function() {
 var domain = document.getElementById('domain').value;
 window.location = this.action+'/'+encodeURIComponent(domain);
 return false;
}
