var dragapproved=false
var z,x,y,sd,speed,n;
var limit = 265;		//scrollbarheight-dragheight
var nijniylimit = 380;  //do kudi doljen spuskatsya memezok
var divH = 380;			// divheight-otstupsnizu(opredlyayetsya mnoy)
var actualHeight;
var dragapproved2=false;
var scrollTimer;

function moveTo(sd){

	if (sd>=0&&sd<=limit){
		z.style.top=sd;
		speed = -actualHeight/limit;
		document.all.news_div.style.top=sd*speed;
		to=sd*speed;
		return false;
	}
}

function move(){

if (event.button==1&&dragapproved&&dragapproved2) {

	if (event.clientY<15){
		n=0;
		moveTo(n);
	} else if (event.clientY>nijniylimit){
		n=limit;
		moveTo(n);
	} else {
		n=temp1+event.clientY-x;
		moveTo(n);
	}
	return false
}

}

function drags(){

if (event.srcElement.className=="drag"){

	if (document.all)
		actualHeight=news_div.offsetHeight-divH;

	if (actualHeight<=0){
		dragapproved2=false;
	} else {
		dragapproved2=true;
	}

	dragapproved=true
	z=event.srcElement
	temp1=z.style.pixelTop
	x=event.clientY
}

}

function stopScroll() {
clearTimeout(scrollTimer);
}

document.onmousemove=move
document.onmousedown=drags
document.onmouseup=new Function("dragapproved=false")
