/* ISO to UTF8*/
function iso2utf8(string) {	
	var string = string.replace(/\r\n/g,"\n");
	var utftext = "";
	for (var n = 0; n < string.length; n++) {
		var c = string.charCodeAt(n);
		if (c < 128) {
			utftext += String.fromCharCode(c);
		} else if((c > 127) && (c < 2048)) {
			utftext += String.fromCharCode((c >> 6) | 192);
			utftext += String.fromCharCode((c & 63) | 128);
		} else {
			utftext += String.fromCharCode((c >> 12) | 224);
			utftext += String.fromCharCode(((c >> 6) & 63) | 128);
			utftext += String.fromCharCode((c & 63) | 128);
		}
	}
	return utftext;
}

/* HowStuffWorks*/
function buscador(){
	if (document.getElementById("campoBusca").value!=""){
		document.getElementById('campoutf8').value = iso2utf8(document.getElementById('campoBusca').value);	
		document.busca.campoutf8.name="terms";
		return true;
	} else {
		alert("Digite uma palavra");
		document.busca.texto.focus();
		return false;
	}
}
