// JavaScript Document
function resizeMe(obj){
	docHeight = stats.document.body.scrollHeight
	obj.style.height = docHeight + 0 + 'px'
}
function abre_site(width, height, nome,barra) {
	var top; var left; 
	if (barra == "") {
		barra = 0;
	}
	top = ( (screen.height/2) - (height/2) )
	left = ( (screen.width/2) - (width/2) )
	window.open(nome, "","toolbar=0,location=0,directories=0,status=0,menubar=0,resizable=0,scrollbars=0,width="+width+",height="+height+",left="+left+",top="+top);
}
function voltar(){
	history.go(-1);	
}
	function valida_dados(){
		if(document.form_news.nome.value=="Nome : "){
			alert("Nome não informado!");
			document.form_news.nome.focus();
			return false;
		}
		if(document.form_news.empresa.value=="Empresa : "){
			alert("Empresa não informado!");
			document.form_news.empresa.focus();
			return false;
		}
		if(document.form_news.e_mail.value == "E-mail : "){
			alert("E-mail não informado!");
			document.form_news.e_mail.focus();
			return false;
		} else {
			prim = document.form_news.e_mail.value.indexOf("@")
			if(prim < 2) {
				alert("O e-mail informado parece não estar correto.");
				document.form_news.e_mail.focus();
				document.form_news.e_mail.select();
				return false;
			}
			if(document.form_news.e_mail.value.indexOf("@",prim + 1) != -1) {
				alert("O e-mail informado parece não estar correto.");
				document.form_news.e_mail.focus();
				document.form_news.e_mail.select();
				return false;
			}
			if(document.form_news.e_mail.value.indexOf(".") < 1) {
				alert("O e-mail informado parece não estar correto.");
				document.form_news.e_mail.focus();
				document.form_news.e_mail.select();
				return false;
			}
			if(document.form_news.e_mail.value.indexOf(" ") != -1) {
				alert("O e-mail informado parece não estar correto.");
				document.form_news.e_mail.focus();
				document.form_news.e_mail.select();
				return false;
			}
			if(document.form_news.e_mail.value.indexOf("zipmeil.com") > 0) {
				alert("O e-mail informado parece não estar correto.");
				document.form_news.e_mail.focus();
				document.form_news.e_mail.select();
				return false;
			}
			if(document.form_news.e_mail.value.indexOf("hotmeil.com") > 0) {
				alert("O e-mail informado parece não estar correto.");
				document.form_news.e_mail.focus();
				document.form_news.e_mail.select();
				return false;
			}
			if(document.form_news.e_mail.value.indexOf(".@") > 0) {
				alert("O e-mail informado parece não estar correto.");
				document.form_news.e_mail.focus();
				document.form_news.e_mail.select();
				return false;
			}
			if(document.form_news.e_mail.value.indexOf("@.") > 0) {
				alert("O e-mail informado parece não estar correto.");
				document.form_news.e_mail.focus();
				document.form_news.e_mail.select();
				return false;
			}
			if(document.form_news.e_mail.value.indexOf(".com.br.") > 0) {
				alert("O e-mail informado parece não estar correto.");
				document.form_news.e_mail.focus();
				document.form_news.e_mail.select();
				return false;
			}
			if(document.form_news.e_mail.value.indexOf("/") > 0) {
				alert("O e-mail informado parece não estar correto.");
				document.form_news.e_mail.focus();
				document.form_news.e_mail.select();
				return false;
			}
			if(document.form_news.e_mail.value.indexOf("[") > 0) {
				alert("O e-mail informado parece não estar correto.");
				document.form_news.e_mail.focus();
				document.form_news.e_mail.select();
				return false;
			}
			if(document.form_news.e_mail.value.indexOf("]") > 0) {
				alert("O e-mail informado parece não estar correto.");
				document.form_news.e_mail.focus();
				document.form_news.e_mail.select();
				return false;
			}
			if(document.form_news.e_mail.value.indexOf("(") > 0) {
				alert("O e-mail informado parece não estar correto.");
				document.form_news.e_mail.focus();
				document.form_news.e_mail.select();
				return false;
			}
			if(document.form_news.e_mail.value.indexOf(")") > 0) {
				alert("O e-mail informado parece não estar correto.");
				document.form_news.e_mail.focus();
				document.form_news.e_mail.select();
				return false;
			}
			if(document.form_news.e_mail.value.indexOf("..") > 0) {
				alert("O e-mail informado parece não estar correto.");
				document.form_news.e_mail.focus();
				document.form_news.e_mail.select();
				return false;
			}
		}
		submit();
	}
function Cadastra(){
	var nome = document.form_news.nome.value;
	var e_mail = document.form_news.e_mail.value;
	var empresa = document.form_news.empresa.value;
	var marcado = -1;
	for (i=0; i<form_news.cad.length; i++) {
		if (form_news.cad[i].checked) {
			marcado = i
		}
	}
	if (marcado==0){
		var opcao = "Cadastrar";
	} else if (marcado==1){
		var opcao = "Descadastrar";
	}
	var url = "news.php?nome="+nome+"&empresa="+empresa+"&email="+e_mail+"&opcao="+opcao;
	myIframe.location = url;
	document.form_news.nome.value = "Nome : ";
	document.form_news.e_mail.value = "E-mail : ";
	document.form_news.empresa.value = "Empresa : ";
	document.form_news.nome.focus;
}
function checa(nform) {
	marcado = -1
	for (i=0; i<enquete.votacao.length; i++) {
		if (enquete.votacao[i].checked) {
			marcado = i
			resposta = enquete.votacao[i].value
		}
	}
	if (marcado == -1) {
		alert("Selecione uma resposta.");
		enquete.votacao[0].focus();
	} else {
		pergunta = document.enquete.idpergunta.value;
		abre_site(250,300,"votar.php?voto="+resposta+"&idpergunta="+pergunta);
	} 
}
function quiz() {
	marcado = -1
	for (i=0; i<form_quiz.resposta.length; i++) {
		if (form_quiz.resposta[i].checked) {
			marcado = i
		}
	}
	if (marcado == -1) {
		alert("Selecione uma resposta.");
	} else {
		form_quiz.submit();
	} 
}
var url_site="http://www.souzalimacorretora.com.br/" 
var titulo_site="Souza Lima Corretora" 
function adiciona_bookmark(){if (document.all)window.external.AddFavorite(url_site,titulo_site)} 
function click() {
	if (event.button==2||event.button==3) {
		 oncontextmenu='return false';
	}
}
document.onmousedown=click
document.oncontextmenu = new Function("return false;")