var dragapproved=false
var z,x,y,sd,speed,n;
var limit = 232;   //scrollbarH-draggerH

function moveTo(sd){

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

}

function move(){

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

	if (event.clientY<25){
		n=0;
		moveTo(n);
	} else if (event.clientY>420){
		n=limit;
		moveTo(n);
	} else {
		n=temp1+event.clientY-x;
		moveTo(n);
	}

	return false
}

}

function drags(){

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

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

}

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


var to = 0;
var scrollTimer;
var actualHeight;
var dragapproved2=false;

function Load() {
if (document.all) {
actualHeight=scrolldiv.offsetHeight-445;
}

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

}


function vverx() {

	if (document.all&&scrolldiv.style.pixelTop>-actualHeight) {
		to=scrolldiv.style.pixelTop;
		to-=2;
		document.all.scrolldiv.style.top=to;
		scrollTimer=setTimeout("vverx()", 20);

		document.all.dgar.style.pixelTop=-to*limit/actualHeight;

	}
}


function vniz() {
	if (document.all&&scrolldiv.style.pixelTop<0) {
		to=scrolldiv.style.pixelTop;
		to+=2;
		document.all.scrolldiv.style.top=to;
		scrollTimer=setTimeout("vniz()", 20);

		document.all.dgar.style.pixelTop=-to*limit/actualHeight;
	}
}

function stopScroll() {
clearTimeout(scrollTimer);
}