function place_results() {
	if(xmlhttp.readyState == 4 && xmlhttp.status == 200) {
		if(xmlhttp.responseText != null) {
			var r=document.getElementById('results');
			// r.replaceChild(rt, r.firstChild);
			r.innerHTML=xmlhttp.responseText;
		}
		xmlhttp=null;
	}
}

var xmlhttp = null;

function search_keyup(inp) {
	var form=inp.form;

	if(form.elements.searchfor.value.length < 2) return;
	try {
		// Firefox, Opera 8.0+, Safari
		xmlhttp = new XMLHttpRequest();
	} catch(e) {
		// IE
		try {
			xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
		} catch(e) {
			xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		}
	}
	if(xmlhttp == null) {
		// Browser does not support this
		return false;
	}
	xmlhttp.onreadystatechange=place_results;

	// There is no easy way that I know of to retrieve the active radio
	// button value within a set, so I've got to do it manually.
	inputs=form.getElementsByTagName("input");
	searchby=false;
	for(i=0; i<inputs.length; i++) {
		if((inputs[i].type == "radio") && (inputs[i].name == "by")
				&& inputs[i].checked) {
			searchby=inputs[i].value;
			break;
		}
	}
	if(searchby === false) return false;
	var url=form.action+"?by="+searchby+"&searchfor="+form.elements.searchfor.value+"&mode=inline";
	xmlhttp.open("GET", url, true);
	xmlhttp.setRequestHeader("Cookie",document.cookie);
	xmlhttp.setRequestHeader("Cookie",document.cookie);
	xmlhttp.send(null);
}
