stepcarousel.setup({
galleryid: 'mygallery', //id of carousel DIV
beltclass: 'belt', //class of inner "belt" DIV containing all the panel DIVs
panelclass: 'content-box', //class of panel DIVs each holding content
autostep: {enable:false, moveby:1, pause:3000},
onslide: function() {
	showSpin(lastFolder + statusB, statusB);
},
panelbehavior: {speed:500, wraparound:false, persist:false},
defaultbuttons: {enable: false, moveby: 1, leftnav: ['img/317e0s5.gif', -5, 80], rightnav: ['img/33o7di8.gif', -20, 80]},
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']
});

function showSpin(folder, i) {
	for (x = 1; x <= 5; x++) $('#spin'+x).html('');
	$('.categories li').each(function(i) {
		$(this).removeClass('selected');
	})

	if (i == 4) {
		var str = '<div class="object"><object width="380" height="350"><param name="movie" value="flash-scrollers/'+folder+'/spin.swf"><param name="quality" value="high"><param name="bgcolor" value="#ffffff"><embed src="flash-scrollers/'+folder+'/spin.swf" quality="high" bgcolor="#ffffff" width="380" height="350"></object></div>';
	}
	else {
		var str = '<div class="object"><object width="350" height="350"><param name="movie" value="flash-scrollers/'+folder+'/spin.swf"><param name="quality" value="high"><param name="bgcolor" value="#ffffff"><embed src="flash-scrollers/'+folder+'/spin.swf" quality="high" bgcolor="#ffffff" width="350" height="350"></object></div>';
	}

	lastFolder = folder.substr(0, folder.length-1);
	$('#spin'+i).html(str);

	var pos1 = Math.round($('#shoes'+i).offset().left);
	var pos = Math.round($('#'+folder).offset().left) - pos1;
	pos = pos + 35;
	$('#note'+i).css('margin-left', pos + 'px');
	$('#'+folder).addClass('selected');
}

function submitForm() {
	if ($('#contact_name').val() == '') {
		alert('Please enter your name!');
	}
	else if ($('#contact_email').val() == '') {
		alert('Please enter your email address!');
	}
	else if ($('#contact_message').val() == '') {
		alert('Please enter a message!');
	}
	else {
		$('#wait1').hide();
		$('#wait2').show();
		$.post('sendmail.php?ajax=1', $('#contact-us').serialize(), function(data){
			if (data == 'ok') {
				window.location.href = 'contact-thanks.php';
			}
			else {
				$('#wait1').show();
				$('#wait2').hide();
				alert(data);
			}
		});
	}
	return false;
}

animatedcollapse.addDiv('1', 'fade=0,speed=400,group=advantages,hide=1')
animatedcollapse.addDiv('2', 'fade=0,speed=400,group=advantages,hide=1')
animatedcollapse.addDiv('3', 'fade=0,speed=400,group=advantages,hide=1')
animatedcollapse.addDiv('4', 'fade=0,speed=400,group=advantages,hide=1')
animatedcollapse.addDiv('5', 'fade=0,speed=400,group=advantages,hide=1')
animatedcollapse.addDiv('6', 'fade=0,speed=400,group=advantages,hide=1')
animatedcollapse.addDiv('7', 'fade=0,speed=400,group=advantages,hide=1')
animatedcollapse.addDiv('8', 'fade=0,speed=400,group=advantages,hide=1')
animatedcollapse.addDiv('9', 'fade=0,speed=400,group=advantages,hide=1')
animatedcollapse.addDiv('10', 'fade=0,speed=400,group=advantages,hide=1')
animatedcollapse.addDiv('11', 'fade=0,speed=400,group=advantages,hide=1')
animatedcollapse.addDiv('12', 'fade=0,speed=400,group=advantages,hide=1')

animatedcollapse.ontoggle=function($, divobj, state){ //fires each time a DIV is expanded/contracted
//$: Access to jQuery
//divobj: DOM reference to DIV being expanded/ collapsed. Use "divobj.id" to get its ID
//state: "block" or "none", depending on state
}
animatedcollapse.init()
