
if (top == self) {
	testcookie = 'testcookie=' + Math.random();
	document.cookie = testcookie;
	if (document.cookie.indexOf(testcookie) == -1) {
		top.location.replace('exodos07_prizorisca.php?location='+escape(document.location.href));
	} else {
		document.cookie = 'location='+escape(document.location.href);
		top.location.replace('exodos07_prizorisca.php');
	}
} else {
	top.document.title = document.title;
}

stepsmall = 2;
stepbig = 10;

document.scrollUpTimer = false;
document.scrollDownTimer = false;

function scrollDown(id) {
	elt = document.getElementById(id);
	if (elt.scrollHeight > elt.scrollTop + stepsmall) {
		elt.scrollTop += stepsmall;
		document.scrollDownTimer = self.setTimeout('scrollDown("'+id+'");',10);
	} else {
		elt.scrollTop = elt.scrollHeight;
		clearTimeout(document.scrollDownTimer);
	}
}

function scrollUp(id) {
	elt = document.getElementById(id);
	if (0 < elt.scrollTop - stepsmall) {
		elt.scrollTop -= stepsmall;
		document.scrollUpTimer = self.setTimeout('scrollUp("'+id+'");',10);
	} else {
		elt.scrollTop = 0;
		clearTimeout(document.scrollUpTimer);
	}
}

function scrollDownFast(id) {
	elt = document.getElementById(id);
	if (elt.scrollHeight > elt.scrollTop + stepbig) {
		elt.scrollTop += stepbig;
		document.scrollDownTimer = self.setTimeout('scrollDownFast("'+id+'");',10);
	} else {
		elt.scrollTop = elt.scrollHeight;
		clearTimeout(document.scrollDownTimer);
	}
}

function scrollUpFast(id) {
	elt = document.getElementById(id);
	if (0 < elt.scrollTop - stepbig) {
		elt.scrollTop -= stepbig;
		document.scrollUpTimer = self.setTimeout('scrollUpFast("'+id+'");',10);
	} else {
		elt.scrollTop = 0;
		clearTimeout(document.scrollUpTimer);
	}
}

function output_scroller(id) {
	elt = document.getElementById(id);
	if (elt.scrollHeight > elt.clientHeight) {
		document.write('<a href="#" onmousedown="clearTimeout(document.scrollUpTimer); scrollUpFast(\'tekst\');" onmouseup="clearTimeout(document.scrollUpTimer); scrollUp(\'tekst\'); blur();" onmouseover="scrollUp(\'tekst\');" onmouseout="clearTimeout(document.scrollUpTimer);"><img src="images/scroll_up.gif" border="0" alt="up" onmouseover="this.src=\'images/scroll_up_over.gif\';" onmouseout="this.src=\'images/scroll_up.gif\';" /></a><br />');
		document.write('<a href="#" onmousedown="clearTimeout(document.scrollDownTimer); scrollDownFast(\'tekst\');" onmouseup="clearTimeout(document.scrollDownTimer); scrollDown(\'tekst\'); blur();" onmouseover="scrollDown(\'tekst\');" onmouseout="clearTimeout(document.scrollDownTimer)"><img src="images/scroll_down.gif" border="0" alt="down" onmouseover="this.src=\'images/scroll_down_over.gif\';" onmouseout="this.src=\'images/scroll_down.gif\';" /></a><br />');
	}
}

function handle(delta) {
	step = stepbig*4;
	elt = document.getElementById('tekst');
	
	if (delta < 0) {
		if (elt.scrollHeight > elt.scrollTop + step) {
			elt.scrollTop += step;
		} else {
			elt.scrollTop = elt.scrollHeight;
		}
		clearTimeout(document.scrollDownTimer);

	} else {
		if (0 < elt.scrollTop - step) {
			elt.scrollTop -= step;
		} else {
			elt.scrollTop = 0;
		}
		clearTimeout(document.scrollDownTimer);
	}
}

function wheel(event) {
	var delta = 0;

	if (!event) {
		event = window.event;
	}

	if (event.wheelDelta) {
		delta = event.wheelDelta/120;
		if (window.opera) {
			delta = -delta;
		}
	} else if (event.detail) {
		delta = -event.detail/3;
	}

	if (delta) {
		handle(delta);
	}

	if (event.preventDefault) {
		event.preventDefault();
	}

	event.returnValue = false;

}

if (window.addEventListener) {
	window.addEventListener('DOMMouseScroll', wheel, false);
}
window.onmousewheel = document.onmousewheel = wheel;

