﻿$(document).ready(function(){
//----------
	
	//------------------------------------------------------
	$("a").focus(function(){
		this.hideFocus=true;
	//------------------------------------------------------
	})
	
	//------------------------------------------------------
	cadNews = function()
	{
		if (_mail('EnviarEmail')) return false;
		$.post("_news.php", 'emailNews='+$('#EnviarEmail').val(),
			function(data){
				alert(data);
	
			});
	}
	
	var val = '0';
	send = function(){
		
		if (val == '0')
		{
		
		if (_vazio('emp','Empresa')) return false;
		if (_vazio('cont','Contato')) return false;
		if (_mail('mail')) return false;
		if (_vazio('cid','Cidade')) return false;
		if (_vazio('fone','Fone')) return false;
		if (_vazio('ass','Assunto')) return false;
		if (_vazio('msg','Mensagem')) return false;
		
		val = '1';
	
		$('#enviartxt').html('Enviando...');
		
		//------
		$.post("_mail.php", "acao=conCad&"+$('#fmCont').serialize(),
				  function(data){
					$('#enviartxt').html('Enviar');
					alert(data);
					document.getElementById('fmCont').reset();
					
				  });
		val = '0';
		}//---
	
	}
	
	pop_ = function(URL) { 

		var width = 700; 
		var height = 500; 
		
		var left = 99; 
		var top = 99; 
		
		window.open(URL,'janela', 'width='+width+', height='+height+', top='+top+', left='+left+', scrollbars=no, status=no, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=yes'); 
		
		} 
	
	//------------------------------------------------------
	enviaCont = function()
	{
		if (_vazio('nomeCont','NOME')) return false;
		if (_mail('mailCont')) return false;
		if (_vazio('telCont','TELEFONE')) return false;
		if (_vazio('assCont','ASSUNTO')) return false;
		if (_vazio('msgCont','MENSAGEM')) return false;
		
		$.post("contato.php", $('#fmCont').serialize(),
			function(data){
				alert(data);
				document.getElementById('fmCont').reset();
			});
	}
		
	//FUNÇÔES
	
	// Under and Sunder
	$(".Sunder").mouseover(function(){$(this).addClass('Under')});
	$(".Sunder").mouseout(function(){$(this).removeClass('Under')});

var i = 0;
var t = 10;
$('#pisca').fadeOut(500);

for(i=0;i<=50;i++)
{
	$('#pisca').fadeIn(500).delay(500).fadeOut(200);
}
	
//----------
})
