$(function(){
	
	if($.browser.msie)
	{
		$('body').append('<div class="aviso">Para uma melhor apresentação dessa página utilize um navegador com mais recursos como <a href="https://www.google.com/chrome/" target="_blank">Google Chrome</a> ou <a href="http://br.mozdev.org/download/" target="_blank">Firefox</a>.</div>');
	}	
	
	$.tooltip();

	$("a").hover(function(){
		var div = $(this).attr("class");
		$("#"+div+" .off").animate({
			opacity: 0
		}, "slow")
		$("#"+div+" div ul").slideDown(800);
		$(this).mouseout(function(){
			$("#"+div+" div ul").hide(400);
			$("#"+div+" .off").animate({
				opacity: 1
			}, "800")
		});	
	});
	
	$(".thumbnail").hover(function(){
			var hover = $(this).find('.hover');
			var sH = hover.outerHeight();
			hover.css({top : -(sH)}).animate({top : 0}, 400);
			
			var span = $(this).find('span');
			var spH = span.outerHeight();
			span.css({top : -(spH)}).animate({top : 10}, 600);
			
	}, function(){
			var span = $(this).find('span');
			var spH = span.outerHeight();
			span.animate({top : -(spH)}, 200);
			
			var hover = $(this).find('.hover');
			var sH = hover.outerHeight();
			hover.animate({top : -(sH)}, 600);
	});
	
/*Adicionando Classes*/
	$('p.more a').addClass('button verde');
	$('p.more').addClass('align-right');
	
	$('.is_form input').bind('blur', function() {
		if( $(this).val() == '') {
			$(this).prev().animate({
				'left'		:	10,
				'opacity'	:	1
			}, 500);
		}
	}).bind('focus', function() { 
		$(this).prev().animate({
			'left'		:	$(this).width() - 5 - $(this).prev().width(),
			'opacity'	:	0.1
		}, 300);
	});
	
	
	$("a.totop, .main nav a, .bt").click(function() {
		$("html, body").animate({
			scrollTop: $($(this).attr("href")).offset().top + "px"
		}, {
			duration: 600,
			easing: "swing"
		});
		return false;
	});

		$('.tabs_area').slideTabs({
		seletorPainel : 'div div',
		seletorAreaPainel: '.tabs_conteudo',
		seletorMiniatura: 'ul.tabs li',
		tempo: 1000,
		inicial: 1,
		alturaAutomatica: true
	})
	
	$.fn.loopedSlider.defaults.addPagination = true;
      
	$('#loopedSlider').loopedSlider({
		autoStart: 3500,
		hoverPause: true
	});
	
	$('#testemunhos').slideTabs({
		auto: true,
		tempo: 1000,
		pausa: 4000,
		easing: 'easeOutElastic'
	});

});




/*____________________________
slider_tv
____________________________
*/
$(function(){
	function carrosel_depoimentos_initCallback(carousel) {
		$('#slider_tv').bind('click', function() {
			carousel.next();
			return false;
		});
		$('#slider_tv ').bind('click', function() {
			carousel.prev();
			return false;
		});
      };
	$(document).ready(function() {
		$("#slider_tv").jcarousel({
			scroll:1,
			auto: 0,
			animation: 1000,
			wrap: 'string',
			initCallback: carrosel_depoimentos_initCallback,
			buttonNextHTML: null,
			buttonPrevHTML: null
		});
	});			
});


