stepcarousel.setup({
	galleryid: 'carousel_main',
	scrolldirection: 'horizontal',
	beltclass: 'item_list', //class of inner "belt" DIV containing all the panel DIVs
	panelclass: 'item', //class of panel DIVs each holding content
	autostep: { enable: false },
	panelbehavior: { speed: 250, wraparound: false, persist: false },
	defaultbuttons: { enable: false },
	userbuttons: { enable: true, nextid: 'works_next', previd: 'works_prev', moveby: 3 },
	statusvars: ['carousel_mainA', 'carousel_mainB', 'carousel_mainC'], //register 3 variables that contain current panel (start), current panel (last), and total panels
	onslide:function() {
		//$('#works_prev, #works_next').removeClass('inactive');
		$('#works_prev').css('background-image', 'url(files/img/works_arrow_left.png)');
		$('#works_next').css('background-image', 'url(files/img/works_arrow_right.png)');
		//alert($('#works_prev').attr('class')+' - '+$('#works_next').attr('class'));
		if(carousel_mainA == 1) {
			//$('#works_prev').addClass('inactive');
			//alert($('#works_prev').attr('class'));
			$('#works_prev').css('background-image', 'url(files/img/works_arrow_left_inactive.png)');
		}
		if(carousel_mainB == carousel_mainC) {
			//$('#works_next').addClass('inactive');
			//alert($('#works_next').attr('class'));
			$('#works_next').css('background-image', 'url(files/img/works_arrow_right_inactive.png)');
		}
	},
	contenttype: ['inline'] //content setting ['inline'] or ['external', 'path_to_external_file']
});

var selected_page = 1;

stepcarousel.setup({
	galleryid: 'carousel_projects',
	scrolldirection: 'horizontal',
	beltclass: 'item_list', //class of inner "belt" DIV containing all the panel DIVs
	panelclass: 'screen', //class of panel DIVs each holding content
	autostep: { enable: false },
	panelbehavior: { speed: 250, wraparound: false, persist: false },
	defaultbuttons: { enable: false },
	userbuttons: { enable: true, nextid: 'portfolio_next', previd: 'portfolio_prev', pageclass: '.paging .page', moveby: 1 },
	statusvars: ['carousel_projectsA', 'carousel_projectsB', 'carousel_projectsC'], //register 3 variables that contain current panel (start), current panel (last), and total panels
	oninit:function() {
		$('#portfolio .projects').css('height', $('.screen[pos='+carousel_projectsA+']').height()+'px');

	},
	onslide:function() {
		$(".paging .page").removeClass('selected');
		$(".paging .page[pos="+carousel_projectsA+"]").addClass('selected');
		selected_page = carousel_projectsA;

		$('#portfolio_prev, #portfolio_next').removeClass('inactive');
		if(carousel_projectsA == 1) {
			$('#portfolio_prev').addClass('inactive');
		}
		if(carousel_projectsB == carousel_projectsC) {
			$('#portfolio_next').addClass('inactive');
		}
		if($('.screen[pos='+carousel_projectsA+']').height() > $('#portfolio .projects').height())
		{
			$('#portfolio .projects').css('height', $('.screen[pos='+carousel_projectsA+']').height()+'px');
		}
	},
	contenttype: ['inline'] //content setting ['inline'] or ['external', 'path_to_external_file']
});

stepcarousel.setup({
	galleryid: 'carousel_clients',
	scrolldirection: 'horizontal',
	beltclass: 'item_list', //class of inner "belt" DIV containing all the panel DIVs
	panelclass: 'screen', //class of panel DIVs each holding content
	autostep: { enable: false },
	panelbehavior: { speed: 250, wraparound: false, persist: false },
	defaultbuttons: { enable: false },
	userbuttons: { enable: true, nextid: 'portfolio_next', previd: 'portfolio_prev', pageclass: '.paging .page', moveby: 1 },
	statusvars: ['ccarousel_clientsA', 'carousel_clientsB', 'carousel_clientsC'], //register 3 variables that contain current panel (start), current panel (last), and total panels
	onslide:function() {
		$(".paging .page").removeClass('selected');
		$(".paging .page[pos="+ccarousel_clientsA+"]").addClass('selected');

		$('#portfolio_prev, #portfolio_next').removeClass('inactive');
		if(ccarousel_clientsA == 1) {
			$('#portfolio_prev').addClass('inactive');
		}
		if(carousel_clientsB == carousel_clientsC) {
			$('#portfolio_next').addClass('inactive');
		}

		//$('#portfolio .projects').css('height', $('.screen[pos='+ccarousel_clientsA+']').height()+'px');
	},
	contenttype: ['inline'] //content setting ['inline'] or ['external', 'path_to_external_file']
});

$(document).ready(function(){
	$(".paging .page[pos="+selected_page+"]").addClass('selected');
});