$(function(){
  
  Newsletter.init();
  
  /* jcheck portuguese */
  var vx = $("#form-reserve").jcheck({
    language: 'pt-br'
  });
  vx.validates("name", "born", "occupation", "age", "nacionality","FormSex","travel_document","cpf","permanent_address","district","code_zip","city_state","country","arriving_form","next_destination","purposer_of_trip","arriving_by", "home_telephone","business_telephone","entry_date","entry_hour","out_date","out_hour","scorte","fnrh","record","uh_n", {
    presence: true
  });
  vx.validates("email_check", {
    format: {
      "with": "email"
    }
  });

  var v = $("#form-contact").jcheck({
    language: 'pt-br'
  });
  v.validates("name", "city", "country", "state", "obs", {
    presence: true
  });
  v.validates("email", {
    format: {
      "with": "email"
    }
  });
  
  var vw = $("#form-work").jcheck({
    language: 'pt-br'
  });
  vw.validates(
    "name", 
    "file", 
    "address", 
    "email", 
    "phone", 
    "age", {
      presence: true
    });
  vw.validates("email", {
    format: {
      "with": "email"
    }
  });

  $(".autostart").fancybox({
    'width'        : '75%',
    'height'      : '75%',
    'autoScale'       : false,
    'transitionIn'    : 'fade',
    'transitionOut'    : 'fade',
    'overlayColor'    : '#000',
    'overlayOpacity'  : '0.5'
  });   

  $('a[rel="lightbox"]').fancybox();
  $(".fancybox").fancybox();
        
  $("#tags ul li a").click(function(){
    var obj = $(this).parent();
    var rel = obj.attr('id');
    $("#tags ul li").removeClass('highlight-select');
    $("#tags ul li").removeClass('menu-select');
    $("#tags ul li").removeClass('mail-select');
    obj.addClass(rel + '-select');
    $("div#wrap").each(function(){
      $(this).slideUp('fast');
    });
    $("div[rel='" + rel + "-select']").slideToggle('fast');
  });
   
//  setTimeout(hideAlert,4000);
//  function hideAlert(){
//    if ($("#alert-message")[0]) {
//      $("#alert-message").slideUp('fast');
//    }
//  }
});

