var NAVI_TOP_ABS = 216;
var navi_top = -1;
var navi_left = 3;
var navi_bottom = -1;
var navi_right = 194;

var _m = 96;
var _s = 64;

var text = new Array("news", "info", "account", "teilnehmer", "sitzplan", "fifa", "location", /*"sponsoren",*/ "orgateam", "sponsoren", "lan rulez", "forum");
var linx = new Array("news", "info", "register", "userlist", "seatingplan", "fifa", "location", /*"sponsors",*/ "orgateam", "sponsors", "lanrulez", "forum");

function func(maxx, maxy, x) {
	var a = 2 * maxy / Math.pow(maxx, 3);
	var b = -3 * a * maxx / 2;
	return a * Math.pow(x, 3) + b * Math.pow(x, 2) + maxy;
}

function setNavigatorStyle(e) {
	var dst, shift;

	updateMousePos( e );

	for (i = 0; i < text.length; i++) {
		var thisspan = new getObj('span' + i);

		if ((mx >= navi_left) && (mx <= navi_right))
			dst = Math.abs(thisspan.obj.yAbs - my);
		else
			dst = _m + 1;

		shift = (dst <= _m) ? func(_m, _s, dst) : 0;
		thisspan.style.left = shift;
	}
}

function initNavigator() {
	for (i = 0; i < text.length; i++) {
		var link = (linx[i]) ? menuLink + "&content=" + linx[i] : "";

		document.write("<tr>");
		document.write("<td width='160' height='28' background='main_menu_track.jpg'>");
		document.write("<span id='span" + i + "' class='spanStyle'>");
		document.write("<table width='96' border='0' cellpadding='0' cellspacing='0'>");
		document.write("<tr>");
		document.write("<td width='96' height='24' align='center' background='main_menu_button.jpg'>");
		if (link) {
			document.write("<a href='" + link + "'>");
			document.write("<font color='#FFFFFF'><b>." + text[i] + ".</b></font>");
			document.write("</a>");
		} else {
			document.write("<font color='#999999'><b>." + text[i] + ".</b></font>");
		}
		document.write("</td>");
		document.write("</tr>");
		document.write("</table>");
		document.write("</span>");
		document.write("</td>");
		document.write("</tr>");

		var thisspan = new getObj('span' + i);
		thisspan.obj.yAbs = NAVI_TOP_ABS + i * 28 + 14;
		thisspan.style.left = 0;
	}
}

