function get_flash(arquivo, largura, altura, bgcolor, id, qualidade, alinhamento,transparente,pgphp) {
	obj = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+largura+'" height="'+altura+'" id="'+id+'" align="'+alinhamento+'">';
	obj+= '<param name="allowScriptAccess" value="sameDomain" />';
	obj+= '<param name="movie" value="'+arquivo+'" />';
	obj+= '<param name="quality" value="'+qualidade+'" />';
	if(transparente == true) {
		obj+= '<param name="wmode" value="transparent" />';
	}
	obj+= '<param name="bgcolor" value="'+bgcolor+'" />';
	obj+= '<param name="FlashVars" value="pg='+pgphp+'" />';
	obj+= '<embed src="'+arquivo+'" '+((transparente==true)?'wmode="transparent"':'')+'" quality="'+qualidade+'" bgcolor="'+bgcolor+'" FlashVars="pg='+pgphp+'" width="'+largura+'" height="'+altura+'" name="'+id+'" align="'+alinhamento+'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
	obj+= '</object>';
	document.write(obj);
}

function habilita(id){
	
	if(id == "obrasEmAndamento" || id == "obrasConcluidas"){
		if(id == "obrasEmAndamento"){
		window.document.getElementById('obrasEmAndamento').style.display = "";
		window.document.getElementById('op4').className = "ativo";
		}else{
			window.document.getElementById('obrasEmAndamento').style.display = "none";
			window.document.getElementById('op4').className = "";
		}
		
		if(id == "obrasConcluidas"){
			window.document.getElementById('obrasConcluidas').style.display = "";
			window.document.getElementById('op5').className = "ativo";
		}else{
			window.document.getElementById('obrasConcluidas').style.display = "none";
			window.document.getElementById('op5').className = "";
		}
	}else{
		
		if(id == "bHistorico"){
		window.document.getElementById('bHistorico').style.display = "";
		window.document.getElementById('op1').className = "ativo";
		}else{
			window.document.getElementById('bHistorico').style.display = "none";
			window.document.getElementById('op1').className = "";
		}
		
		if(id == "bMissao"){
			window.document.getElementById('bMissao').style.display = "";
			window.document.getElementById('op2').className = "ativo";
		}else{
			window.document.getElementById('bMissao').style.display = "none";
			window.document.getElementById('op2').className = "";
		}
		
		if(id == "bPolitica"){
			window.document.getElementById('bPolitica').style.display = "";
			window.document.getElementById('op3').className = "ativo";
		}else{
			window.document.getElementById('bPolitica').style.display = "none";
			window.document.getElementById('op3').className = "";
		}		
	}		
}

function checaFormFale() {
	if (document.formFale.nome.value == ""){
		alert("Preencha o campo Nome!");
		return false;
	}
	if (document.formFale.email.value == ""){
		alert("Preencha o campo E-mail!");
		return false;
	}
	if (document.formFale.telefone.value == ""){
		alert("Preencha o campo Telefone!");
		return false;
	}
	if (document.formFale.assunto.value == ""){
		alert("Preencha o campo Assunto!");
		return false;
	}
	if (document.formFale.mensagem.value == ""){
		alert("Preencha o campo Mensagem!");
		return false;
	}
	return true;
}

function verificaNews(){
	if (document.formNews.nome.value == "" || document.formNews.nome.value == "nome"){
		alert("Informe seu nome Nome!");
		return false;
	}
	if (document.formNews.email.value == "" || document.formNews.email.value == "e-mail"){
		alert("Informe seu nome E-mail!");
		return false;
	}
	return true;
}

function checaFormportal(){
	if (document.frmPortal.usuario.value == ""){
		alert("Informe seu Login!");
		return false;
	}
	if (document.frmPortal.senha.value == ""){
		alert("Informe a Senha!");
		return false;
	}
	
	window.document.frmPortal.submit();
}

function validaFrm(){
	if (document.frmDados.ds_cliente_email.value == ""){
		alert("Informe seu Email!");
		return false;
	}else{
		if(document.frmDados.ds_cliente_email.value != document.frmDados.ds_cliente_email2.value){
			alert("Os campos Email e Confirmar de Email devem ser iguais!");
			return false;
		}
	}if (document.frmDados.ds_cliente_senha.value == ""){
		alert("Informe uma Senha!");
		return false;
	}else{
		if(document.frmDados.ds_cliente_senha.value != document.frmDados.ds_cliente_senha2.value){
			alert("Os campos Senha e Confirmar de Senha devem ser iguais!");
			return false;
		}
	}if (document.frmDados.ds_cliente_cep.value == ""){
		alert("Preencha o campo CEP!");
		return false;
	}if (document.frmDados.ds_cliente_endereco.value == ""){
		alert("Preencha o campo Endereço!");
		return false;
	}if (document.frmDados.ds_cliente_bairro.value == ""){
		alert("Preencha o campo Bairro!");
		return false;
	}if (document.frmDados.ds_cliente_cidade.value == ""){
		alert("Preencha o campo Cidade!");
		return false;
	}if (document.frmDados.ds_cliente_estado.value == ""){
		alert("Preencha o campo Estado!");
		return false;
	}if (document.frmDados.ds_cliente_tel1.value == "" && document.frmDados.ds_cliente_tel2.value == "" && document.frmDados.ds_cliente_tel3.value == ""){
		alert("Informe pelo menos um Telefone!");
		return false;
	}
	
	window.document.frmDados.submit();
}

$(function() {
	$('a.gallery').lightBox();	
});

$(function() {
  $('#telefone').mask('(99) 9999-9999');
  $('.tel').mask('(99) 9999-9999');
  $('.cep').mask('99999-999');
});

function popup(Url, Titulo, Width, Height, Scroll, Status) {
	
	if(Width == "")
		Width = screen.availWidth;
	if(Height == "")
		Height = screen.availHeight;		
		


    window.open(Url, Titulo, 'width='+Width+', height='+Height+', scrollbars='+Scroll+', status=no, top='+((screen.availHeight/2)-(Height/2))+', left='+((screen.availWidth/2)-(Width/2)));
}
