
var _run = false;
var prop = 1;
var scrolling = false;
var _start = 0;
var _now = 0;

function initScroll(div)
{
	_scrollHeight = div.scrollHeight;
	_offsetHeight = div.offsetHeight;
	div.scrollTop = _offsetHeight;
	_scrollHeight = div.scrollTop;
	div.scrollTop = 0;
	_scrollHeight = _offsetHeight + _scrollHeight;
	if (_offsetHeight/_scrollHeight<1)
	{
		_run = true;
		prop = _offsetHeight/_scrollHeight;
		_scrollheight = document.getElementById("lrcol_div_scroll").style.height = 288*prop + "px";
		document.getElementById("lrcol_div_scroll").style.display = "block";
	}
}

function startScroll(event)
{
	scrolling = true;
	_start = event.pageY || (event.clientY + (document.documentElement.scrollTop || document.body.scrollTop));
	document.body.onselectstart = function () { return false; };
}

function stopScroll(event)
{
	scrolling = false;
	document.body.onselectstart = null;
}

function moveScroll(event)
{
	if (scrolling)
	{
		_now = event.pageY || (event.clientY + (document.documentElement.scrollTop || document.body.scrollTop));
		dy = _now - _start;
		document.getElementById("div_scroll").scrollTop = document.getElementById("div_scroll").scrollTop + dy/prop;
		document.getElementById("lrcol_div_scroll").style.margin = 13 + ((parseInt((document.getElementById("div_scroll").scrollTop)*prop)+288*prop>288)?288-288*prop:parseInt((document.getElementById("div_scroll").scrollTop)*prop)) + "px 13px 0 14px";
		_start = _now;
	}
}
