// JavaScript Document

	function checkMail(mail){
		var er = new RegExp(/^[A-Za-z0-9_\-\.]+@[A-Za-z0-9_\-\.]{2,}\.[A-Za-z0-9]{2,}(\.[A-Za-z0-9])?/);
		if(typeof(mail) == "string"){
			if(er.test(mail)){ return true; }
		}else if(typeof(mail) == "object"){
			if(er.test(mail.value)){ 
						return true; 
					}
		}else{ 
			return false;
			}
	}
	
	function validaCampos()
	{
		var email = document.getElementById("email");	
		var form = document.getElementById("envia_news");
		if (!checkMail(email.value))
			alert('Campo e-mail inválido');
		else
			form.submit();
				
	}
    $(document).ready(function() {
        $("#enquete-resultado").toggle(function() {
            $("#mostra_resultado").show('fast');
            }, function() {
            $("#mostra_resultado").hide('fast');
        });
    });

	var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
	document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
	try {
		var pageTracker = _gat._getTracker("UA-13110015-15");
		pageTracker._trackPageview();
	} catch(err) {}


		$(document).ready(function(){	
			$("#container-empreendimento-dentro-slider-pe-in-holder").easySlider({
				continuous: true,
				prevId: 'container-empreendimento-dentro-slider-pe-in-seta_b',
				nextId: 'container-empreendimento-dentro-slider-pe-in-seta_a',
				controlsShow: false
			});
		});
		
		$(document).ready(function(){	
			$("#container-empreendimento-dentro-slider-pl-in-holder").easySlider({
				continuous: true,
				prevId: 'container-empreendimento-dentro-slider-pl-in-seta_b',
				nextId: 'container-empreendimento-dentro-slider-pl-in-seta_a',
				controlsShow: false
			});
		});

		function validaCampos2()
		{
			var nome = document.getElementById("nome");	
			var email = document.getElementById("emailc");	
			var msn = document.getElementById("msn");	
			var form = document.getElementById("envia");
			if (nome.value == "" || nome.value == "NOME")
				alert('Campo nome obrigatório');
			else if (!checkMail(email.value))
				alert('Campo e-mail inválido');
			else if (msn.value=="" || msn.value == "MENSAGEM")
				alert('Campo mensagem obrigatório');
			else
				form.submit();
			
		}
		
		$(document).ready(function(){	
			$("#container-news-dentro-slider-pe-in-holder").easySlider({
				continuous: true,
				prevId: 'container-news-dentro-slider-pe-in-seta_b',
				nextId: 'container-news-dentro-slider-pe-in-seta_a',
				controlsShow: false
			});
		});
		
		function validaCampos3()
		{
			var nome = document.getElementById("nome");	
			var email = document.getElementById("email");	
			var telefone = document.getElementById("telefone");	
			var form = document.getElementById("envia");
			if (nome.value == "" || nome.value == "NOME")
				alert('Campo nome obrigatório');
			else if (!checkMail(email.value))
				alert('Campo e-mail inválido');
			else if (telefone.value=="" || telefone.value == "TELEFONE")
				alert('Campo telefone obrigatório');
			else
				form.submit();
			
		}
		
		function validaCampos4()
		{
			var nome = document.getElementById("nome");	
			var email = document.getElementById("emaile");	
			var msn = document.getElementById("msn");	
			var form = document.getElementById("envia");
			if (nome.value == "" || nome.value == "NOME")
				alert('Campo nome obrigatório');
			else if (!checkMail(email.value))
				alert('Campo e-mail inválido');
			else if (msn.value=="" || msn.value == "MENSAGEM")
				alert('Campo mensagem obrigatório');
			else
				form.submit();
			
		}
		
		$(document).ready(function(){	
			$("#mes").change(function()
			{
				var valor = $('#mes').val();
				
				if (valor != "")
				{
					$("#acompanha-obra").html('<div><center>Carregando...</center><div><div><center><img src="../imgs/loading.gif" /></center><div>');
					$("#acompanha-obra").load('obras.php?id='+valor);					
				}
			});
		});
		
	  var tagAlvo = new Array('p');
	  var tamanhos = new Array('11px','12px','13px','14px','15px','16px','17px','18px','19px','20px','21px','22px','23px', '24px', '25px'); 
	  var tamanhoInicial = 6;   
	  function mudaTamanho(idAlvo, acao)
	  {   
		  if (!document.getElementById) return   
		  var selecionados = null,tamanho = tamanhoInicial,i,j,tagsAlvo; 
		  tamanho += acao;   
		  if ( tamanho < 0 ) tamanho = 0;   
		  if ( tamanho > 10 ) tamanho = 10;   
		  tamanhoInicial = tamanho;   
		  if ( !( selecionados = document.getElementById( idAlvo ) ) ) selecionados = document.getElementsByTagName( idAlvo )[ 0 ];      
		  
		  selecionados.style.fontSize = tamanhos[ tamanho ];      
		  
		  for ( i = 0; i < tagAlvo.length; i++ ){ 
			tagsAlvo = selecionados.getElementsByTagName( tagAlvo[ i ] );     
			for ( j = 0; j < tagsAlvo.length; j++ ) tagsAlvo[ j ].style.fontSize = tamanhos[ tamanho ];  
		  } 
	  } 