function menuOver(obj){
	obj.style.color='#ff7200';
}
function menuOut(obj){
	obj.style.color='';
	obj.style.backgroundColor='';
	obj.style.border='';
}
function acessoEV(pCodigo){
	document.formulario.fCodDist.value=pCodigo;
	document.formulario.submit();
}
function codRef(pCod){
	document.formulario.fCodRef.value=document.formulario.fCodRef.value+':'+pCod;
}
function apagarCod(){
	document.formulario.fCodRef.value='';
}
function mudaImg(pID){
	if (document.getElementById(pID+'1').style.display=='none'){
		document.getElementById(pID+'1').style.display='inline';
		document.getElementById(pID+'2').style.display='none';
	}else{
		document.getElementById(pID+'1').style.display='none';
		document.getElementById(pID+'2').style.display='inline';
	}
}
function apagaDesc(pAtivo,pCodProd){
	var maxNum=document.getElementById('maxNumDesc').value;
	
	for (x=1 ; x <= maxNum ; x++){
		document.getElementById('desc'+x).style.display='none';
	}
	document.getElementById('desc'+pAtivo).style.display='inline';
	document.getElementById('codProdAtual').value=pCodProd;
	
	if (pCodProd.substr(0,3) == 'C05'){
		mudaPreco('C05');
	}
	if (pCodProd.substr(0,3) == 'C07' || pCodProd.substr(0,3) == 'C09'){
		mudaPreco(pCodProd);
	}
}
function mudaPreco(pCodProd){
	var prProd = document.getElementById('pr_'+pCodProd).value;
	document.getElementById('areaPreco').innerHTML='R$ '+prProd;
}
function abreNoticia(idNot){
	document.formNoticia.idNoticia.value=idNot;
	document.formNoticia.submit();
}
function confForm(obj){
	//formFaleConosco
	var vNome=document.getElementById('nome');
	var vEmail=document.getElementById('email');
	var vTelefone=document.getElementById('telefone');
	var vDepartamento=document.getElementById('departamento');
	var vAssunto=document.getElementById('assunto');
	var vMensagem=document.getElementById('mensagem');
	
	var libera=true;
	
	if (vNome.value == ''){
		vNome.style.backgroundColor='#ffcc99';
		libera=false;
	}else{
		vNome.style.backgroundColor='';
	}
	
	if (vEmail.value == ''){
		vEmail.style.backgroundColor='#ffcc99';
		libera=false;
	}else{
		vEmail.style.backgroundColor='';
	}
	
	if (vTelefone.value == ''){
		vTelefone.style.backgroundColor='#ffcc99';
		libera=false;
	}else{
		vTelefone.style.backgroundColor='';
	}
	
	if (vDepartamento.value == ''){
		vDepartamento.style.backgroundColor='#ffcc99';
		libera=false;
	}else{
		vDepartamento.style.backgroundColor='';
	}
	
	if (vAssunto.value == ''){
		vAssunto.style.backgroundColor='#ffcc99';
		libera=false;
	}else{
		vAssunto.style.backgroundColor='';
	}
	
	if (vMensagem.value == ''){
		vMensagem.style.backgroundColor='#ffcc99';
		libera=false;
	}else{
		vMensagem.style.backgroundColor='';
	}
	
	if (libera){
		var expReg = /^[\w.-]+@[\w]+\.[\w|\.]+$/;
		
		if (expReg.test(vEmail.value) == true) {
			document.getElementById('msgerro').innerHTML='Aguarde, enviando...';
			document.formFaleConosco.submit();
		}else{
			document.getElementById('msgerro').innerHTML='Atençao! Email inválido!';
			vEmail.style.backgroundColor='#ffcc99';
		}
	}else{
		document.getElementById('msgerro').innerHTML='Por favor, preencha os campos em destaque!';
	}
}
function apagaForm(){
	document.getElementById('nome').value='';
	document.getElementById('email').value='';
	document.getElementById('telefone').value='';
	document.getElementById('departamento').value='';
	document.getElementById('assunto').value='';
	document.getElementById('mensagem').value='';
	document.getElementById('codMail').value='';
}
function esqueciSenha(){
	window.open('esqueci_senha.asp','esqueci_senha','width=300,height=200');
}


var posScroll=0;
var tempoScroll='';
var ativaScroll=true;

function moverFoco(){
	if (ativaScroll){
		tempoScroll=setInterval('animaScroll()',20);
	}
}
function animaScroll(){
	posScroll+=10;
	window.scrollTo(0,posScroll);
	
	if (posScroll >= 300){
		clearInterval(tempoScroll);
	}
}
function marcaSenha(pRef){
	document.getElementById('campoSenhaTemp').value=document.getElementById('campoSenhaTemp').value+'*';
}
function apagaFormLogin(){
	
	if (document.getElementById('campoSenhaTemp').value != ''){
		document.getElementById('campoSenhaTemp').value='';
		apagarCod();
	}else{
		document.getElementById('campoCodTemp').value='';
	}
}
function enviaFormLogin(){
	if (document.getElementById('campoCodTemp').value != '' && document.getElementById('campoSenhaTemp').value != ''){
		document.formulario.fCodDist.value=document.getElementById('campoCodTemp').value;
		document.formulario.submit();
	}
}
