/**************************************
* FUNCOES SITE  by www.ozsweb.com
***************************************/

//************************************//
  // NEWSLETTER//
  //*************************************/
  
  $(document).ready(function(){
  
  $("#cadastrar").submit(function() {
  
  var nome  = $("#nome-newsletter").val();
  var email = $("#email-newsletter").val();
  
  $("#status").html("<img class='loader' src='http://www.biomodulacaocorporal.com.br/template/tpl2/images/ajax-loader.gif' alt='Enviando' />");
  
  $.post('/template/tpl2/cadastra-newsletter.php', {nome:nome,email:email}, function(data){
  
  
  //$('#status').text(data)
  
  if (data != false) 
  {
  $("#status").html(data);
  }
  else 
  {
  
  $("#status").html("<div class='sucesso'>Cadastrado Efetuado com  sucesso :)</div>");
  
  $(".sucesso").fadeOut(5000);
  $("#nome-newsletter").val("");
  $("#email-newsletter").val("");
  
  }
  
  
  }); // Fim do POST
  }); // Fim do Click
  }); // Fim do Document Read
  
  
  //************************************
  // 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='/template/tpl2/images/ajax-loader.gif' alt='Enviando' />");
  
  $.post('/template/tpl2/mail.php', {nome:nome,email:email,assunto:assunto,mensagem:mensagem,telefone:telefone}, function(data){
  
  
  if (data != false)
  {
  $("#status-mail").html(data);
  }
  
  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("");
  
  }
  
  }); // Fim do POST
  }); // Fim do Click
  }); // Fim do Document Read
  
  
  
  
  
  
  /***********************************
  * CONTADOR DE CARACTERES
  ************************************/
  $(document).ready(function(){
  
  $("#mensagem").keyup(function(){
  
  var limite   = 500;
  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);
  }
  
				})
  });
  
  
  /***************************
  * MENU RAPIDO
  ****************************/
  $(document).ready(function(){
  
  $(".trigger").click(function(){
  $(".panel").slideToggle("slow");
  $(this).toggleClass("active"); return false;
  });
  });
  
  
  /*****************************
  * TOPO SITE FLASH
  *******************************/
  
  function topheaderflash(fileurl, width, height, id, wmode, version ,flashvars) 
  {
  var params = {'wmode':wmode};
  var attributes = {'id':id};	
  swfobject.embedSWF(fileurl, id, width, height, version,"/template/tpl2/swf/expressInstall.swf", flashvars, params, attributes)
  so.useExpressInstall('/template/tpl2/expressinstall.swf');
  }
  
  
  
  if (screen.width == "1024" && screen.height == "768")
  {
 topheaderflash("/template/tpl2/swf/header-top-1024x768.swf", "1024", "412", "topheaderflash", "transparent", "11",{});
  
  }
  
  if (screen.width == "1280" && screen.height == "1024")
  {
  
 topheaderflash("/template/tpl2/swf/header-top.1280x1024.swf", "1256", "412", "topheaderflash", "transparent", "11",{});
  
  }
  
  
  if (screen.width == "1366" && screen.height == "768")
  {
  
topheaderflash("/template/tpl2/swf/header-top-1366x768.swf", "1366", "412", "topheaderflash", "transparent", "11",{});
  
  }
  else
  {
topheaderflash("/template/tpl2/swf/header-top-1366x768.swf", "1366", "412", "topheaderflash", "transparent", "11",{});
  }
  

