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() {
	ChangeSelectedCategiry(lastFolder + statusB, statusB);
	spin = new ISpin360('js-scrollers/', lastFolder + statusB, null, null, {namePattern:'FinalImg_'}, null, null, {id:'spin' + statusB,spinID:'spindiv' + statusB, spinButtonID:'spinbutton' + statusB, zoomButtonID:'zoombutton' + statusB, loaderButtonID:'loaderbutton' + statusB, menuButtonID:'menubutton2'});
},
panelbehavior: {speed:500, wraparound:false, persist:false},
defaultbuttons: {enable: false, moveby: 1, leftnav: ['http://i34.tinypic.com/317e0s5.gif', -5, 80], rightnav: ['http://i38.tinypic.com/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 ChangeSelectedCategiry(folder, i)
{
	for (x = 1; x <= 5; x++) $('#spin'+x).html('');
	$('.categories li').each(function(i) {
		$(this).removeClass('selected');
	})
	
	lastFolder = folder.substr(0, folder.length-1);
	
	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;
}


