function MudaTipoPesq(strTipoPesq, strTextoLabel, bolFoco) {
  window.document.getElementById('lblstr_DSTextoPesquisa').innerHTML = strTextoLabel;
  window.document.getElementById("str_TipoPesq").value = strTipoPesq;
//  window.document.getElementById('str_DSTextoPesquisa').focus();
	if (bolFoco) {
	  window.document.getElementById("frmPesqTel").str_DSTextoPesquisa.focus();
	}
	else {
	  bname=navigator.appName;
		if (bname.indexOf("Microsoft")==-1) {
		  window.document.getElementById("frmPesqTel").str_DSTextoPesquisa.focus();
		}
 	}
}

function SetaFoco(Controle) {
  Controle.className = "txtfieldfoco";
}

function SetaSaidaFoco(Controle) {
  Controle.className = "txtfieldsemfoco";
}
function SetaFocoDrop(Controle) {
  Controle.className = "txtdropfoco";
}

function ValidaPesquisa() {
	var aPrep = new Array(" DE ",
	                      " DO ",
												" DOS ",
												" DA ",
												" DAS ",
												" E ",
												".");

	var str_DSTextoPesquisa   = window.document.getElementById("str_DSTextoPesquisa").value;
	var str_TipoPesq          = window.document.getElementById("str_TipoPesq").value;

 	if (str_TipoPesq == 'NOME') {
		if (str_DSTextoPesquisa.length < 3) {
	    alert('É necessário informar pelo menos três letras para realizar a pesquisa!');
	    return false;
		}
	}

  str_DSTextoPesquisa = str_DSTextoPesquisa.toUpperCase();
	for (var i = 0;i<aPrep.length;i++) {
		str_DSTextoPesquisa = str_DSTextoPesquisa.replace(aPrep[i],' ');
	}

 	window.document.getElementById("str_DSTextoPesquisa").value = str_DSTextoPesquisa;
}

