function startScroll(horizontal_direction){

	

	proceedScroll(horizontal_direction);

	

}



function proceedScroll(offset_value){

	var sign = offset_value == 0 ? 0 : (offset_value < 0 ? -1 : 1);

	dx = Math.abs(offset_value/5);

	dx = dx > 1 ? dx : 1;

	var new_offset_value = sign * (Math.abs(offset_value) - dx);

	if (Math.round(new_offset_value) == 0) {

			return;

	}

	var picture_container = document.getElementById('picture_container');

	var picture_table = document.getElementById('picture_table');

	

	if (picture_table.clientWidth  <= picture_container.parentNode.clientWidth){

		return;

	}

	

	var old_offset  = parseInt(picture_container.style.marginLeft);

	

	if(isNaN(old_offset)){

		old_offset = 0;		

	}

	var new_left = old_offset + new_offset_value;

	if (new_left >= 0){

		picture_container.style.marginLeft = '0px';

		return;

	}		

	var max_offset = -(picture_table.clientWidth  - picture_container.parentNode.clientWidth);



	if (new_left < max_offset)

	{

		picture_container.style.marginLeft = max_offset + 'px';

		return;

	}



	picture_container.style.marginLeft = new_left + 'px';

	setTimeout('proceedScroll('  + new_offset_value + ');', 40);

}


