var total_clicks = 0;
var position = 0;
var a = 0;
var interval = 39.2;
var int2 = interval;

function addOne(total) {
	total_clicks++;
	if (total_clicks >= total){
		hideBlock('index_right_right-arrow');
		showBlock('index_right_right-arrow-spacer');
	} else {
		hideBlock('index_right_right-arrow-spacer');
		showBlock('index_right_right-arrow');
	}
}

function subOne(total) {
	total_clicks--;
	if (total_clicks >= total){
		hideBlock('index_right_right-arrow');
		showBlock('index_right_right-arrow-spacer');
	} else {
		hideBlock('index_right_right-arrow-spacer');
		showBlock('index_right_right-arrow');
	}
	if (total_clicks == 0){
		hideBlock('index_right_left-arrow');
		showBlock('index_right_left-arrow-spacer');
	}
}

function moveIndexRightRight() {
	if (position>-(1426)) position-=interval;
	moveIndexRightElement(position);
	if (a<6)
	{
		if (a==5) interval=5;
		setTimeout("moveIndexRightRight()", 20);
		a++;
	} else {
		a = 0;
		interval=int2;
	}
}

function moveIndexRightLeft() {
	if (position<-(interval)){ position+=interval; }
	else { position=0; }
	moveIndexRightElement(position);
	if (a<6)
	{
		if (a==5) interval=5;
		setTimeout("moveIndexRightLeft()", 20);
		a++;
	} else {
		a = 0;
		interval=int2;
	}
}

function moveIndexRightElement() {
	smallimage = document.getElementById('index_right_images').style;
	smallimage.marginLeft = position + 'px';
}

function resetIndexRightPosition() {
	position=0;
}
