
var URL_BASE = "http://www.oab-rg.org.br/";

function abre(caminho,scrolls,widthPOP,heightPOP)  { window.open(caminho,'ambclip','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars='+scrolls+',resizable=no,copyhistory=no,width='+widthPOP+',height=' + heightPOP); }  

function home() { location.href = URL_BASE; }

function oab() { location.href = URL_BASE + "internas/oab.php"; }

function honorarios() { location.href = URL_BASE + "internas/honorarios.php"; }

function filiados() { location.href = URL_BASE + "internas/filiados.php"; }

function noticias() { location.href = URL_BASE + "sistemas/newsletter.php"; }

function links() { location.href = URL_BASE + "internas/links1.php"; }

function notas_expediente() { location.href = URL_BASE + "internas/notas_expediente.php"; }

function contato() { location.href = URL_BASE + "sistemas/contato.php"; }

function mapa() { location.href = URL_BASE + "internas/mapa.php"; }

function caa() { location.href = URL_BASE + "internas/caa.php"; }

function artigos() { location.href = URL_BASE + "internas/artigos.php"; }

function valida_contato()
{
	var nome_campos 	= ["\n* Nome","\n* E-mail","\n* Mensagem"];
	var campos 			= ["nome","email","mensagem"];
	var nao_preenchidos = "";

	for (cont=0; cont < 3; cont++)
	{
			if (document.getElementById(campos[cont]).value == "")
			{
				if (nao_preenchidos == "") primeiro_campo = cont;
				nao_preenchidos += nome_campos[cont];
			}
	}

	if (nao_preenchidos != "")
	{
		alert ("Preencha o(s) seguinte(s) campo(s):" + nao_preenchidos);
		document.getElementById(campos[primeiro_campo]).focus();
		return false;
	}
	else
	{
		if (document.getElementById('email').value.indexOf("@")==-1 || document.getElementById('email').value.indexOf(".")==-1 || document.getElementById('email').value.indexOf(" ")!=-1 || document.getElementById('email').value.length<6)
		{
			alert("Desculpe, mas o seu email não é válido.");
			document.getElementById('email').focus();
			return false;
		}
	}
	return true;

}

function ver_lista_completa()
{
	document.getElementById('form_filtro').reset();
	document.getElementById('form_filtro').submit();
}
