var position = 0;
var a = 0;
var interval = 20;
var int2 = interval;

function moveRight() {
	if (position>-(950)) position-=interval;
	moveElement(position);
	if (a<6)
	{
		if (a==5) interval=5;
		setTimeout("moveRight()", 20);
		a++;
	} else {
		a = 0;
		interval=int2;
	}
}

function moveLeft() {
	if (position<0) position+=interval;
	moveElement(position);
	if (a<6)
	{
		if (a==5) interval=5;
		setTimeout("moveLeft()", 20);
		a++;
	} else {
		a = 0;
		interval=int2;
	}
}

function moveElement() {

    trailery = document.getElementById('slider').style;
    // slider = document.getElementById('slider-button').style;

	trailery.marginLeft = position + 'px';
    // slider.marginLeft = -(position*0.475) + 'px';

}

function resetPosition() {
	position=0;
}
