﻿jQuery.easing['BounceEaseOut'] = function(p, t, b, c, d) {
	if ((t/=d) < (1/2.75)) {
		return c*(7.5625*t*t) + b;
	} else if (t < (2/2.75)) {
		return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
	} else if (t < (2.5/2.75)) {
		return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
	} else {
		return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
	}
};

$(document).ready(function() { 
	$('#mycarousel').jcarousel({
		scroll: 1,
		easing: 'BounceEaseOut',
		animation: 1000,
		wrap: 'last'
	});
	$(".fancy").fancybox({
		'hideOnContentClick': true,
		'overlayShow': true,
		'zoomSpeedIn': 500, 
		'zoomSpeedOut': 500
	});

// cores da tr impar
 //$("table tbody tr:nth-child(odd)").addClass("odd");

//hover table
	$('table tbody tr').hover(
		function(){ $(this).addClass("over");
	}, 
		function(){ $(this).removeClass("over"); 
	});


	/*
	$("#nav_ft a").hover(function() {
		$(this).animate({top: "-2"}, "slow");
	}, function() {
		$(this).animate({top: "0"}, "fast");
	});
	*/
//validar comentario
	if($("#answer")) {
		$("#answer").val("4");
	}
	$("#commentform").each(function() {
		$("#commentform").validate({
			rules: {
				comment: { required: true, maxlength: 2000 },
				author: { required: true },
				email: { required: true, email: true },
				question: { required: true, equalTo: "#answer" }
			},
			messages: {
				comment: "*Digite seu comentário",
				author: "*Dirite seu nome",
				email: "*Digite seu e-mail corretamente",
				question: "*Digite a resposta correta"
			},
			submitHandler: function(form) {
		        /*
				$(form).find("input, textarea, select").each(function(){
			        if($(this).val()==$(this).attr("title")){
			            $(this).val("");
			        }
			    }); */

				form.submit();
			}
		});
	});
}); 