x = 0;
show = 0;
speed = 6;
var crossobj=document.getElementById? document.getElementById("content") : document.all.content
//var scroller=document.getElementById? document.getElementById("scroller") : document.all.scroller
var contentheight=crossobj.offsetHeight
procent = crossobj.style.top


function movedown(){
	
	if (window.moveupvar)clearTimeout(moveupvar);
		
	if (parseInt(crossobj.style.top)>=(contentheight*(-1)+260)){
		crossobj.style.top = parseInt(crossobj.style.top)-speed+"px";
		if (show == 0){
			document ["scrolldwn"].src = eval("ScrollDwnH.src");
			show = 1;
		}
	}
	
	movedownvar = setTimeout("movedown()",20);
	showhidescroll();

}
function moveup(){
	if (window.movedownvar)clearTimeout(movedownvar);
	
	
	if (parseInt(crossobj.style.top)<=-5){
		crossobj.style.top=parseInt(crossobj.style.top)+speed+"px";
		if (show == 0){
			document ["scrollup"].src = eval("ScrollUpH.src");
			show = 1;
		}
	}
	
	moveupvar=setTimeout("moveup()",20);
	showhidescroll();

}
function stopscroll(){

	if (window.moveupvar) clearTimeout(moveupvar);
	if (window.movedownvar) clearTimeout(movedownvar);
	show = 0;
		
	document ["scrollup"].src = eval("ScrollUp.src");
	document ["scrolldwn"].src = eval("ScrollDwn.src");
}
function showhidescroll(){
	
	y=0;
	x++;
	
	if (x < 2)movedown();
	if (x > 1 && x < 3)moveup();
	if (parseInt(crossobj.style.top)<=-10)y++;
	if (parseInt(crossobj.style.top)>=(contentheight*(-1)+260))y++;
	if (y > 0){
	
		procent = parseInt(crossobj.style.top)*(-1);
		procent = procent / (contentheight - 260);
		procent = Math.round(procent * 100);
		procent = Math.round(procent * 1.9);
		procent = procent - 7;
		if (procent > 182)procent = 182;
		document.getElementById("scroller").style.top= procent+"px";
	
		document.getElementById('scroller').style.visibility = 'visible';
		document.getElementById('scrollerdiv').style.visibility = 'visible';
		document.getElementById('scrollerdwn').style.visibility = 'visible';
		document.getElementById('scrollerup').style.visibility = 'visible';
	}else{
		document.getElementById('scroller').style.visibility = 'hidden';
		document.getElementById('scrollerdiv').style.visibility = 'hidden';
		document.getElementById('scrollerdwn').style.visibility = 'hidden';
		document.getElementById('scrollerup').style.visibility = 'hidden';
	}	
	
	
	
	
	
}

function getcontent_height(){
	contentheight=crossobj.offsetHeight;
}

window.onload=getcontent_height

