function exibeImagem(objLink){
	var objPai = objLink.parentNode.parentNode;
	var objDiv = objLink.parentNode.parentNode.parentNode;
	var strTelaID = "tela" + objLink.id.substr(5);

	for(var i = 0; i < objPai.getElementsByTagName("*").length; i++){
		if((objPai.getElementsByTagName("*")[i].tagName == "A") && (objPai.getElementsByTagName("*")[i].id == objLink.id)){
			objPai.getElementsByTagName("*")[i].className = "thumb_ativo";
		}else{
			objPai.getElementsByTagName("*")[i].className = "";
		}
	}
	
	for(var i = 0; i < objDiv.childNodes.length; i++){
		if((objDiv.childNodes[i].nodeType == 1) && (objDiv.childNodes[i].tagName == "IMG")){
			if(objDiv.childNodes[i].id == strTelaID){
				objDiv.childNodes[i].className = "exibirImagem";
			}else{
				objDiv.childNodes[i].className = "ocultarImagem";
			}
		}
	}
}

function filtroNoticias(opcao){
	document.getElementById("link_ultimas").className = "";
	document.getElementById("link_todas").className = "";
	document.getElementById("link_wintility").className = "";
	document.getElementById("link_vivaz").className = "";
	document.getElementById("link_saphira").className = "";
	document.getElementById("link_sol").className = "";
	document.getElementById("link_pharos").className = "";
	document.getElementById("link_projetos").className = "";

	document.getElementById("titulo_ultimas").className = "hide";
	document.getElementById("titulo_todas").className = "hide";
	document.getElementById("titulo_news_wintility").className = "hide";
	document.getElementById("titulo_news_vivaz").className = "hide";
	document.getElementById("titulo_news_saphira").className = "hide";
	document.getElementById("titulo_news_sol").className = "hide";
	document.getElementById("titulo_news_pharos").className = "hide";
	document.getElementById("titulo_news_projetos").className = "hide";

	document.getElementById("ultimas_noticias").className = "hide";
	document.getElementById("todas_noticias").className = "hide";
	document.getElementById("noticias_wintility").className = "hide";
	document.getElementById("noticias_vivaz").className = "hide";
	document.getElementById("noticias_pharos").className = "hide";
	document.getElementById("noticias_sol").className = "hide";
	document.getElementById("noticias_saphira").className = "hide";
	document.getElementById("noticias_projetos").className = "hide";
	
	switch (opcao){
		case "ultimas":
			document.getElementById("link_ultimas").className = "filtro_ativo";
			document.getElementById("titulo_ultimas").className = "show";
			document.getElementById("ultimas_noticias").className = "show";
			break
		case "todas":
			document.getElementById("link_todas").className = "filtro_ativo";
			document.getElementById("titulo_todas").className = "show";
			document.getElementById("ultimas_noticias").className = "show";
			document.getElementById("todas_noticias").className = "show";
			break
		case "wintility":
			document.getElementById("link_wintility").className = "filtro_ativo";
			document.getElementById("titulo_news_wintility").className = "show";
			document.getElementById("noticias_wintility").className = "show";
			break
		case "vivaz":
			document.getElementById("link_vivaz").className = "filtro_ativo";
			document.getElementById("titulo_news_vivaz").className = "show";
			document.getElementById("noticias_vivaz").className = "show";
			break
		case "saphira":
			document.getElementById("link_saphira").className = "filtro_ativo";
			document.getElementById("titulo_news_saphira").className = "show";
			document.getElementById("noticias_saphira").className = "show";
			break
		case "sol":
			document.getElementById("link_sol").className = "filtro_ativo";
			document.getElementById("titulo_news_sol").className = "show";
			document.getElementById("noticias_sol").className = "show";
			break
		case "pharos":
			document.getElementById("link_pharos").className = "filtro_ativo";
			document.getElementById("titulo_news_pharos").className = "show";
			document.getElementById("noticias_pharos").className = "show";
			break
		case "projetos":
			document.getElementById("link_projetos").className = "filtro_ativo";
			document.getElementById("titulo_news_projetos").className = "show";
			document.getElementById("noticias_projetos").className = "show";
		default:
			break
	}
}

function trocaImagem(opcao, evento){
	if(evento == "over"){
		if(opcao == "li_opt_home"){
			document.getElementById('li_opt_home').className = "selecionado_home";
		}else if(opcao == "li_opt_contato"){
			document.getElementById('li_opt_contato').className = "selecionado_contato";
		}else{
			document.getElementById(opcao).className = "selecionado";
		}
	}else if(evento == "out"){
		document.getElementById(opcao).className = "";
	}
}

function openBrWindow(theURL, winName, features){
	window.open(theURL, winName, features);
}

function enviarDados(){
	if(document.frmContatoComercial.Nome.value=="" || document.frmContatoComercial.Nome.value.length < 8){
		alert( "Preencha campo NOME corretamente!" );
		document.frmContatoComercial.Nome.focus();
		return false;
	}

	if( document.frmContatoComercial.Email.value=="" || document.frmContatoComercial.Email.value.indexOf('@')==-1 || document.frmContatoComercial.Email.value.indexOf('.')==-1 ){
		alert( "Preencha campo E-MAIL corretamente!" );
		document.frmContatoComercial.Email.focus();
		return false;
	}

	if (document.frmContatoComercial.Cargo.value==""){
		alert( "Preencha o campo CARGO!" );
		document.frmContatoComercial.Cargo.focus();
		return false;
	}

	if (document.frmContatoComercial.Empresa.value==""){
		alert( "Preencha o campo EMPRESA!" );
		document.frmContatoComercial.Empresa.focus();
		return false;
	}

	if (document.frmContatoComercial.ddd.value=="" || document.frmContatoComercial.ddd.value < 2){
		alert( "Preencha o campo DDD!" );
		document.frmContatoComercial.ddd.focus();
		return false;
	}

	if (document.frmContatoComercial.Telefone.value=="" || document.frmContatoComercial.Telefone.value < 8){
		alert( "Preencha o campo TELEFONE!" );
		document.frmContatoComercial.Telefone.focus();
		return false;
	}

	if(document.frmContatoComercial.Assunto.value == ""){
		alert( "Selecione uma opção no campo ASSUNTO!" );
		document.frmContatoComercial.Assunto.focus();
		return false;
	}

	if (document.frmContatoComercial.Mensagem.value=="" || document.frmContatoComercial.Mensagem.value.length < 5){
		alert( "Preencha o campo MENSAGEM!" );
		document.frmContatoComercial.Mensagem.focus();
		return false;
	}

	return true;
}
