function getCategorySelect(name){
	var selection = document.getElementById(name);
	
	var foodSelection = document.getElementById('ruokalaji');
	var fishSelection = document.getElementById('kalalaji');

	var href = document.location.href;
	var baseUrl = href.substr(0,href.search(/\?/));
	var had_parameter = false;
	var had_second_param = false;
	
		
	switch(name){
		case 'ruokalaji':
			
			if(fishSelection.value == '' && foodSelection.value == ''){
				document.location.href = baseUrl;
				break;
			}
			if(foodSelection.value == '' && fishSelection.value != ''){
				document.location.href = baseUrl+'?fishcategory='+fishSelection.value;
				break;
			}
			if(fishSelection.value != '')
				document.location.href = baseUrl+'?foodcategory='+foodSelection.value+'&fishcategory='+fishSelection.value;
			else
				document.location.href = baseUrl+'?foodcategory='+foodSelection.value;
					
		break;
		case 'kalalaji':
			
			// if both are in select-state
			if(fishSelection.value == '' && foodSelection.value == ''){
				document.location.href = baseUrl;
				break;
			}
			if(fishSelection.value == '' && foodSelection.value != ''){
				document.location.href = baseUrl+'?foodcategory='+foodSelection.value;
				break;
			}
			if(foodSelection.value != '')
				document.location.href = baseUrl+'?fishcategory='+fishSelection.value+'&foodcategory='+foodSelection.value;
			else
				document.location.href = baseUrl+'?fishcategory='+fishSelection.value;
			
		break;
	}
	
}