var panelAnzahl = 0;
stepcarousel.setup({
	galleryid: 'stoererWrap', //id of carousel DIV
	beltclass: 'stoererContent', //class of inner "belt" DIV containing all the panel DIVs
	panelclass: 'stoererDatensatz', //class of panel DIVs each holding content
	panelbehavior: {speed:1000, wraparound:false, persist:true, wrapbehavior:"slide"},
	defaultbuttons: {enable: false, moveby: 1, leftnav: ['/bilder/leftnav.gif', -30, 100], rightnav: ['/bilder/rightnav.gif', 10, 100]},
	autostep: {enable:true, moveby:1, pause:6000},
	statusvars: ['statusA', 'statusB', 'statusC'], // Register 3 "status" variables
	contenttype: ['inline'] // content type <--No comma following the very last parameter, always!
});


$(document).ready(function() {

	panelAnzahl = $(".stoererDatensatz").size();
	if($(".stoererDatensatz").size()<=1) {
		stepcarousel.stopAutoStepMan('stoererWrap');
	}
	
	var stoerer = $.cookie('FUCHS_SSF_STOERER');
	
	if(stoerer == "true") {
		openStoerer();
	} else if (stoerer=="false") {
		closeHeader();
	} else {
		openStoerer();
	}
	
	
});

function closeHeader() {
	$.cookie('FUCHS_SSF_STOERER', 'false', { path: '/' });
	$('#stoererWrap').hide();
	$('#stoererContent').hide();
	$('#stoererShadow').hide();
	$('#stoererMantel').hide();
	$('#stoererOverall').hide();
	if(panelAnzahl>0) {
		$('#stoererOpenButton').show();
	}
	$('body').css( {backgroundPosition: "top center"} );
}

function openStoerer() {
	$.cookie('FUCHS_SSF_STOERER', 'true', { path: '/' });
	$('#stoererWrap').show();
	$('#stoererContent').show();
	$('#stoererShadow').show();
	$('#stoererMantel').show();
	$('#stoererOverall').show();
	$('#stoererOpenButton').hide();
	$('body').css( {backgroundPosition: "center 210px"} );
}


