$(document).ready(function(){
	
    $('table tr:odd').addClass('par');

	$('.gallery br').remove();
	
	$('.gallery li a').after(function()
	{
		return '<span>' + $(this).children().attr('title') + '</span>';
	});
	$('.gallery dl dt a').after(function()
	{
		return '<span>' + $(this).children().attr('title') + '</span>';
	});
	$('.gallery').cycle({
		fx: 'fade',
		timeout: 3000
	});
	$('.saudade').cycle({
		fx: 'fade',
		timeout: 6000
	});
	$('.clientes').cycle({
		fx: 'fade',
		timeout: 6000
	});
	$('.index').after(function()
	{
		return '<span>' + $(this).attr('title') + '</span>';
	});
	
	//imagens da clinica
	/* $('.index').cycle({
		fx: 'fade',
		timeout: 3000
	}); */
	
	//banner rotativo lateral esquerda
	$('#section-left').cycle({
		fx: 'fade',
		timeout: 5000
	});
	
	$('.thumbnail').parent().fancybox();
	
	$('.attachment-thumbnail').parent().fancybox();
	
	$('ul.equipe li').click(function()
	{
		$(this).toggleClass('destaque');
		$(this).children('ul').toggle('normal');
		return(false);
	});
	
	
	
	$('#btn_enviar').click(function(e) {
		e.preventDefault();
		var Dados = $('#frm_contato').serialize();
		
		$.ajax({
			url: 'wp-content/themes/salvare/contato.php',
			dataType: 'html',
			type: 'POST',
			data: Dados,
			beforeSend:function() {
				$('#frm_contato').remove();
				$('#localization').after('<div id="frm_contato"><h2 id="title">contato</h2></div>');
				$('#frm_contato h2').after('<label>Enviando...</label>');
			},
			success: function() {
				$('#frm_contato label').remove();
				$('#content #frm_contato h2').after('<label>E-mail enviado com sucesso</label>');
			},
			error: function() {
				$('#frm_contato label').remove();
				$('#content #frm_contato h2').after('<label>Houve algum erro no envio. Por favor tente mais tarde. Obrigado</label>');
			}
		});
		return false;
	});
	
	$('#social').hover(function() {
		$("#social").animate(
		{
			top: '0px'
		},'slow');	
	}, function() {
		$('#social').animate(
		{
			top: '-25px'
		},'slow');
	})
	
});
