/** image carousel effects **/
var curidx = 1;
var maxidx = 0;
var calgo = true;
$(document).ready(
	function() {
		maxidx = $('#mygallery .belt .panel').length;
		$('#gallerynextlink').click(function() {
			if(calgo == false) return false;
			calgo = false;
			curidx++;
			if(curidx>maxidx) curidx=1;
			hiliteDot(curidx);
			stepcarousel.stepBy('mygallery', 1);
			return false;
		});

		$('#galleryprevlink').click(function() {
			if(calgo == false) return false;
			calgo = false;
			curidx--;
			if(curidx<1) curidx=maxidx;
			hiliteDot(curidx);
			stepcarousel.stepBy('mygallery', -1);
			return false;
		});
	}			  
);
function hiliteDot(idx) {
	var ss = '#gallerynav'+idx;
	for(i=1;i<=maxidx;i++) $('#gallerynav'+i).attr('src','images/ad_nav/dot_b.gif');
	$(ss).attr('src','images/ad_nav/dot_a.gif');
}

stepcarousel.setup({
	galleryid: 'mygallery', //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
	autostep: {enable:true, moveby:1, pause:5000, resumeautostep:false},
	panelbehavior: {speed:500, wraparound:true, persist:false},
	defaultbuttons: {enable: false},
	statusvars: ['startA', 'startB', 'total'], //register 3 variables that contain current panel (start), current panel (last), and total panels
	onslide:function() {
		calgo = true;
		curidx = startA;
		hiliteDot(startA);
	},
	contenttype: ['inline'] //content setting ['inline'] or ['external', 'path_to_external_file']
});