// JavaScript Document
function enviaNews(){
	var fml = document.newsletters
	
	arroba = fml.email.value.indexOf("@");
	ponto = fml.email.value.indexOf(".");
	
	if (fml.nome.value == ""){
		alert("Nome é obrigatório.")
		fml.nome.focus();
	}else if(fml.email.value == ""){
		alert("E-mail é obrigatório");
		fml.email.focus();
	}else if (arroba == -1 || ponto == -1){
		alert("E-mail inválido")
		fml.email.focus();
	}else{
		fml.action = "../cadastrar.asp?Sys=ok";
		fml.method = "POST";
		fml.submit();
	}
}

function login(){
	var fml = document.login

	arroba = fml.email.value.indexOf("@");
	ponto = fml.email.value.indexOf(".");
	
	if (fml.email.value == "" || fml.email.value.lenght < 3){
		alert("Digite seu E-mail");
		fml.email.focus();
	}else if (arroba == -1 || ponto == -1){
		alert("E-mail inválido");
		fml.email.focus();
	}else{
		fml.action = "../suporte.asp?verify=ok";
		fml.method = "POST";
		fml.submit();
	}
}

function cadastro(){
	var fml = document.cadastro

	arroba = fml.email.value.indexOf("@");
	ponto = fml.email.value.indexOf(".");

	if (fml.razao.value == "" || fml.razao.value.length < 5) {
		alert("Razão Socioal é obrigatório e deve ter no mínimo 5 caracteres");
		fml.razao.focus();
	}else if (fml.contato.value == "" || fml.contato.value.length < 5){
		alert("Nome do contato é obrigatório e deve ter no mínimo 5 caracteres");
		fml.contato.focus();
	}else if (fml.tel.value == ""){
		alert("Telefone é obrigatório");
		fml.tel.focus();
	}else if (fml.email.value == "" || fml.email.value.length < 5){
		alert("E-mail é obrigatório e deve ter no mínimo 5 caracteres");
	}else if (arroba == -1 || ponto == -1){
		alert("E-mail inválido");
	}else{
		fml.action = "suporte.asp?verify=cad";
		fml.method = "POST";
		fml.submit();
	}
}

function envalt(){
	var fml = document.alteracao;
	
	arroba = fml.email.value.indexOf("@")
	ponto = fml.email.value.indexOf(".")
	
	if (fml.razao.value == "" || fml.razao.value.length < 5) {
		alert("Razão Socioal é obrigatório e deve ter no mínimo 5 caracteres");
		fml.razao.focus();
	}else if (fml.contato.value == "" || fml.contato.value.length < 5){
		alert("Nome do contato é obrigatório e deve ter no mínimo 5 caracteres");
		fml.contato.focus();
	}else if (fml.tel.value == ""){
		alert("Telefone é obrigatório");
		fml.tel.focus();
	}else if (fml.email.value == "" || fml.email.value.length < 5){
		alert("E-mail é obrigatório e deve ter no mínimo 5 caracteres");
	}else if (arroba == -1 || ponto == -1){
		alert("E-mail inválido");
	}else{
		fml.action = "../suporte.asp?verify=alt";
		fml.method = "POST";
		fml.submit();
	}
}

/*function chamado(){
	var fml = document.abrir
	
	if (fml.numero.value == ""){
		alert("Número de Nota Físcal é obrigatório");
		fml.serie.focus();
			if (fml.serie.value == ""){
		alert("Número de série é obrigatório");
		fml.serie.focus();
			if (fml.modelo.value == ""){
		alert("O modelo do produto é obrigatório");
		fml.modelo.focus();
	if (fml.fabricante.value == ""){
		alert("O fabricante é obrigatório");
		fml.fabricante.focus();
	}else if(fml.dia.value == "" || fml.mes.value == "" || fml.ano.value == "") {
		alert("A data é obrigatório");
		if (fml.dia.value=="") {
			fml.dia.focus();
		}else if(fml.mes.value==""){
			fml.mes.focus();
		}else if(fml.ano.value == "") {
			fml.ano.focus();
		}
	}else if(fml.dia.value.length<2){
		alert("Formato inválido de data");
		fml.dia.focus();
	}else if(fml.mes.value.length<2){
		alert("Formato inválido de data");
		fml.mes.focus();
	}else if(fml.ano.value.length<4){
		alert("Formato inválido de data");
		fml.ano.focus();
	}else if(fml.dia.value < 1 || fml.dia.value > 31){
		alert("O dia "+fml.dia.value+" é inválido");
		fml.dia.focus();
	}else if(fml.mes.value < 1 || fml.mes.value > 12){
		alert("O mes "+fml.mes.value+" é inválido");
		fml.mes.focus();
	}else if(fml.ano.value < 1900 || fml. ano.value > 2005){
		alert("O ano "+fml.ano.value+" é inválido");
		fml.ano.focus();
	}else if(fml.descricao.value == ""){
		alert("Descrição é obrigatório");
		fml.descricao.focus();
	}else if (fml.problema.value==""){
		alert("Problema é obrigatório");
		fml.problema.focus();
	}else{
		fml.action = "suporte.asp?verify=abrir";
		fml.method = "POST";
		fml.submit();
	}
}*/
function MaxMin(obj,img){
	if (document.getElementById(obj).style.display=='none') {
		document.getElementById(obj).style.display='block';
		document.getElementById(img).src = "images/UpgradeReport_Minus.gif";
		//document.getElementById(img).onclick = "10.asp";
	} else {
		document.getElementById(obj).style.display='none';
		document.getElementById(img).src = "images/UpgradeReport_Plus.gif";
		//document.getElementById(img).onclick = "5.asp";
	}
}