function changeCategory(locale){
	var box = document.getElementById("categoryBox");
	document.location="/xhtml/"+ locale +"/faq/?cat="+ box.value;
}

function search(locale){
	var box = document.getElementById("faqSearchBox");
	var combo = document.getElementById("inCategoryBox");
	box = escape(box.value);
	box = replaceAll(box, "+", "%2B");
	box = replaceAll(box, "/", "%2F");
	var loc = "/xhtml/"+ locale +"/faq/search/?search="+ box;
	if(combo.checked){
		loc += "&cat="+ combo.value;
	}
	document.location=loc;
	return false;
}

function refreshSearch(){
	var box = document.getElementById("faqSearchBox");
	var combo = document.getElementById("inCategoryBox");
	var comboValue = document.getElementById("inCategoryBoxValue");
	box = escape(box.value);
	box = replaceAll(box, "+", "%2B");
	box = replaceAll(box, "/", "%2F");
	var loc = "./?search="+ box;
	if(combo.checked){
		loc += "&cat="+ comboValue.value;
	}
	document.location=loc;
	return false;
}

function replaceAll(str, replace, replacewith){
	var result = "";
	for (var i = 0; i <  str.length; i++) {
		if (str.charAt(i) == replace) result += replacewith;
		else result += str.charAt(i);
	}
	return result;
}