
$(window).load(function()
{
	
	//slider
	$('.slider').nivoSlider({
        effect:'fade',
        animSpeed:500,
        pauseTime:4500,
        startSlide:0,
        directionNav:false,
        directionNavHide:true,
        controlNav:true,
        controlNavThumbs:false,
        controlNavThumbsFromRel:false,
        controlNavThumbsSearch: '.jpg',
        controlNavThumbsReplace: '_thumb.jpg',
        keyboardNav:true,
        pauseOnHover:true,
        manualAdvance:false,
        captionOpacity:0.8
    });
	$('.slider_2').nivoSlider({
        effect:'sliceDown',
        animSpeed:500,
        pauseTime:3800,
        startSlide:0,
        directionNav:true,
        directionNavHide:false,
        controlNav:false,
        controlNavThumbs:false,
        controlNavThumbsFromRel:false,
        controlNavThumbsSearch: '.jpg',
        controlNavThumbsReplace: '_thumb.jpg',
        keyboardNav:true,
        pauseOnHover:true,
        manualAdvance:false,
        captionOpacity:0.8
    });
	$('.slider_3').nivoSlider({
        effect:'fade',
        animSpeed:200,
        pauseTime:2000,
		manualAdvance:false,
        startSlide:0,
        directionNav:false,
        directionNavHide:false,
        controlNav:false,
        controlNavThumbs:false,
        controlNavThumbsFromRel:false,
        controlNavThumbsSearch: '.jpg',
        controlNavThumbsReplace: '_thumb.jpg',
        keyboardNav:false,
        pauseOnHover:false,
        manualAdvance:false,
        captionOpacity:0
    });
});

$(document).ready(function()
{
	//lightbox
	$('a.lightbox').lightBox();
	
	//menu	
	$('.dropdown').each(function ()
	{
		$(this).parent().eq(0).hover(function ()
		{
			$('.dropdown:eq(0)', this).stop(true, true).fadeIn(400);
		},
		function ()
		{
			$('.dropdown:eq(0)', this).stop(true, true).fadeOut(200);
		});
	});
	
	//pop eye
	
	 var options3 = {
		caption:    false,
		easing: 'swing'
	}

	$('.ppy3').popeye(options3);
	
	//inputs
	$('input[type="text"], textarea').addClass("idleField");
	
	$('input[type="text"], textarea').focus(function()
	{
		$(this).removeClass("idleField").addClass("focusField");
		if (this.value == this.defaultValue)
		{ 
			this.value = '';
		}
		if(this.value != this.defaultValue)
		{
			this.select();
		}
	});
	$('input[type="text"], textarea').blur(function()
	{
		$(this).removeClass("focusField").addClass("idleField");
		if ($.trim(this.value) == '')
		{
			this.value = (this.defaultValue ? this.defaultValue : '');
		}
	}); 
	
	//mascaras
	$('#telefone').mask('(99) 9999-9999');
}
);
