tms=new Array()

//Mostra o submenu no mouseover
function over(n){
	if(typeof(tms[n])!="undefined")clearTimeout(tms[n])
	document.getElementById(n).style.visibility="visible"
}
//Esconde o submenu no mouseout
function out(n){
	tms[n]=setTimeout('document.getElementById("'+n+'").style.visibility="hidden"',500)
}


function confirmacao(){
	alert("Formulário Enviado com Sucesso!");
}



function confirma_cv(){
	alert("Seu Currículo foi Enviado com Sucesso!");
}
	
	

function abre_cv(){
	w = 600;
	h = 420;
	largura = screen.width;
	altura = screen.height;
	XX =(largura-w)/2;
	YY = (altura-h)/2;
	janela = window.open('cv.asp','vc','width='+w+',height='+h+',left='+XX+',top='+YY+',scrollbars=no,status=no,resizable=no, toolbar=no,directories=no,menubar=no');
	janela.focus();
}

function abre_foto_produto(cod){
	w = 600;
	h = 420;
	largura = screen.width;
	altura = screen.height;
	XX =(largura-w)/2;
	YY = (altura-h)/2;
	janela = window.open('fotos.asp?cd_foto='+cod,'FOTOS_PRODUTOS','width='+w+',height='+h+',left='+XX+',top='+YY+',scrollbars=no,status=no,resizable=no, toolbar=no,directories=no,menubar=no');
	janela.focus();
}

function abre_foto_historia(cod){
	w = 600;
	h = 420;
	largura = screen.width;
	altura = screen.height;
	XX =(largura-w)/2;
	YY = (altura-h)/2;
	janela = window.open('fotos_historia.asp?cd_foto='+cod,'FOTOS_HISTORIA','width='+w+',height='+h+',left='+XX+',top='+YY+',scrollbars=no,status=no,resizable=no, toolbar=no,directories=no,menubar=no');
	janela.focus();
}

function abre_galeria(cod){
	w = 600;
	h = 450;
	largura = screen.width;
	altura = screen.height;
	XX =(largura-w)/2;
	YY = (altura-h)/2;
	janela = window.open('fotos.asp?cd_noticia='+cod,'FOTOS_GALERIA','width='+w+',height='+h+',left='+XX+',top='+YY+',scrollbars=no,status=no,resizable=no, toolbar=no,directories=no,menubar=no');
	janela.focus();
}

function valida_contato(){
	if (document.form1.nome.value.length < 3){
		alert("Preencha o campo 'Nome'.");
		document.form1.nome.focus();
		return (false);
	}
	if (document.form1.email.value.length < 3){
		alert("Preencha o campo 'E-mail'.");
		document.form1.email.focus();
		return (false);
	}
	if (document.form1.cidade.value.length < 3){
		alert("Preencha o campo 'Cidade/UF'.");
		document.form1.cidade.focus();
		return (false);
	}
	if (document.form1.telefone.value.length < 3){
		alert("Preencha o campo 'Telefone'.");
		document.form1.telefone.focus();
		return (false);
	}
	if (document.form1.msg.value.length < 3){
		alert("Preencha o campo 'Mensagem'.");
		document.form1.msg.focus();
		return (false);
	}
	return (true);
}

function valida_cv(){
	if (document.form1.nome.value == ""){
		alert("Preencha o campo 'Nome'.");
		document.form1.nome.focus();
		return (false);
	}
	
	if (document.form1.email.value == ""){
		alert("Preencha o campo 'Email'.");
		document.form1.email.focus();
		return (false);
	}
	
	if (document.form1.email.value.indexOf('@')  == -1){
		alert("Email digitado não é válido.");
		document.form1.email.select();
		return (false);
	}
	if (document.form1.email.value.indexOf('.')  == -1){
		alert("Email digitado não é válido.");
		document.form1.email.select();
		return (false);
	}
	
	if (document.form1.cvdoc.value  == ""){
		alert("Selecione o Curriculo.");
		document.form1.cvdoc.focus();
		return (false);
	}
		
}

function verifica_doc(file){
	if (file.value != ""){		
		var arquivo = (file);
		var tipo = arquivo.substring(arquivo.length-4,arquivo.length);
		var tipo = tipo.toLowerCase();
		
		if ((tipo == ".doc") || (tipo == ".txt") ) {
			
		}else{
			alert("Atenção: A tipo do arquivo não permitido!\r\nSó é permitido extensão .doc ou .txt!");
			document.getElementById("cvdoc").value = "";
			document.getElementById("cvdoc").select();
		return true;
		}
	}

}

