function addCurriculum(elem) {
	var trCurriculum = document.getElementById("curriculum");
	var assunto	= document.getElementById("assunto");
	if(elem.value == 'curriculum') {
		trCurriculum.style.display = 'block';
		assunto.value = 'Curriculum';
	} else {
		trCurriculum.style.display = 'none';
		if(assunto.value == 'Curriculum')
			assunto.value = '';
	}
}

//Valida extensao do arqv.
function isValidArq(string, array){
	var extensao = string.substr(string.length - 4, string.length);
	for(i = 0; i < array.length; i++){
		if(array[i] == extensao){
			return true;
		}
	}
	return false;
}

function enviaContato(bt){
	var frm = document.contato;
	var curriculum = document.getElementById("curriculum");

	if(trim(frm.nome.value) == ""){
		alert("Informe seu nome");
		frm.nome.focus();			
		return false;
	} else if(frm.email.value.indexOf("@") == -1 || frm.email.value.indexOf(".") == -1){
		alert("Informe o email.");
		frm.email.focus();			
		return false;
	} else if(frm.departamento.selectedIndex == 0){
		alert("Selecione o departamento");
		frm.departamento.focus();			
		return false;
	} else  if(curriculum.style.display == 'block' && !isValidArq(frm.path.value, Array('.doc', '.pdf'))){
		alert("Formato do curriculum é inválido. Os Formatos permitidos são '.doc' e '.pdf' !!!");
		frm.path.focus();
		return false;
	} else if(trim(frm.assunto.value) == 0){
		alert("Informe o assunto");
		frm.assunto.focus();
		return false;		
	} else if(frm.mensagem.value.replace(/\s/gi,"") == ""){
		alert("Digite sua mensagem.");
		frm.mensagem.focus();			
		return false;
	} 
	frm.submit();
	bt.disabled = true;
	return true;
}


