
    // Explorerbenben 0, Firefoxban
    var firstChildNodeID = document.all ? 0 : 1;
    var secondChildNodeID = document.all ? 1 : 3;

    // Operát külön állítjuk be
    if (navigator.userAgent.indexOf("Opera") != -1) {
  
        firstChildNodeID = 1;
        secondChildNodeID = 3;

    }


    // laza workaround, CSS-ben nem ment
    function menuOver(m) {

        m.style.background = "#FFFFFF url("+url+"/template/images/menu_bg.gif) bottom left";
        m.childNodes[firstChildNodeID].style.paddingTop = "0px";
        m.childNodes[secondChildNodeID].style.display = "block";

    }

    // visszaállítunk mindent a helyére
    function menuOut(m) {

        m.style.background = "transparent";
        m.childNodes[firstChildNodeID].style.paddingTop = "91px";
        m.childNodes[secondChildNodeID].style.display = "none";

    }

    function setRolloversOnMenus() {

        navRoot = document.getElementById("menu");
        for (i=0; i<navRoot.childNodes.length; i++) {
            node = navRoot.childNodes[i];
            if (node.nodeName=="LI") {
                node.onmouseover=function() { menuOver(this); }
                node.onmouseout=function() { menuOut(this); }
            }
        }

    }

    window.onload = setRolloversOnMenus;
    
    // default legordulo id
    var actLegordulo = '';

    // legördülő menüpontok cseréje
    function legorduloChange(id, link) {

          if (actLegordulo) hideDiv("legordulo"+actLegordulo);
          if (actLegordulo != id) {
            showDiv("legordulo"+id);
            actLegordulo = id;
          } else {
            actLegordulo = '';
          }
          link.blur();

    }
    
    // láthatóvá tesz egy divet
    function showDiv(_id) {
      document.getElementById(_id).style.display = 'block';
    }
  
    // elrejt egy divet
    function hideDiv(_id) {
      document.getElementById(_id).style.display = 'none';
    }
    
    // megszakítja az üzenet írásást
    function discardMessage() {
  
        if (confirm("Biztosan meg akarja szakítani az üzenet írását? Az eddig beírt szöveg elveszik!")) {
            tinyMCE.setContent('');
            hideDiv('ujUzenetForm');
            showDiv('ujUzenetGomb');
        }
    }
    
    function emailValidation(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    return false
		 }

		 if (str.indexOf(" ")!=-1){
		    return false
		 }

 		 return true
    }

