var a, input;
var dictUrl = 'http://dictionary.reference.com/browse/';

function showInputField() {
	var form = document.getElementById('preferences');
	var p = form.getElementsByTagName('p')[0];
	input = document.createElement('input');
	input.type = 'text';
	a = p.getElementsByTagName('a')[0];
	p.removeChild(a);
	p.appendChild(input);
	var spaces = document.createTextNode('   ');
	p.appendChild(spaces);
	p.appendChild(a);
	addEvent(a, 'click', setUrl, false);
}
function setUrl(){
	a.href = dictUrl + input.value;
}
window.onload=showInputField;

