// Funções da Pagina INDEX
if(window.addEventListener)
	{ window.addEventListener("load", function() {corpo.style.visibility = 'hidden'; flash.style.visibility = 'visible'; setTimeout('sumir()', 15000)}, false);
} else if(window.attachEvent)
	{ window.attachEvent("onload", function() {corpo.style.visibility = 'hidden'; flash.style.visibility = 'visible'; setTimeout('sumir()', 15000)});
}

function rolar(estado) { 
	if (estado == "não") { noticias.scrollAmount = 0; noticias.style.color = "#0000FF"; }
	else { noticias.scrollAmount = 1; noticias.style.color = "#0033CC"; }
}
function passar(direcao) {
	noticias.direction = direcao;
	noticias.scrollAmount = 4;
}

function clickCOORD(opcao) {
//	parent.document.getElementById("marcador").style.top = 74;
	switch (opcao) {
		case 1: 
			parent.document.getElementById("marcador").style.left = 205;
			break;
		case 2:
			parent.document.getElementById("marcador").style.left = 260;
			break;
		case 3:
			parent.document.getElementById("marcador").style.left = 345;
			break;
		case 4:
			parent.document.getElementById("marcador").style.left = 438;
			break;
	}			
}

function clickBOTAO(botao) {
	switch (botao) {
		case 1: 
			open("frame/1_inicio.html","informacoes");
			break;
		case 2:
			open("frame/2_sistemas.html","informacoes");
			break;

		case 3:
			open("frame/3_comocomprar.html","informacoes");
			break;
			
		case 4:
			open("frame/4_faleconosco.html","informacoes");
			break;	
	} 
//	clickCOOD(botao);
}

function aniBOTAO(botao) {	
	menusel.style.visibility 	= "visible";	//alterado
	menusel.style.top 			= "51px";
	if (botao == 1) {
		menusel.style.left 		= 190;
		menusel.style.width 	= 45;
		minicio.style.color 	= "#ffffff";
		minicio.style.cursor	= "pointer";
	} else if (botao == 2) {
		menusel.style.left 		= 236;
		menusel.style.width 	= 68;
		msistemas.style.color	= "#ffffff";
		msistemas.style.cursor	= "pointer";
	} else if (botao == 3) {
		menusel.style.left 		= 303;
		menusel.style.width 	= 108;
		mcomprar.style.color	= "#ffffff";
		mcomprar.style.cursor	= "pointer";
	} else if (botao == 4) {
		menusel.style.left 		= 410;
		menusel.style.width 	= 90;
		mvantagens.style.color	= "#ffffff";
		mvantagens.style.cursor	= "pointer";		
	} else {
		menusel.style.visibility= "hidden"; //menusel.style.width 	= 0;
		minicio.style.color		= "#000066";
		msistemas.style.color	= "#000066";
		mcomprar.style.color	= "#000066";
		mvantagens.style.color	= "#000066";
	}
	menusel.style.cursor		= "pointer";
//	alert('No Erros in function aniBOTAO(botao)');		
}

function designSITE() {
	var altura 	= parseInt(document.body.clientHeight);
	var largura	= parseInt(document.body.clientWidth);
//	var artura = window.screen.availHeight;
//alert("screen = "+ artura +". clientWidth = "+ altura);
	

	// Configurando a menor medida possivel
	if (altura < 422) { altura = 422; }
	if (largura < 784) { largura = 784; }
	
	// 01 Barra
	barra.style.top			= 0;
	barra.style.left		= 0;
	barra.style.width		= largura - 5;
	
	// 02 Logo
	logo.style.top			= -1;
	logo.style.left			= 0;
	
	// 03 Binario
	binario.style.top		= imglogo.height - 1;
	binario.style.left		= 0;
	binario.style.height 	= altura - imglogo.height;

	// 05 Final Barra
	
	//SEMPRE DÁ PROBLEMA
	finalbarra.style.top	= 0;
	finalbarra.style.left	= largura - imgfinalbarra.width - 5;

	// Flash
	
	flash.style.top			= altura - 110; //altura - (imgnovidade.height - 25);
	flash.style.left		= largura - 200;
	
	// 07 Mapa
	
	mapa.style.top			= imgbarra.height +2;
	mapa.style.left			= largura - (imgmapa.width + 10);
	
	// 08 Iframe

	xframe.style.top		= imglogo.height - 50;
	xframe.style.left		= 171;
	xframe.style.height		= altura - (imglogo.height - 40);
	xframe.style.width		= largura - (imglogo.width  + 20 +  imgmapa.width); 	

	// 09 Informações
	
	xinfo.style.top			= altura - 165;//187;
	xinfo.style.left		= 0;
	
	// 10 Menu
	
	menu.style.top			= "50px";
	menu.style.left			= "166px";
	menu.style.width		= largura - (imglogo.width + 9);
	
	// 11 Marquee
	
	areaMarquee.style.top	= altura -  299;
	
	
//	alert('No Erros in function designSITE()');
}

///////////////////////////////////////////////////////////////////////////////////
//Funcoes da pagina INICIO ////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////


function iniInicio() {	
	parent.document.getElementById('iframe').scrolling = 'auto';
	var largura		= parseInt(document.body.clientWidth)-15;	
	var xlargura	= largura -10 ;	
	
	// Larguras
	
	tbGeral.style.top		= 5;
	tbGeral.style.width		= largura;
	tbEmp.style.width		= xlargura; //(xlargura /2) * 2;
	tbSis.style.width		= xlargura /2;
	tbEsp.style.width		= xlargura /2;
	tbCom.style.width		= xlargura /2;
	tbDuv.style.width		= xlargura /2;
	
	// Alturas
	
	if (tbSis.offsetHeight > tbEsp.offsetHeight) { tbEsp.style.height = tbSis.offsetHeight; }
	else if (tbSis.offsetHeight < tbEsp.offsetHeight) { tbSis.style.height = tbEsp.offsetHeight; }
	
	if (tbCom.offsetHeight > tbDuv.offsetHeight) { tbDuv.style.height = tbCom.offsetHeight; }
	else if (tbCom.offsetHeight < tbDuv.offsetHeight) { tbCom.style.height = tbDuv.offsetHeight; }
	
	//Larguras Gerais
	var maior = tbSis.offsetWidth;
	if (tbEsp.offsetWidth > maior) { maior = tbEsp.offsetWidth }
	else if (tbCom.offsetWidth > maior) { maior = tbCom.offsetWidth }
	else if (tbDuv.offsetWidth > maior) {maior = tbDuv.offsetWidth}

	tbEmp.style.width		= (2 * maior) + 5;
	tbSis.style.width		= maior;
	tbEsp.style.width		= maior;
	tbCom.style.width		= maior;
	tbDuv.style.width		= maior;		
}

///////////////////////////////////////////////////////////////////////////////////
//Funcoes da pagina SISTEMAS //////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////

function iniSistemas() {	
	parent.document.getElementById('iframe').scrolling = 'auto';
	var largura				= parseInt(document.body.clientWidth)-10;
	xlargura 				= largura -5;
	
	// Titulo
	tbTit.style.width		= xlargura - 2;
	tbTit.style.top			= 0;
	tbTit.style.left		= 0;

	// Link dos SISTEMAS (Eleitoral / Locadora)
	
	tbLin.style.top 		= tbTit.offsetHeight + 5; //2
	tbLin.style.left		= 10;	
	
	with (tbdowEle.style) { // Downloads do Sistema Eleitoral
		left				= 0;
		top					= tbLin.offsetTop + tbLin.offsetHeight + 5;
		width				= tbLin.offsetWidth + 8;
	}
	
	with (tbdowLoc.style) { // Downloads do Sistema de Locadora
		left				= 0;
		top					= tbLin.offsetTop + tbLin.offsetHeight + 5;
		width				= tbLin.offsetWidth + 8;
	}	
	
	with (tbtxtEle.style) { // Informações do Sistema Eleitoral
		left				= tbLin.offsetWidth + 12;
		top					= tbTit.offsetHeight + 5;
		width				= xlargura - (tbLin.offsetWidth + 14);
	}
	
	with (tbtxtLoc.style) { // Informações do Sistema de Locadora
		left				= tbLin.offsetWidth + 12;
		top					= tbTit.offsetHeight + 5;
		width				= xlargura - (tbLin.offsetWidth + 14);
	} 
}

function clickSisLink(valor) {
	tbdowEle.style.visibility	= "hidden";
	tbdowLoc.style.visibility	= "hidden";
	tbtxtEle.style.visibility	= "hidden";	
	tbtxtLoc.style.visibility 	= "hidden";
	marcSis.style.left			= 0;	
	switch (valor) {
		case 1: // Sistema Eleitoral 
			marcSis.style.top 			=  tbLin.offsetTop + 10;
			tbdowEle.style.visibility	= "visible";
			tbtxtEle.style.visibility	= "visible";
			break;
		case 2:	// Sistema de Locadora
			marcSis.style.top 			= tbLin.offsetTop + (tbLin.offsetHeight / 2) + 10;
			tbdowLoc.style.visibility	= "visible";
			tbtxtLoc.style.visibility	= "visible";			
			break;
	} 
}
///////////////////////////////////////////////////////////////////////////////////
//Funcoes da pagina COMO COMPRAR //////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////

function scrollMostrar() {parent.document.getElementById('iframe').scrolling = 'auto' }

function valida() {
var chave = false;
//alert(document.form1.Banco[0].checked)
	with (document.form1){
		if (nome.value == "") {
			alert("Digite o seu NOME");
			nome.focus();
		}else if (ender.value == "") {
			alert("Digite o seu ENDEREÇO");
			ender.focus();
		}else if (bairro.value == "") {
			alert("Digite o nome do seu BAIRRO");
			bairro.focus();
		}else if (CEP.value == "") {
			alert("Pesquise e Digite o seu CEP");
			CEP.focus();
		}else if (cidade.value == "") {
			alert("Digite o nome da sua CIDADE");
			cidade.focus();	
		} else if (menu1.value == "0") {
			alert("Escolha a sua UF da sua cidade");
			menu1.focus();
		}else if (tel1.value == "" && tel2.value == "") {
			alert("Digite pelo menos UM TELEFONE para contato");
			tel1.focus();			
		} else if (!Banco[0].checked && !Banco[1].checked) {
			alert("Qual o Banco que você fez a TRANSAÇÃO?");
			Banco[0].focus();
		}else if (dataDep.value == "" || horaDep.value == "") {
			alert("Qual a DATA e HORA que você fez a transação?");
			dataDep.focus();
		}else if (numTrans.value == "") {
			alert("IMPORTANTE: Digite o número da TRANSAÇÃO \'CORRETAMENTE\'");
			numTrans.focus();
			
      	} else { chave = true; }		
	}
	return chave;
}

function validaFale() {
var chave = false;
//alert(document.form1.Banco[0].checked)
	with (document.form1){
		if (nome.value == "") {
			alert("Digite o seu NOME");
			nome.focus();
		}else if (email.value == "") {
			alert("Digite seu E-MAIL para contato");
			email.focus();			
		}else if (telefone.value == "") {
			alert("Digite um TELEFONE para contato");
			telefone.focus();			
		}else if (mensagem.value == "") {
			alert("Qual a sua MENSAGEM?");
			mensagem.focus();			
      	} else { chave = true; }		
	}
	return chave;
}
///////////////////////////////////////////////////////////////////////////////////
//Funcoes da pagina ESPAÇO NELISOFTWARE ///////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
function sumir() { //FUNÇÃO DO SPLASH
	splash.style.visibility = "hidden";
}
