function setupCarousel ( div ) {
	$("div#"+div+" div.carousel").jCarouselLite({
		visible: 1,
		circular: false,
		btnGo: ["div#"+div+" .item1","div#"+div+" .item2","div#"+div+" .item3","div#"+div+" .item4",
			"div#"+div+" .item5","div#"+div+" .item6","div#"+div+" .item7","div#"+div+" .item8"],
		speed: 800
	});
	$("div#"+div+" .item1").addClass("on");
	
	$("div#"+div+" .carousel_control_button").click(function() {
		$("div#"+div+" .carousel_control_button").removeClass('on');
		$(this).addClass('on');
	});
}

$(document).ready(function() {

	var divs = ["promo_left","promo_center","promo_right","artist_biography", "artist_photos","release_images","release_notes"];
	//var divs = ["promo_left","promo_center","promo_right","artist_biography", "artist_photos"];
	for ( var i in divs ) {
		if( $("div#"+divs[i]+" ul li").length > 0 ) {
			setupCarousel( divs[i] );
		}
	}

	if( $("div#artists div.carousel ul li").length > 0 ) {
		$("div#artists div.carousel").jCarouselLite({
			btnNext: "a#artists_next",
			btnPrev: "a#artists_prev",
			visible: 4,
			circular: false,
			speed: 800,
			scroll:1
		});
	}

	if( $("div#releases div.carousel ul li").length > 0 ) {
		$("div#releases div.carousel").jCarouselLite({
			btnNext: "a#releases_next",
			btnPrev: "a#releases_prev",
			visible: 3,
			circular: false,
			speed: 800,
			scroll:1
		});
	}

	$("a.read_more").fancybox({width:500,height:600,autoDimensions:false});
	$("a.video_more").fancybox({width:601,height:338,autoDimensions:true});

	$("div#header a.header_nav").mouseenter(
		function () {$("div#pop_nav").slideDown(200)} 
		//function () {$("div#pop_nav").show("slide",{direction:"up"},200)} 
	);
	$("div#pop_nav").mouseleave(
		function () {$(this).slideUp(200)} 
	);

	/* Show whale menu for the first time */
	if( $.cookie('whale_menu_show') == null ) {
		setTimeout($("div#header a.header_nav").mouseenter(),18000);
		$("div#pop_nav").delay(3000).mouseleave();
		$.cookie('whale_menu_show','done');
	}



});

