$(document).ready(function(){$('#txt_busca').click(function(){if($('#txt_busca').val()==' O QUE VOCÊ PROCURA?')
$('#txt_busca').val('');});$('.noticia-titulo-reduzida').click(function(){if($(this).next().css('display')=='none')
$(this).next().show();else
$(this).next().hide();});$("#home-destaques a.link_img_destaques").lightBox({fixedNavigation:true});$("#home-fotos a.link_img_fotos").lightBox({fixedNavigation:true});$("#itens-pacotes-cruzeiros a").lightBox({fixedNavigation:true});$("#fotos a").lightBox({fixedNavigation:true});$("#busca-destaques a").lightBox({fixedNavigation:true});$('#btn-cad-newsletter').click(function(){evento('Newsletter','click','clicou');var email=$('#email-newsletter').val();if(trim(email)==''){evento('Newsletter','retorno','em_branco');alert('Preencha seu em-mail.');return false;}
if(doEmail(email)==false){evento('Newsletter','retorno','invalido');alert('E-mail inválido. Por favor, verifique.');return false;}
$('#btn-cad-newsletter').html('aguarde...');$.post('newsletter/email.php',{email:email},function(data){if(data=='1'){evento('Newsletter','retorno','cadastrou');alert('E-mail cadastrado com sucesso. Obrigado!');}
else{if(data=='2'){evento('Newsletter','retorno','ja_cadastrado');alert('Este e-mail já está cadastrado. Obrigado!');}
else{evento('Newsletter','retorno','problema');alert('Problema ao cadastrar e-mail. Por favor, tente novamente.');}}
$('#btn-cad-newsletter').html('CADASTRAR');$('#email-newsletter').val('');});});});function evento(cat,ev,pg){_gaq.push(['_trackEvent',cat,ev,pg]);}
function volta_pt(){parent.location="http://www.evidenciaturismo.com.br/2011";}
function abre_conteudo(id){if($('#'+id).css('display')=='block')
$('#'+id).fadeOut();else
$('#'+id).fadeIn();}
function envia_contato(){evento('Contato','click','clicou');if(valida()==false){evento('Contato','retorno','em_branco');return false;}
else{if(doEmail($('#contato_email').val())==false){evento('Contato','retorno','email_invalido');alert('E-mail inválido. Por favor, verifique.');return false;}
$('#botao-contato').html('aguarde...');$.post('envia.php',$('#form_contato').serialize(),function(data){if(data=='1'){evento('Contato','retorno','enviou');alert('Contato enviado. Obrigado');}
else{evento('Contato','retorno','problema');alert('Problema ao enviar contato. Por favor, tente novamente.');}
$('#botao-contato').html('ENVIAR');});}}
function valida(){var vazios=0,c=0;var campos=$('.required');while(c<campos.length){if(campos[c].value==""){vazios++;}
c++;}
if(vazios==0)
return true;else{alert('Existem '+vazios+' campos em branco. Por favor, verifique e preencha-os.');return false;}}
var reEmail3=/^[\w-]+(\.[\w-]+)*@(([A-Za-z\d][A-Za-z\d-]{0,61}[A-Za-z\d]\.)+[A-Za-z]{2,6}|\[\d{1,3}(\.\d{1,3}){3}\])$/;var reEmail=reEmail3;function doEmail(pStr){var reEmail=/^[\w-]+(\.[\w-]+)*@(([A-Za-z\d][A-Za-z\d-]{0,61}[A-Za-z\d]\.)+[A-Za-z]{2,6}|\[\d{1,3}(\.\d{1,3}){3}\])$/;eval("reEmail = reEmail");if(reEmail.test(pStr)){return true;}else if(pStr!=null&&pStr!=""){return false;}}
function replaceAll(string,token,newtoken){while(string.indexOf(token)!=-1){string=string.replace(token,newtoken);}return string;}
function trim(str){return str.replace(/^\s+|\s+$/g,"");}
