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

$(document).ready(function(){
	$(".hover").hover(function () {
		$(this).children("ul").stop(true,true).fadeIn();
	}, function() {
		$(this).children("ul").stop(true,true).fadeOut();
	});
	$("#BodyArea #subMenu ul li a").hover(function () {
		$(this).append($("<span> &raquo;</span>"));
	}, function () {
		$(this).find("span:last").remove();
	});
	$("#Gallery a").fancybox({ 'zoomSpeedIn': 300, 'zoomSpeedOut': 300, 'overlayShow': true, 'overlayOpacity' : 0.8, 'overlayColor' : '#000' });

//jCarousel
	var startNumber = Math.floor(Math.random()*6)+1;
	//alert(startNumber);
    jQuery('#mycarousel').jcarousel({
        auto: 8, //Seconds between scroll
		start: startNumber, //Random start based on number of items 
        wrap: 'last',
		scroll: 1,
        initCallback: mycarousel_initCallback
    });
	
	$('#BackgroundSlideShow').cycle({ 
	   fx:     'wipe', 
	   speed:   2000, 
	   timeout: 10000, 
	   clip:   'l2r' 
	});

});
