//************************************
// COIN SLIDER
//*************************************

$(document).ready(function() {
$('#coin-slider').coinslider({ 
width:1000, // width of slider panel
height:200, // height of slider panel
spw: 7, // squares per width
sph: 5, // squares per height
delay: 3000, // delay between images in ms
sDelay: 30, // delay beetwen squares in ms
opacity: 0.7, // opacity of title and navigation
titleSpeed: 500, // speed of title appereance in ms
effect: 'rain', // random, swirl, rain, straight
navigation:false, // prev next and buttons
links : false, // show images as links 
hoverPause: true // pause on hover

});

});



//************************************
// FORMULARIO DE CONTATO
//*************************************

  $(document).ready(function(){
 
  $("#formulario1").submit(function() {

  var nome     = $("#nome").val();
  var email    = $("#email").val();
  var assunto  = $("#assunto").val();
  var mensagem = $("#mensagem").val();
  var telefone = $("#telefone").val();
  

  $("#status-mail").html("<img src='http://www.remocaodetatuagem.com.br/wp-content/themes/rmt/images/loader.gif' alt='Enviando' />");
  
  $.post('http://www.remocaodetatuagem.com.br/wp-content/themes/rmt/mail.php', {nome:nome,email:email,mensagem:mensagem,telefone:telefone}, function(resposta) {

  if (resposta != false)
  {
  $("#status-mail").html(resposta);
  }
 
  else 
  {
  $("#status-mail").html("<div class='sucesso'>Mensagem Enviada com  sucesso!</div>");
  $(".sucesso").fadeOut(5000);
  // Limpando todos os campos do forulario no caso val = zero
  $("#nome").val("");
  $("#email").val("");
  $("#assunto").val("");
  $("#mensagem").val("");
  $("#telefone").val("");
  
  }
  
  });
  });
  });
  
  
  

//************************************
// NEWSLETTER
//*************************************

$(function($) {

$("#formulario").submit(function() {

var nome = $("#nome-newsletter").val();
var email = $("#email-newsletter").val();


$("#status").html("<img class='loader' src='http://www.remocaodetatuagem.com.br/wp-content/themes/rmt/images/loader.gif' alt='Enviando' />");
$.post('http://www.remocaodetatuagem.com.br/wp-content/themes/rmt/cadastra-newsletter.php', {nome: nome, email: email}, function(resposta) {


if (resposta != false) 
{
$("#status").html(resposta);
}

else 
{

$("#status").html("<div class='sucesso'>Cadastrado Efetuado com  sucesso!</div>");

$(".sucesso").fadeOut(5000);
$("#nome-newsletter").val("");
$("#email-newsletter").val("");

}
});
});
});



 /***********************************
  * CONTADOR DE CARACTERES
  ************************************/
  $(document).ready(function(){
  
  $("#mensagem").keyup(function(){
  
  var limite   = 150;
  var tamanho  = $(this).val().length;

  
  if(tamanho>limite)
  {
  tamanho -=1;
  }
  var contador = limite - tamanho;
  $("#contador").text(contador);
  
  if(tamanho>=limite)
  {
  var txt = $(this).val().substring(0,limite);
  $(this).val(txt);
  }
  
						})
  });
