stepcarousel.setup({
galleryid: 'carouselWrapper', //id of carousel DIV
beltclass: 'belt', //class of inner "belt" DIV containing all the panel DIVs
panelclass: 'pod', //class of panel DIVs each holding content
panelbehavior: {speed:500, wraparound:false, persist:false},
defaultbuttons: {enable: false},
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']

oninit:function(){
this.$pod=jQuery('.pod');

$j(".scroll1 a").click(function(){
	
	stepcarousel.stepBy('carouselWrapper', -1);
	return false;
	
});

$j(".scroll2 a").click(function(){
	
	stepcarousel.stepBy('carouselWrapper', 1);
	return false;
});

},

onslide:function(){
for (var i=0; i<statusC; i++){
if (i>=statusA+2)
this.$pod.eq(i).addClass('podBuffer')
else 
this.$pod.eq(i).removeClass('podBuffer')
}

$j("#carouselWrapper .belt .pod:nth-child(" + statusA + ")").each(function(){
	 var height = $j(".stepcarousel").height(); 
	 var colHeight = $j(this).height();
	 var buttonMargin = (height - colHeight)-28; 
		             
	 $j('.slideControl .scroll1').css({'bottom' : buttonMargin});

		
});

$j("#carouselWrapper .belt .pod:nth-child(" + (statusA+1) + ")").each(function(){ 
		 var height = $j(".stepcarousel").height(); 
		 var colHeight = $j(this).height();
		 var buttonMargin = (height - colHeight)-28;  

		 $j('.slideControl .randomPost').css({'bottom' : buttonMargin}); 

});
	
$j("#carouselWrapper .belt .pod:nth-child(" + (statusA+2) + ")").each(function(){
	 var height = $j(".stepcarousel").height(); 
	 var colHeight = $j(this).height();
	 var buttonMargin = (height - colHeight)-28;  
 
	 $j('.slideControl .scroll2').css({'bottom' : buttonMargin}); 

});

if (statusA==1){
	$j('.scroll1').hide();
	}
	else {
		$j('.scroll1').show();
	}
	
if (statusB == statusC){
	$j('.scroll2').hide().dequeue();
	}
	else {
		$j('.scroll2').show();
	}   
    
}


});      
