// Credits: Robert Penners easing equations (http://www.robertpenner.com/easing/).
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;
	}
};

jQuery(document).ready(function() {
    jQuery('#mycarousel').jcarousel({
       // easing: 'BounceEaseOut',
		scroll: 1,
		auto: 4,
       // animation: 1000,
		wrap: 'last'
    });
	
	
	jQuery('#car_rodape').jcarousel({
		scroll: 1,
		auto: 6,
		wrap: 'last'
       
    });
	
	jQuery('#car-farid').jcarousel({
		scroll: 1,
		auto: 4,
		wrap: 'last'
       
    });
	
	jQuery('#car-salvador').jcarousel({
		scroll: 1,
		wrap: 'last'
       
    });
	
	jQuery('#car-paralela').jcarousel({
		scroll: 1,
		wrap: 'last'
       
    });
});


$(function()

			{

				// this initialises the demo scollpanes on the page.

				$('#pane1').jScrollPane();

				$('#pane2').jScrollPane({showArrows:true});

				$('#pane3, #pane4').jScrollPane({scrollbarWidth:20, scrollbarMargin:10});

                

				// this allows you to click a link to add content to #pane4 and shows how to 

				// reinitialise the scrollbars when you have done this.

				$('#add-content').bind(

					'click',

					function()

					{

						$('#pane4').append($('<p></p>').html($('#intro').html())).jScrollPane({scrollbarWidth:20, scrollbarMargin:10});

					}

				);

				// and this allows you to click the link to reduce the amount of content in

				// #pane4 and reinitialise the scrollbars.

				$('#remove-content').bind(

					'click',

					function()

					{

						$('#pane4').empty().append($('<p></p>').html($('#intro').html())).jScrollPane({scrollbarWidth:20, scrollbarMargin:10});

					}

				);

			});





		$(document).ready(function() {
			/*
			*   Examples - images
			*/

			$("a#example1").fancybox();

			$("a#example2").fancybox({
				'overlayShow'	: false,
				'transitionIn'	: 'elastic',
				'transitionOut'	: 'elastic'
			});

			$("a#example3").fancybox({
				'transitionIn'	: 'none',
				'transitionOut'	: 'none'	
			});

			$("a#example4").fancybox({
				'opacity'		: true,
				'overlayShow'	: false,
				'transitionIn'	: 'elastic',
				'transitionOut'	: 'none'
			});

			$("a#example5").fancybox();

			$("a#example6").fancybox({
				'titlePosition'		: 'outside',
				'overlayColor'		: '#000',
				'overlayOpacity'	: 0.9
			});

			$("a#example7").fancybox({
				'titlePosition'	: 'inside'
			});

			$("a#example8").fancybox({
				'titlePosition'	: 'over'
			});

			$("a[rel=example_group]").fancybox({
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'titlePosition' 	: 'over',
				'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
					return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
				}
			});

			/*
			*   Examples - various
			*/

			$("#various1").fancybox({
				'titlePosition'		: 'inside',
				'transitionIn'		: 'none',
				'transitionOut'		: 'none'
			});

			$("#various2").fancybox();

			$("#various3").fancybox({
				'width'				: '75%',
				'height'			: '75%',
				'autoScale'			: false,
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'type'				: 'iframe'
			});

			$("#various4").fancybox({
				'padding'			: 0,
				'autoScale'			: false,
				'transitionIn'		: 'none',
				'transitionOut'		: 'none'
			});
			
			
			$("#contato").validate();
		});
