// IGAM  http://www.igam.com.br
// Variáveis para Imprimir a Data Atual
var Atual = new Date()
var Dia = Atual.getDate()
var Semana = Atual.getDay()
var Mes = Atual.getMonth()
var Ano = Atual.getYear()
var Hora = Atual.getHours()
//
SemanaNome = new Array()
SemanaNome[0] = "Domingo";
SemanaNome[1] = "Segunda-Feira";
SemanaNome[2] = "Terça-Feira";
SemanaNome[3] = "Quarta-Feira";
SemanaNome[4] = "Quinta-Feira";
SemanaNome[5] = "Sexta-Feira";
SemanaNome[6] = "Sábado";
//
MesNome = new Array()
MesNome[0] = "Janeiro";
MesNome[1] = "Fevereiro";
MesNome[2] = "Março";
MesNome[3] = "Abril";
MesNome[4] = "Maio";
MesNome[5] = "Junho";
MesNome[6] = "Julho";
MesNome[7] = "Agosto";
MesNome[8] = "Setembro";
MesNome[9] = "Outubro";
MesNome[10] = "Novembro";
MesNome[11] = "Dezembro";
// Funções Básicas
function Imprimir() {
window.print();
};
function Status(mensagem) {
window.status = mensagem;
};
function Statusbar() {
window.defaultStatus = 'IGAM :: Instituto Gamma de Assessoria a Órgãos Públicos';
};
function Abrir(URL,NOME,ATRIBUTOS) {
window.open(URL,NOME,ATRIBUTOS);
};
function Fechar() {
window.close();
};
function Boomark() {
window.external.addfavorite('http://www.igam.com.br','IGAM');
};
// -------------------------- Funções de Validação de formulários do Site -------------------------------
// Função para Validar Login e Senha do Cliente
function Logon() {
var login = document.logon.login.value;
var senha = document.logon.senha.value;
//
if (login.length < 6) {
alert('Preencha corretamente seu login');
return false;
document.login.focus();
}
if(senha.length < 6) {
alert('Preencha corretamente sua senha');
return false;
document.senha.focus();
}
/*
if(isNaN(senha)) {
alert('A senha deve conter apenas números');
return false;
docuemnt.senha.focus();
}
*/
};
// Função para Validar Envio de E-mail
function Mail() {
var nome = document.mail.nome.value;
var email = document.mail.email.value;
var assunto = document.mail.assunto.value;
var mensagem = document.mail.mensagem.value;
//
if(nome.length < 3) {
alert('Preencha seu nome');
return false;
document.nome.focus();
}
if(email.length < 5 || email.indexOf("@")==-1 || email.indexOf(".")==-1) {
alert('Preencha um e-mail válido');
return false;
document.email.focus();
}
if(assunto == "") {
alert('Preencha um assunto');
return false;
document.assunto.focus();
}
if(mensagem == "") {
alert('Preencha o campo mensagem');
return false;
document.mensagem.focus();
}
};
//----------------------------------------- Funções Administrativas ---------------------------------------
function Confirmar(nome) {
if(confirm('Deseja realmente excluir\n'+nome+'?')) {
return true;
}else{
return false;
}
};
function Consultas() {
titulo = document.consultas.titulo.value;
arquivo = document.consultas.arquivo.value;
if(titulo == "") {
alert('Preencha o título da consulta');
return false;
document.titulo.focus();
}
if(arquivo == "") {
alert('Selecione um arquivo no formato (*.pdf)');
return false;
document.consulta.focus();
}
};
function Area() {
var nome = document.area.nome.value;
//
if(nome.length < 3) {
alert('Preencha o campo nome');
return false;
document.nome.focus();
}
};
function Atualiza() {
var nome = document.atualiza.nome.value;
var arquivo = document.atualiza.arquivo.value;
//
if(nome == "") {
alert('Preencha o campo nome');
return false;
document.nome.focus();
}
if(arquivo == "") {
alert('Selecione um arquivo (*.pdf)');
return false;
document.nome.focus();
}
};
function Entidade() {
var nome = document.entidade.nome.value;
var tipo = document.entidade.tipo.value;
var cnpj = document.entidade.cnpj.value;
var cidade = document.entidade.cidade.value;
//
if(nome == "") {
alert('Preencha um nome para a entidade');
return false;
document.nome.focus();
}
if(tipo == "") {
alert('Preencha o tipo da entidade');
return false;
document.tipo.focus();
}
if(cnpj == "") {
alert('Preencha corretamente o CNPJ da entidade');
return false;
document.cnpj.focus();
}
if(cidade == "") {
alert('Preencha a cidade da entidade');
return false;
document.cidade.focus();
}
};
function Noticia() {
var titulo = document.noticia.titulo.value;
var data = document.noticia.data.value;
//
if(titulo == "") {
alert('Preencha um título para a notícia');
return false;
document.titulo.focus();
}
if(data == "") {
alert('Insira a data do curso');
return false;
document.conteudo.focus();
}
};
function Download() {
var texto = document.download.texto.value;
var arquivo = document.download.arquivo.value;
//
if(texto == "") {
alert('Preencha o nome do Download');
return false;
document.texto.focus();
}
if(arquivo == "") {
alert('Selecione um arquivo (*.zip)');
return false;
document.arquivo.focus();
}
};
function Clientes() {
var nome = document.cliente.nome.value;
var email = document.cliente.email.value;
var nascimento = document.cliente.nascimento.value;
var profissao = document.cliente.profissao.value;
var login = document.cliente.login.value;
var senha = document.cliente.senha.value;
var confirma = document.cliente.confirma.value;
var sexo = document.cliente.sexo.value;
if(nome.length < 3) {
alert('Preencha o nome do cliente');
return false;
document.nome.focus();
}
if(email.length < 5 || email.indexOf("@")==-1 || email.indexOf(".")==-1) {
alert('Preencha um e-mail válido');
return false;
document.email.focus();
}
if(nascimento.length > 10) {
alert('Preencha a data de nascimento corretamente');
return false;
document.nascimento.focus();
}
if(profissao == "") {
alert('Preecnha a profissão do cliente');
return false;
document.profissao.focus();
}
if(login.length < 6 || login.length > 10) {
alert('Preencha o campo login');
return false;
document.login.focus();
}
if(senha.length < 6 || senha.length > 10) {
alert('Preencha o campo Senha');
return false;
document.senha.focus();
}
if(isNaN(senha)) {
alert('A senha deve conter apenas números');
return false;
document.senha.focus();
}
if(confirma != senha) {
alert('Repita a senha');
return false;
document.confirma.focus();
}
};
// if(this.value=='Busca')this.value='';
// if(this.value=='')this.value='Busca';