
stepcarousel.setup({
galleryid: 'step-hudebni-mix', //id of carousel DIV
beltclass: 'belt', //class of inner "belt" DIV containing all the panel DIVs
panelclass: 'panel', //class of panel DIVs each holding content
panelbehavior: {speed:500, wraparound:false, persist:true},
defaultbuttons: {enable: true, moveby: 1, leftnav: ['./template/classic/img/left_blue.gif', -23, 45], rightnav: ['./template/classic/img/right_blue.gif', 6, 45]},
statusvars: ['statusA', 'statusB', 'statusC'], //register 3 variables that contain current panel (start), current panel (last), and total panels
contenttype: ['inline'] //content setting ['inline'] or ['external', 'path_to_external_file']
})
stepcarousel.setup({
galleryid: 'step-filmovy-mix', //id of carousel DIV
beltclass: 'belt', //class of inner "belt" DIV containing all the panel DIVs
panelclass: 'panel', //class of panel DIVs each holding content
panelbehavior: {speed:500, wraparound:false, persist:true},
defaultbuttons: {enable: true, moveby: 1, leftnav: ['./template/classic/img/left_red.gif', -23, 45], rightnav: ['./template/classic/img/right_red.gif', 6, 45]},
statusvars: ['statusA', 'statusB', 'statusC'], //register 3 variables that contain current panel (start), current panel (last), and total panels
contenttype: ['inline'] //content setting ['inline'] or ['external', 'path_to_external_file']
})
stepcarousel.setup({
galleryid: 'step-fotoreporty', //id of carousel DIV
beltclass: 'belt', //class of inner "belt" DIV containing all the panel DIVs
panelclass: 'panel', //class of panel DIVs each holding content
panelbehavior: {speed:500, wraparound:false, persist:true},
defaultbuttons: {enable: true, moveby: 1, leftnav: ['./template/classic/img/left_black.gif', -23, 45], rightnav: ['./template/classic/img/right_black.gif', 6, 45]},
statusvars: ['statusA', 'statusB', 'statusC'], //register 3 variables that contain current panel (start), current panel (last), and total panels
contenttype: ['inline'] //content setting ['inline'] or ['external', 'path_to_external_file']
})


var CrossFade = {
	
	index : 0,
	intervalHandler : null,
	
	next : function() {
		var next_index = this.index;
//		alert($('#headline .subhead').size());
		if (next_index + 1 >= $('#headline .subhead').size()) {
			next_index = 0;
		} else {
			next_index++;
		}
		
		$($('#headline .subhead').get(this.index)).fadeOut('slow');
		$($('#headline .subhead').get(next_index)).fadeIn('slow');	
		
		this.index = next_index;
		
	},
	
	show : function(index) {
		$($('#headline .subhead').get(this.index)).fadeOut('slow');
		$($('#headline .subhead').get(index)).fadeIn('slow');	
		this.resetInterval();
		this.index = index;
	},
	
	init : function() {
		this.contents = new Array();
		$('#headline .subhead').each(function(i) {
			if (i != 0) {
				$(this).hide();
			}
		});
		
		$('#headline a.subheadimg').each(function(i) {
			$(this).click(function() {
				CrossFade.show(i);
				return false;
			});
			
		});
		
		this.resetInterval();
		
	},
	
	resetInterval : function() {
		if (this.intervalHandler != null) {
			window.clearInterval(this.intervalHandler);
		}
		this.intervalHandler = window.setInterval(function() { CrossFade.next(); }, 10000);
	}
	
	
}

$(document).ready(function() {
	CrossFade.init();
});
