// Manual Scroller- © Dynamic Drive 2001
// For full source code, visit http://www.dynamicdrive.com

// specify speed of scroll (greater=faster)
var speed=5

// rembember original speed
var origspeed = speed;

var fastspeed = 10;

var moveddown = 0;

iens6=document.all||document.getElementById
ns4=document.layers

function movedown(what){
	document.getElementById("scroll-up").style.visibility = "visible";
	moveddown = 1;
	origwhat = what;
	what = document.getElementById(what);
	contentheight = what.offsetHeight;
	
	if (origwhat == "news") layerheight = 459;	
	if (origwhat == "teaser") layerheight = 490;
	if (origwhat == "jobteaser") layerheight = 200;
	if (origwhat == "aspteaser") layerheight = 270;	

	if (window.moveupvar) clearTimeout(moveupvar)

	if (iens6 && parseInt(what.style.top) >= (contentheight*(-1)+layerheight)) what.style.top=parseInt(what.style.top)-speed+"px"
	what.top-=speed
	
	if(parseInt(what.style.top) < (contentheight*(-1)+layerheight)) {
		document.getElementById("scroll-down").style.visibility = "hidden";
	}
	
	movedownvar=setTimeout("movedown('"+origwhat+"')",20)
}

function moveup(what,value){
	if (moveddown || value != 'undefined') {
		document.getElementById("scroll-down").style.visibility = "visible";
		origwhat = what;
		what = document.getElementById(what);
		contentheight = what.offsetHeight;

		if (window.movedownvar) clearTimeout(movedownvar)

		if (iens6 && parseInt(what.style.top)<=0) what.style.top=parseInt(what.style.top)+speed+"px"
		
		if(parseInt(what.style.top) > 0) {
			document.getElementById("scroll-up").style.visibility = "hidden";
		}
		
		moveupvar=setTimeout("moveup('"+origwhat+"')",20)
	
	}
}

function stopscroll(what){
	if (window.moveupvar) clearTimeout(moveupvar)
	if (window.movedownvar) clearTimeout(movedownvar)
}

function teaseit(url) {
	whatever = document.getElementById('teaser').style.top;
	location.href=url+"?position="+whatever;
}

function teaseit2(url) {
	whatever = document.getElementById('jobteaser').style.top;
	location.href=url+"&position="+whatever;
}

function teaseit3(url) {
	whatever = document.getElementById('aspteaser').style.top;
	location.href=url+"&position="+whatever;
}

function teaseit4(url) {
	whatever = document.getElementById('teaser').style.top;
	var url2 = url.substring(0,url.indexOf("#"));
	location.href=url2+"?position="+whatever;
}