$(function()
{
	$('#latMais').carouFredSel
	({
		auto: false,
		items: 5,
		direction: "top",
		prev: "#btAnt",
		next: "#btProx",
		infinite: false,
		circular: false
	});
	$('#latMais_2').carouFredSel
	({
		auto: false,
		items: 3,
		direction: "top",
		prev: "#btAnt_2",
		next: "#btProx_2",
		infinite: false,
		circular: false
	});
	$('#latMais_3').carouFredSel
	({
		auto: false,
		items: 3,
		direction: "top",
		prev: "#btAnt_3",
		next: "#btProx_3",
		infinite: false,
		circular: false
	});
	$('#maisFotos').carouFredSel
	({
		auto: false,
		items: 3,
		prev: "#fotoAnt",
		next: "#fotoProx",
		infinite: false,
		circular: false
	});
});

/*
    Nivoslider
*/
$(window).load(function() {
	$('#slider').nivoSlider({
		effect:'random',
		slices:15,
		animSpeed:1000, // Tempo de translação
		pauseTime:8000, // Tempo de apresentação
		startSlide:0, //Set starting Slide (0 index)
		directionNav:true, //Next & Prev
		directionNavHide:true, //Only show on hover
		controlNav:true, //1,2,3...
		controlNavThumbs:false, //Use thumbnails for Control Nav
		controlNavThumbsSearch: '.jpg', //Replace this with...
		controlNavThumbsReplace: '_thumb.jpg', //...this in thumb Image src
		keyboardNav:true, //Use left & right arrows
		pauseOnHover:true, //Stop animation while hovering
		manualAdvance:false, //Force manual transitions
		captionOpacity:0.8, //Universal caption opacity
		beforeChange: function(){},
		afterChange: function(){},
		slideshowEnd: function(){} //Triggers after all slides have been shown
	});
});

/*
    VisualLightBox
*/
jQuery(document).ready(function(){ window.Lightbox = new jQuery().visualLightbox({autoPlay:true,borderSize:21,classNames:'vlightbox,vlightbox1',descSliding:true,enableRightClick:false,enableSlideshow:true,overlayOpacity:0.4,resizeSpeed:7,slideTime:4,startZoom:true}) });

/*
    Campos
*/
$(document).ready(function()
{
	$('#popup').animate({opacity:"1.0"}, "slow");
	
	$('#fechar_popup').click(function (){
		$('#popup').animate({opacity:"hide"}, "slow");
	});
	
	// menu	
    $('#menu ul li').hover(
		function ()
		{
			$('ul', this).slideDown(300);
			$('ul li ul', this).hide(0);
		},
		function ()
		{
			$('ul', this).slideUp(300);
		}
	);
	
    // mascara
	$("#telefone").mask("(99) 9999-9999");
	$("#cpf").mask("999.999.999-99");
	$("#cep").mask("99999-999");
	$("#cnpj").mask("99.999.999/9999-99");
	$("#dataNasc").mask("99/99/9999");
	
	// tooltip
	$('a').easyTooltip();
	$('area').easyTooltip();
	$('div').easyTooltip();
	$('label').easyTooltip();
});

/*
    HighSlider
*/
hs.graphicsDir = 'plugins/highSlider/img/';
hs.outlineType = 'rounded-white';
hs.wrapperClassName = 'draggable-header';

/*
    Verificacao
*/

function formNewsletter() 
{
	var newsletter = document.forms['newsletter'];
	
    if (newsletter['nome'].value=='') 
	{
   	    alert('O campo "Nome" não pode ficar em branco!');
	   newsletter['nome'].focus();
	    return false;
    }
	if (newsletter['email'].value=='') 
	{
   	    alert('O campo "E-mail" não pode ficar em branco!');
	    newsletter['email'].focus();
	    return false;
    }
}

function formContato() 
{
	var cont = document.forms['contato'];
	
    if (cont['nome'].value=='') 
	{
   	    alert('O campo "Nome" não pode ficar em branco!');
	    cont['nome'].focus();
	    return false;
    }
	if (cont['email'].value=='') 
	{
   	    alert('O campo "E-mail" não pode ficar em branco!');
	    cont['email'].focus();
	    return false;
    }
	if (cont['assunto'].value=='') 
	{
   	    alert('O campo "Assunto" não pode ficar em branco!');
	    cont['assunto'].focus();
	    return false;
    }
	if (cont['mensagem'].value=='') 
	{
   	    alert('O campo "Mensagem" não pode ficar em branco!');
	    cont['mensagem'].focus();
	    return false;
    }
}
