// JavaScript Document

$(document).ready(function() {

	$(".widget-wrapper").each(function(i){
		$(this).addClass("widget_"+i);
	});
	
	 if ($('#video_player')[0]) {
		$('#video_player').load("/templates/bubbles/templates_cj5753/floating/aventuralearningcenter/Black/en/gfx/video.html object");
	 }
	 
	$(".page-template").append("<div class='clear'></div>");

	 if ($('#headerindex')[0]) {
	
		$('#headerindex').nivoSlider({
			effect:'fold', //Specify sets like: 'fold,fade,sliceDown'
			slices:12,
			animSpeed:500, //Slide transition speed
			pauseTime:8000,
			startSlide:0, //Set starting Slide (0 index)
			directionNav:false, //Next & Prev
			directionNavHide:true, //Only show on hover
			controlNav:false, //1,2,3...
			controlNavThumbs:false, //Use thumbnails for Control Nav
			controlNavThumbsFromRel:false, //Use image rel for thumbs
			controlNavThumbsSearch: '.jpg', //Replace this with...
			controlNavThumbsReplace: '_thumb.jpg', //...this in thumb Image src
			keyboardNav:false, //Use left & right arrows
			pauseOnHover:true, //Stop animation while hovering
			manualAdvance:false, //Force manual transitions
			captionOpacity:0.8, //Universal caption opacity
			beforeChange: function(){},
			afterChange: function(){},
			slideshowEnd: function() {
				var sliderData = $('#headerindex').data("nivo:vars"); // pull the nivoSlider data from the jquery object
				sliderData.stop = false; // stop the animation
				} //Triggers after all slides have been shown
		});
	 }
});
