/*
 * Last edit: 20 july 2006
 * 100 Procent JAVASCRIPT
 * 
 * Author: Nephuse.nl
 *
 */

function addLoadEvent(func) {
	var oldonload = window.onload;
	if (typeof window.onload != 'function') {
		window.onload = func;
	} else {
		window.onload = function() {
			oldonload();
			func();
    	}
  	}
}

function init() {
	parseLinks(); // XHTML compliant links
	getcontent_height();
}

function parseLinks() {
	if (!document.getElementById) return;

	var a = document.getElementsByTagName('a'), i = a.length;
	while (i--) {
		if (a.item(i).getAttribute('rel') == 'external') {
			a.item(i).onclick = function() { window.open(this.href); return false; }
		}
	}
}

/* scroll script */
speed=5 //specify speed of scroll (greater=faster)

function movedown(){
	crossobj = document.getElementById? document.getElementById("contentText") : document.all.contentText
	contentheight = crossobj.offsetHeight
	if (parseInt(crossobj.style.top)>=(contentheight*(-1)+100))
		crossobj.style.top=parseInt(crossobj.style.top)-speed+"px"
	
	movedownvar = setTimeout("movedown()",20)
}

function moveup(){
	crossobj = document.getElementById? document.getElementById("contentText") : document.all.contentText
	contentheight = crossobj.offsetHeight
	if (parseInt(crossobj.style.top)<=0)
		crossobj.style.top=parseInt(crossobj.style.top)+speed+"px"

	moveupvar = setTimeout("moveup()",20)
}

function getcontent_height(){
	crossobj = document.getElementById? document.getElementById("contentText") : document.all.contentText
	contentheight = crossobj.offsetHeight
	contentheight = crossobj.offsetHeight
}
/* scroll script */

addLoadEvent(init); // Init scripts

