jQuery(function($) {
	
	$('.slider').nivoSlider({
		effect:'random',
		slices:20,
		animSpeed:500,
		pauseTime:6000,
		startSlide:0,
		directionNav:true,
		directionNavHide:true,
		controlNav:true,
		keyboardNav:true,
		pauseOnHover:true,
		manualAdvance:false,
		captionOpacity:0.8
	});
	
	//make nivo bullets center regardless of the number of images
	var a_count = $('.nivo-controlNav a').size();
	a_count = parseInt(a_count);
	a_count = a_count * 28;
	var width = a_count;
	var x_pos = (($('.slider').parent().width() / 2) - (width  / 2)) - 5;
	
	$('.nivo-controlNav').css( {'left': x_pos} ).fadeIn();
	
	// modal windows
	$('.modal').colorbox({
		maxHeight: '100%',
		photo: true,
		speed: 750,
		opacity: 0.8,
		slideshow: true,
		slideshowAuto: false,
		slideshowSpeed: 5000,
		overlayClose: false
	});

});
