$(document).ready(function(){
					   

	// Activate PrettyPhoto Lightbox handle
	$("a[rel^='gallery']").prettyPhoto();
	
	// PNG Fix
	$(document).pngFix();
	
	$("#formContato").submit(function(e){
        e.preventDefault();
        txtarea = $(this).find("textarea").val();
        if (txtarea.length > 3) {
        dados = $(this).serialize();
        url = $(this).attr('action');
    
        $("#formContato").empty().append("<p>Enviando..</p>");
        $.post(url, dados, function(){
			$("#formContato").empty().append("<p>Dados Enviados com sucesso!</p>");
        });
        } else {
            alert("Digite uma mensagem!");
        }
    });
	

    $('a[href*=#]').click(function() {
    if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
    && location.hostname == this.hostname) {
      var $target = $(this.hash);
      $target = $target.length && $target
      || $('[name=' + this.hash.slice(1) +']');
      if ($target.length) {
        var targetOffset = $target.offset().top - 30;
        $('html,body')
        .animate({scrollTop: targetOffset}, 750);
       return false;
      }
    }
    });


});
