//Submete do formulario de acordo com o tipo de pesquisa
function enviarPesquisa()
	{	
	var base = document.getElementById("base");
	var txtPesquisaLivre = document.getElementById("txtPesquisaLivre"); //Argumento de Pesquisa
	var resultadosPagina = document.getElementById("resultadosPagina");
	var mensagemErro = document.getElementById("mensagemErro");
	var mensagemExemplo = document.getElementById("mensagemExemplo");
	var frmPeticaoInicial = document.getElementById("frmPeticaoInicial");

	//Verifica se o campo de pesquisa foi preenchido
	/*if(txtPesquisaLivre.value == "Digite aqui"){
		mensagemExemplo.innerHTML = "";
		mensagemErro.innerHTML = "Preencha o campo de pesquisa!";
		txtPesquisaLivre.focus();
		return false
	}*/
	if(txtPesquisaLivre.value == "")
		{
		//mensagemExemplo.innerHTML = "";
		//mensagemErro.innerHTML = retonarMensagemPadrao("campoVazio");
		alert("Informe o argumento de pesquisa");
		txtPesquisaLivre.focus();
		return false
		}
	
	document.getElementById("frmPeticaoInicial").acao.value="exibirResultado";
	document.getElementById("frmPeticaoInicial").action = "pesquisarPeticaoInicial.asp";
	document.getElementById("frmPeticaoInicial").submit();
	//mensagemErro.innerHTML = "";
	//mensagemExemplo.innerHTML = "";
	document.getElementById("divCarregando").innerHTML = "<img src='../util/imagem/loading.gif' width='16' height='16' align='left' alt='' border='0'>&nbsp;Aguarde...";
	return true;

	}

function TestaEnter()
	{
	if (window.event.keyCode == 13)
	{
		enviarPesquisa();
	}
	return false;
	}

function NewWindow(mypage, myname, w, h, scroll)
	{
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'
	win = window.open(mypage, myname, winprops)
	if (parseInt(navigator.appVersion) >= 4) win.window.focus();
	}

function limparFormulario() 
	{
	document.getElementById("base").value = "";
	document.getElementById("txtPesquisaLivre").value = "";
	document.getElementById("resultadosPagina").value = "";
	document.getElementById("frmPeticaoInicial").action = "pesquisarPeticaoInicial.asp";
	document.getElementById("frmPeticaoInicial").submit();
	}

