// JavaScript Document
var ns4 = (document.layers) ? true : false;
var ie4 = (document.all && !document.getElementById) ? true : false;
var w3c = (document.getElementById) ? true : false;
var ns6 = (document.getElementById && navigator.appName == 'Netscape') ? true : false;
var ie5 = (document.all && document.getElementById) ? true : false;

function addEvent(obj, evType, fn, useCapture)
{
	if (obj.addEventListener)
	{
		obj.addEventListener(evType, fn, useCapture);
		return true;
	}
	else if (obj.attachEvent)
	{
		var r = obj.attachEvent("on"+evType, fn);
		return r;
	} 
	else 
	{
		alert("Handler could not be attached");
	}
} 

function janela(url, nome, w, h){
var winl = (screen.width - w)/2;
var wint = (screen.height - h)/2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',statusbar'
win = window.open(url, nome, winprops)
	if (parseInt(navigator.appVersion) >= 4) {win.window.focus();} 
}

function jantop(url, nome, w, h){
winprops = 'height='+h+',width='+w+',top=0,left=0'
win = window.open(url, nome, winprops)
	if (parseInt(navigator.appVersion) >= 4) {win.window.focus();} 
}

function valid(){
var nome = document.form.nome;
var senha = document.form.senha;
var email = document.form.email;
var assunto = document.form.assunto;
var mensagem = document.form.mensagem;
if(nome.value==""){
alert("Ops! Você não digitou seu nome.");
nome.focus();
return false;
	}
if(senha.value==""){
alert("Ops! Você não digitou uma senha.");
senha.focus();
return false;
	}
var objRegExp  = /^[A-Za-z]([\w\.]*)@([A-Za-z0-9\.]*)\.(([A-Za-z]{3}\.[A-Za-z]{2}$)|([A-Za-z]{3}$)|([a-z]{2}$))/i ;
  if(objRegExp.test(email.value)==false){
     alert ("O campo e-mail deve conter um endereço eletrônico válido!");
     email.focus();
     return false;
  }
	if(assunto.value==""){
alert("Campo assunto é obrigatório");
assunto.focus();
return false
	}
if(mensagem.value==""){
alert("Campo Mensagem é obrigatório");
mensagem.focus();
return false;
	}
return true;
}

function data(){

hoje = new Date()
dia = hoje.getDate()
dias = hoje.getDay()
mes = hoje.getMonth()
ano = hoje.getYear()

if (dia < 10)
dia = "0" + dia

if (ano < 2000)
ano = 1900 + ano

function NArray (n) 
{
this.length = n
}

Smn = new NArray(7)

Smn[0] = "Domingo"
Smn[1] = "Segunda"
Smn[2] = "Ter&ccedil;a"
Smn[3] = "Quarta"
Smn[4] = "Quinta"
Smn[5] = "Sexta"
Smn[6] = "S&aacute;bado"

nMes = new NArray(12)

nMes[0] = "janeiro"
nMes[1] = "fevereiro"
nMes[2] = "mar&ccedil;o"
nMes[3] = "abril"
nMes[4] = "maio"
nMes[5] = "junho"
nMes[6] = "julho"
nMes[7] = "agosto"
nMes[8] = "setembro"
nMes[9] = "outubro"
nMes[10] = "novembro"
nMes[11] = "dezembro"

return Smn[dias] + ", " + dia + " de " + nMes[mes] + " de " + ano
}

function ola(){
var d = new Date() 
var h = d.getHours() 

if (h < 6) 
sdc="Bom madrugada " 
else 
if (h < 12) 
sdc="Bom dia " 
else 
if (h < 18) 
sdc="Boa tarde "
else 
sdc="Boa noite "

return sdc
}
