var af_colforum_scrollObj=null, af_colforum_scrollTimeout=null, af_colforum_scrollItv=null, af_colforum_scrollStart=0;
function af_colforum_scrollBegin() {
	clearTimeout(af_colforum_scrollTimeout);
	var obj=af_colforum_scrollObj, wh=window.innerHeight ? window.innerHeight : document.body.clientHeight;
	obj.s_dy=Math.max(0,Math.min(document.body.scrollTop-obj.s_y0,obj.parentNode.offsetHeight-obj.offsetHeight));
	if (obj.s_dy<obj.s_cy || obj.offsetHeight<wh*.75 || document.body.scrollTop-obj.s_y0+wh*.75>obj.s_cy+obj.offsetHeight) {
		clearInterval(af_colforum_scrollItv);
		af_colforum_scrollTimeout=setTimeout("af_colforum_scrollRealBegin();",500);
	}
}
function af_colforum_scrollRealBegin() {
	af_colforum_scrollStart=(new Date()).getTime();
	af_colforum_scrollItv=setInterval('af_colforum_scrollMove();',10);
}
function af_colforum_scrollMove() {
	var obj=af_colforum_scrollObj, d=(new Date()).getTime()-af_colforum_scrollStart;
	obj.s_cy+=(obj.s_dy-obj.s_cy)*(d/500); if (d>500) { obj.s_cy=obj.s_dy; af_colforum_scrollStart=0; clearInterval(af_colforum_scrollItv); }
	obj.style.top=obj.s_cy;
}
function af_colforum_scroll_init() {
	try {
		var obj=document.getElementById('af_colforum_scrolling'), o=obj;
		obj.style.position='relative'; obj.s_cy=0;
		if (obj.offsetParent) { obj.s_y0=obj.offsetTop; while (o=o.offsetParent) obj.s_y0+=o.offsetTop; }
		af_colforum_scrollObj=obj;
		
		af_colforum_onscroll2=window.onscroll;
		window.onscroll=function(e) { if (af_colforum_onscroll2) af_colforum_onscroll2(e); af_colforum_scrollBegin(); }
		af_colforum_scrollBegin();
	} catch(e) {}
}
try {
	af_colforum_onload2=window.onload;
	window.onload=function(e) { if (af_colforum_onload2) af_colforum_onload2(e); af_colforum_scroll_init(); }
} catch(e) {}
