/* SCRIPT PARA ABRIR LINKS EM NOVAS JANELAS */
/*       SUBSTITUI O TARGET="_BLANK"        */

function linksExternos() {
		if (!document.getElementsByTagName) return;
		var anchors = document.getElementsByTagName("a");
		for (var i=0; i<anchors.length; i++) {
				var anchor = anchors[i];
				anchor.tabindex = i;
				if (anchor.getAttribute("href") && 
anchor.getAttribute("rel") == "external")
						anchor.target = "_blank";
		}
}

window.onload = linksExternos;

/* FORM MAIL - CONTATO */

function Checar()
 {
 if (document.MailContato.nome.value == '')
 	{
 	alert('Você deixou o campo "Nome" em branco, por favor, preencha-o para que possamos contatá-lo.');
 	document.MailContato.nome.focus();
 	return false;
 	}
 else if (document.MailContato.email.value == '')
 	{
 	alert('Você deve preencher o campo "Email" para que possamos contatá-lo.');
 	document.MailContato.email.focus();
 	return false;
 	}
 else if (document.MailContato.mensagem.value == '')
 	{
 	alert('Preencha o campo com seus comentários.');
 	document.MailContato.mensagem.focus();
 	return false;
 	}

 else if (window.RegExp) {
 
			field = document.MailContato.email
			str = field.value
			validmail = false;

			reg1str = "(@.*@)|(\\.\\.)|(@\\.)|(\\.@)|(^\\.)";
			reg2str = "^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$";
			reg1 = new RegExp(reg1str);
			reg2 = new RegExp(reg2str); 

			if (!reg1.test(str) && reg2.test(str)) {
				validmail = true;
				}
			else {
				alert('Você colocou um nome de "Email" incorreto, por favor, corrija-o.');
				field.focus();
				field.select();
				return false;
				}
			if (str.indexOf("@") >= 0) { validmail = true }
			else {
				alert('Você colocou um nome de "Email" incorreto, por favor, corrija-o.')
				field.focus();
				field.select();
				return false;
				}
			}
if (validmail = true) document.MailContato.submit()
	}