﻿//------------------------------------------------------------------------------------
// Carrousel
//------------------------------------------------------------------------------------
function mycarousel_initCallback(carousel)
	{
		// Disable autoscrolling if the user clicks the prev or next button.
		carousel.buttonNext.bind('click', function() {
			carousel.startAuto(0);
		});

		carousel.buttonPrev.bind('click', function() {
			carousel.startAuto(0);
		});

		// Pause autoscrolling if the user moves with the cursor over the clip.
		carousel.clip.hover(function() {
			carousel.stopAuto();
		}, function() {
			carousel.startAuto();
		});
		
		 jQuery('#top-ten-next').bind('click', function() {
			carousel.next();
			return false;
		});
	
		jQuery('#top-ten-prev').bind('click', function() {
			carousel.prev();
			return false;
		});

	};

	jQuery(document).ready(function() {
		jQuery('#mycarousel').jcarousel({
			effect: 'fade',
			auto: 6,
			scroll: 1,
			wrap: 'last',
			initCallback: mycarousel_initCallback
		});
		jQuery('#top-ten').jcarousel({
			auto: 6,
			scroll: 1,
			wrap: 'last',
			initCallback: mycarousel_initCallback,
			// This tells jCarousel NOT to autobuild prev/next buttons
			buttonNextHTML: null,
			buttonPrevHTML: null

		});
	});
//------------------------------------------------------------------------------------
// Définitions des coins ronds
//------------------------------------------------------------------------------------
addEvent(window, 'load', initCorners);

  function initCorners() {
    var rounded = {
      tl: { radius: 10 },
      tr: { radius: 10 },
      bl: { radius:  10},
      br: { radius: 10 },
      antiAlias: true
    }
    curvyCorners(rounded, ".rounded");
	
	var rounded = {
      tl: { radius: 10 },
      tr: { radius: 10 },
      bl: { radius:  0},
      br: { radius: 0 },
      antiAlias: true
    }
    curvyCorners(rounded, ".rounded-top");
	
	var rounded = {
      tl: { radius: 10 },
      tr: { radius: 10 },
      bl: { radius: 0},
      br: { radius: 0 },
      antiAlias: true
    }
    curvyCorners(rounded, ".demi-blanc");
	
	var rounded = {
      tl: { radius: 0 },
      tr: { radius: 0 },
      bl: { radius: 10},
      br: { radius:10 },
      antiAlias: true
    }
    curvyCorners(rounded, ".rounded-bottom");
 }
 
