function alternative_navigator(first) {
  var n = document.getElementById('flashmenu');
  var m = document.getElementById('mainMenu');
  var cookie = getCookie('alter_navi');

  if (first == undefined) first = false;

  if (n && m) {
    //alert("C: " + cookie + " F:" + first);
    if ((cookie == "0" && !first) || (cookie == "1" && first)) {
      n.style.display = "block";
      m.style.display = "none";
      if (! first) {
        setCookie('alter_navi', "1", 5);
      }
    } else {
      n.style.display = "none";
      m.style.display = "block";
      setCookie('alter_navi', "0", 5);
    }
    //alert("CO: " + cookie + " CN:" + getCookie('alter_navi') + " F:" + first);
  }
}

function createpopup(url, width, height) {
	var popupz = window.open(url, "", "width=" + width + ", height=" + height + ", resizable=no, menubar=no, toolbar=no, scrollbars=no, location=no, status=no");
        var x = (screen.width / 2) - (width / 2);
        var y = (screen.height / 2) - (height / 2);
	popupz.moveTo(x,y);
}

function setCookie(name,value,days) {
/*
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
*/
	var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function getCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function menuSupport() {
	var sfEls = document.getElementById("mainMenu").getElementsByTagName("LI");
	var foo = document.getElementById('mainMenu').getElementsByTagName("UL")[0];
	var selected = getElementsByClass(foo,'selected','*');
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			submenu = this.getElementsByTagName("UL")[0];
			if (window.attachEvent) { // Internet Explorer eseten
				this.className+=" sfhover";
				if (submenu) { // ha van almenuje
					submenu.style.left = this.offsetLeft + 55 + "px"; // almenu pozicio korrekcio
					submenu.style.width = 1000 - this.offsetLeft - 55; // almenu szelessegenek beallitasa IE alatt
				}
			}
			if (document.getElementById('home')) { // ha a fooldalon van
				if (submenu) { // ha van almenuje, akkor #mainMenu hattercsereje (megjelenik az almenu hattercsikja)
					document.getElementById('mainMenu').style.backgroundImage = "url(../img/bg-mainmenu-hover.gif)";
				}
			} else { // belso oldalon van
				if ((this.className.indexOf("selected") == -1) && (this.parentNode.parentNode.className.indexOf("selected") == -1)) {
					selected[0].getElementsByTagName("UL")[0].style.visibility="hidden";
				}
			}
		}
		sfEls[i].onmouseout=function() {
			if (window.attachEvent) { // Internet Explorer eseten
				this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
			}
			if (document.getElementById('home')) { // ha a fooldalon van
				document.getElementById('mainMenu').style.backgroundImage = "url(../img/bg-mainmenu.gif)";
			} else {
				selected[0].getElementsByTagName("UL")[0].style.visibility="visible";
			}
		}
	}
}

function getElementsByClass(node,searchClass,tag) {
	var classElements = new Array();
	var els = node.getElementsByTagName(tag); // use "*" for all elements
	var elsLen = els.length;
	var pattern = new RegExp("\\b"+searchClass+"\\b");
	for (i = 0, j = 0; i < elsLen; i++) {
		if ( pattern.test(els[i].className) ) {
			classElements[j] = els[i];
			j++;
		}
	}
	return classElements;
}

function body_unload() {
}

  