//  general scripts
$(function(){

	// hide JavaScript Info
	$(".js-info").hide();

	// redefine Cycle's updateActivePagerLink function
	$.fn.cycle.updateActivePagerLink = function(pager, currSlideIndex) {
		$(pager).find('li').removeClass('activeSlide')
			.filter('li:eq('+currSlideIndex+')').addClass('activeSlide');
	};

	// mainslider
	$('#mainslider').cycle({
		fx:     'fade, wipe',
		delay: 		5000,
		timeout:  	6000,
		speed:		1500,
		next:		'#mainslider',
		pager:  '#mainslider-nav',
		pagerAnchorBuilder: function(idx, slide) {
			// return sel string for existing anchor
			return '#mainslider-nav li:eq(' + (idx) + ') a';
		},
		pagerEvent:	'mouseover',
		pauseOnPagerHover: true,
		pause:   	1
	
	});

	// newsflash
    $('#head-newsflash').cycle({
		fx:			'wipe',
		delay: 		2000,
		timeout:  	6000,
		speed:		500,
		pause:   	1,
		clip:		'l2r',
		prev:		'#head-newsflash-prev',
		next:		'#head-newsflash-next',
		pause:   	1
	});

	// prettyPhoto
		$("a[rel^='prettyPhoto']").prettyPhoto({
			animation_speed: 'slow', /* fast/slow/normal */
			theme: 'pp_default' /* pp_default light_rounded / dark_rounded / light_square / dark_square / facebook */
		});

});

