var scroll1, scroll2, twin=false;
function scroll_init() {
	scroll1=$('scroll');
	scroll2=document.createElement('ul');
	scroll2.innerHTML=scroll1.innerHTML;
	scroll2.style.position='absolute';
	scroll2.style.left='0px';
	scroll2.style.top=scroll1.parentNode.offsetHeight+'px';
	scroll1.style.top=scroll2.style.top;
	scroll1.style.display='block';
	scroll1.parentNode.appendChild(scroll2);
	setTimeout(scroll_events,200);
}
function scroll_events() {
	var t=parseInt(scroll1.style.top);
	
	if(scroll1.parentNode.offsetHeight-t>scroll1.offsetHeight)
		twin=true; //must move all 2 divs
	
	if(twin) {
		if(-t>scroll1.offsetHeight) {
			//end moving all 2 divs
			twin=false;
			scroll1.style.top=scroll1.parentNode.offsetHeight+'px';
			//swap the divs
			var temp=scroll1;
			scroll1=scroll2;
			scroll2=temp;
			t=parseInt(scroll1.style.top);
			scroll1.style.top=(t-1)+'px';
		}
		else {
			//move the 2 divs
			scroll1.style.top=(t-1)+'px';
			scroll2.style.top=(parseInt(scroll2.style.top)-1)+'px';
		}
	}
	else
		scroll1.style.top=(t-1)+'px';
	setTimeout(scroll_events,100);
}
scroll_init();