

//------------------------------------------------------------------------------
// Main object                                                                  
//------------------------------------------------------------------------------

Main =
{
	run: function()
	{
		this.include('jquery-1.2.1.pack.js');
		this.include('jquery.jcarousel.pack.js');
	},
	
	include: function(jsFile)
	{
		// with document.write we're sure that the script will be loaded and 
		// executed just after the current script and in the correct order 
		document.write('<script'
			+' type="text/javascript"'
			+' src="js/' +jsFile +'"></script>');
	}
};


//------------------------------------------------------------------------------
// Main initialization                                                          
//------------------------------------------------------------------------------

Main.run();


// Carousel initialisation //

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();
    });
};

// Fin carousel //
