function submitform() {
	if ((document.myform.searchtype[1].checked == true) || (document.myform.searchtype[2].checked == true)) {
		document.myform.action = 'http://search.cpmc.columbia.edu/search';
		document.myform.q.value = document.myform.searchbox.value;
					
		if (document.myform.searchtype[1].checked == true) {
		document.myform.site.value = "sph";
		document.myform.proxystylesheet.value = "sph";
		} else {
			document.myform.proxystylesheet.value = "my_collection";
			document.myform.site.value = "my_collection";
		}
	
		document.myform.method = "GET";
		document.myform.client.value = "my_collection";
		document.myform.searchtype.disabled = true;
		document.myform.searchbox.disabled = true;
		document.myform.fullname.disabled = true;
	
	} else if ((document.myform.searchtype[0].checked == true) || (document.myform.searchtype[3].checked == true)) {
		document.myform.action = 'http://www.columbia.edu/cgi-bin/lookup.pl';
		document.myform.fullname.value = document.myform.searchbox.value;
		if (document.myform.searchtype[0].checked == true) {
		document.myform.type.value = "lookup";	
		} else {
		document.myform.type.value = "web";
		}
	}
	
	document.myform.submit();
	return true;
}
			
function checkEnter(e){ //e is event object passed from function invocation
	var characterCode //literal character code will be stored in this variable
	
	if(e && e.which){ //if which property of event object is supported (NN4)
		e = e
		characterCode = e.which //character code is contained in NN4's which property
	} else {
		e = event
		characterCode = e.keyCode //character code is contained in IE's keyCode property
	}
	
	if(characterCode == 13)	{ //if generated character code is equal to ascii 13 (if enter key)
		submitform();
		//document.forms[0].submit() //submit the form
		return false 
	} else {
		return true 
	}
}
