Can anyone tell me why the following code is not working please?
The function is called when a user clicks a button.

Code:
function goToStock(){
	if (document.getElementById("top_search").value=="used") {
		window.location.replace='http://www.mysite.co.uk/used-cars/';
	}
	else if (document.getElementById("top_search").value=="van") {
		window.location.replace='http://www.mysite.co.uk/used-vans-trucks/';
	} 
	else if (document.getElementById("top_search").value=="bike") {
		window.location.replace='http://www.mysite.co.uk/used-bikes/';
	} 
	else if (document.getElementById("top_search").value=="nearlynew") {
		window.location.replace='http://www.mysite.co.uk/nearly-new-cars/';
	} 
	else if (document.getElementById("top_search").value=="motability") {
		window.location.replace='http://www.mysite.co.uk/motability/';
	} 
}