

if (document.layers) {
	widthCheck = window.innerWidth;
	heightCheck = window.innerHeight;
	//window.onResize = resizeFix;
}
function resizeFix() {
	if (!document.layers) return;
	if (widthCheck != window.innerWidth || heightCheck != window.innerHeight)
		document.location.href = document.location.href;
}


function PageID(lvl, sublvl) {
	this.lvl = lvl;
	this.sublvl = sublvl;
}

		
// based on script by Urs Dudli and Peter Gehrig 

var scrollerWidth, scrollerHeight, scrollerLeft, scrollerTop, scrollerPause, scrollerStep;
var scrollerCLeft, scrollerCRight, scrollerCTop, scrollerCBtm;
var scrollTimer, scrollerTWidth, scrollerText;

function initScroll() {

	if (scrollTimer) clearTimeout(scrollTimer);

	winW = (document.layers)? window.innerWidth-16 : document.body.offsetWidth-20;
	if (winW < 775) winW = 775;
	scrollerLeft = Math.round((winW- 775) / 2) + 224;
	
	scrollerWidth=389;
	scrollerHeight = 14;
	scrollerStep=1;
	scrollerTop=140;
	scrollerPause=18;
	
	if (document.all) {
		text.innerHTML=scrollerText;
		scrollerTWidth=text.offsetWidth;
		document.all.text.style.posTop=scrollerTop;
		document.all.text.style.posLeft=scrollerLeft+scrollerWidth;
		scrollerCLeft=0; scrollerCRight=0; scrollerCTop=0; scrollerCBtm=scrollerHeight;
		document.all.text.style.clip ="rect("+scrollerCTop+" "+scrollerCRight+" "+scrollerCBtm+" "+scrollerCLeft+")";
		scrollText();
	}
	if (document.layers) {
		document.text.document.write(scrollerText);
		document.text.document.close();
		scrollerTWidth=document.text.document.width;
		document.text.top = scrollerTop;
		document.text.left = scrollerLeft+scrollerWidth;
		document.text.clip.left=0; document.text.clip.right=0; document.text.clip.top=0; document.text.clip.bottom = scrollerHeight;
		scrollText();
	}
}


function scrollText() {
	if (document.all) {
		if (document.all.text.style.posLeft >= scrollerLeft - scrollerTWidth) {
			document.all.text.style.posLeft -= scrollerStep;
			scrollerCRight += scrollerStep;
			if (scrollerCRight > scrollerWidth) scrollerCLeft += scrollerStep;
			document.all.text.style.clip ="rect("+scrollerCTop+" "+scrollerCRight+" "+scrollerCBtm+" "+scrollerCLeft+")";
			scrollTimer=setTimeout("scrollText()",scrollerPause);
		}
		else scrollReset();
	}

	if (document.layers) {
		if (document.text.left >= scrollerLeft - scrollerTWidth) {
			document.text.left -= scrollerStep;
			document.text.clip.right += scrollerStep;
			if (document.text.clip.right > scrollerWidth) document.text.clip.left += scrollerStep;
			scrollTimer=setTimeout("scrollText()",scrollerPause);
		}
		else scrollReset();
	}
}

function scrollReset() {
	if (document.all) {
		document.all.text.style.posLeft = scrollerLeft + scrollerWidth;
		scrollerCLeft=0; scrollerCRight=0;
		document.all.text.style.clip ="rect("+scrollerCTop+" "+scrollerCRight+" "+scrollerCBtm+" "+scrollerCLeft+")";
		scrollText();
	}

	if (document.layers) {
		document.text.document.write(scrollerText);
		document.text.document.close();
		document.text.left=scrollerLeft+scrollerWidth;
		document.text.clip.left=0; document.text.clip.right=0;
		scrollText();
	}
}

function scrollSpeed(inc) {
	if (inc == 0) scrollerStep = 0;
	else scrollerStep += inc;
	if (scrollerStep >= 20) scrollerStep = 20;
	if (scrollerStep<0) scrollerStep = 0;
}


function onWinResize() {
	resizeFix();
	initScroll();
	if (multitabs.length > 0)
		initMultitab();
}

// --- main init
var multitabs = new Array();
function initScroller() {
	initScroll();
	
	window.onresize = onWinResize;
}

