more_scroll = '';
less_scroll = '';

function moveSlides(dir, id) {
    idName = id;
		target = document.getElementById(idName);
		targetUp = parseInt(target.style.top);

		if (target.scrollHeight > 560) {
			switch (dir) {
				case "down":
					magicNumber = 560 - parseInt(target.scrollHeight);
					if (targetUp <= magicNumber) { // Reached limit, stop scrolling
						target.style.top = magicNumber + 'px';
						clearTimeout(more_scroll);
						clearTimeout(less_scroll);
					} else {  // Scroll down
						target.style.top = (targetUp - 10) + 'px';
						more_scroll = setTimeout("moveSlides('down', idName)", 30);
						less_scroll = '';
					}
					break;
				case "up":
					if (targetUp >= 0) { // Reached limit, stop scrolling
						target.style.top = '0px';
						clearTimeout(more_scroll);
						clearTimeout(less_scroll);
					} else {  // Scroll up
						target.style.top = (targetUp + 10) + 'px';
						less_scroll = setTimeout("moveSlides('up', idName)", 30);
						more_scroll = '';
					}
					break;
				case "stop":
					clearTimeout(more_scroll);
					clearTimeout(less_scroll);
					break;
			}
		}
	}
