window.onresize = function winresize()
  {
  reposlayers();
  }

window.onload = function winload()
  {
  init();
  }

function popup(kep, scroll)
  {
  if (scroll == null)
    {
    scroll = 'no';
    }
  page = '../favat/popup.php?kepfile=' + kep + '&scroll=' + scroll;
  w = 1;
  h = 1;
  l = 0;
  t = 0;
  settings = 'scrollbars=' + scroll + ',resizable=no,status=no,menubar=yes,width=' + w + ',height=' + h + ',left=' + l + ',top=' + t + ',screenX=' + l + ',screenY=' + t;
  win = window.open(page, 'popup21', settings);
  win.focus();
  }

function popupleiras(page, scroll, w, h)
  {
  if (w == null)
    {
    w = 721;
    }
  if (h == null)
    {
    h = 452;
    }
  h = h - 20;
  if (scroll == null)
    {
    scroll = 'no';
    }
  l = (window.screen.width - (w + 10)) / 2;
  t = (window.screen.height - (h + 75 + 62)) / 2;
  settings = 'scrollbars=' + scroll + ',resizable=no,status=no,menubar=no,width=' + w + ',height=' + h + ',left=' + l + ',top=' + t + ',screenX=' + l + ',screenY=' + t;
  win = window.open(page, 'popup1', settings);
  win.focus();
  }
function popupsitemap(page, scroll, w, h)
  {
  if (w == null)
    {
    w = 570;
    }
  if (h == null)
    {
    h = 430;
    }
  h = h - 20;
  if (scroll == null)
    {
    scroll = 'yes';
    }
  l = (window.screen.width - (w + 10)) / 2;
  t = (window.screen.height - (h + 55 + 62)) / 2;
  settings = 'scrollbars=' + scroll + ',resizable=no,status=no,menubar=yes,width=' + w + ',height=' + h + ',left=' + l + ',top=' + t + ',screenX=' + l + ',screenY=' + t;
  win = window.open(page, 'popupsitemap', settings);
  win.focus();
  }
function popupfull(page)
  {
  w = (window.screen.width - 10);
  h = (window.screen.height - 35);
  scrollb = 'no';

  l = (window.screen.availWidth - (w + 10)) / 2;
  t = (window.screen.height - (h + 35)) / 2;
  settings = 'scrollbars=' + scrollb + ',resizable=yes,status=nos,menubar=no,width=' + w + ',height=' + h + ',left=' + l + ',top=' + t + ',screenX=' + l + ',screenY=' + t;
  win = window.open(page, 'popup2', settings);
  win.focus();
  }

function reloadpage(init)
  { //reloads the window if Nav4 resized
  if (init == true)
    with (navigator)
      {
      if ((appName == "Netscape") && (parseInt(appVersion) == 4))
        {
        document.MM_pgW = innerWidth;
        document.MM_pgH = innerHeight;
        onresize = reloadpage;
        }
      }
  else if (innerWidth != document.MM_pgW || innerHeight != document.MM_pgH)
    location.reload();
  }

reloadpage(true);

function findobj2(n, d)
  { //v4.01
  var p, i, x;
  if (!d)
    d = document;
  if ((p = n.indexOf("?")) > 0 && parent.frames.length)
    {
    d = parent.frames[n.substring(p + 1)].document;
    n = n.substring(0, p);
    }
  if (!(x = d[n]) && d.all)
    x = d.all[n];
  for (i = 0; !x && i < d.forms.length; i++)
    x = d.forms[i][n];
  for (i = 0; !x && d.layers && i < d.layers.length; i++)
    x = findobj2(n, d.layers[i].document);
  if (!x && d.getElementById)
    x = d.getElementById(n);
  return x;
  }

function changeproperty(obj, theProp, theValue)
  { //v6.0
  obj = findobj(obj);
  if (obj && (theProp.indexOf("style.") == -1 || obj.style))
    {
    if (theValue == true || theValue == false)
      eval("obj." + theProp + "=" + theValue);
    else
	  {
	  if (theProp=="style.display" && theValue=="none" &&navigator.userAgent.indexOf('MSIE') == -1)
        {
		obj.style.display='block';
		obj.style.visibility='hidden';
		}
	  else if (theProp=="style.display" && theValue=="block" &&navigator.userAgent.indexOf('MSIE') == -1)
	    {
		obj.style.display='block';
		obj.style.visibility='visible';
		}
	  else
        eval("obj." + theProp + "='" + theValue + "'");
	  }
    }
  }

function findobj3(item)
  {
  if (window.mmIsOpera)
    return (document.getElementById(item));
  if (document.all)
    return (document.all[item]);
  if (document.getElementById)
    return (document.getElementById(item));
  return (false);
  }

function xpos(img)
  {
  img = findobj(img);
  x = 0;
  if (!document.layers)
    {
    var onWindows = navigator.platform ? navigator.platform == "Win32" : false;
    var macIE45 = document.all && !onWindows && getExplorerVersion() == 4.5;
    var par = img;
    var lastOffset = 0;
    while (par)
      {
      if (par.leftMargin && !onWindows)
        x += parseInt(par.leftMargin);
      if ((par.offsetLeft != lastOffset) && par.offsetLeft)
        x += parseInt(par.offsetLeft);
      if (par.offsetLeft != 0)
        lastOffset = par.offsetLeft;
      par = macIE45 ? par.parentElement : par.offsetParent;
      }
    }
  else if (img.x)
    x += img.x;
  return x;
  }

function ypos(img)
  {
  img = findobj(img);
  y = 0;
  if (!document.layers)
    {
    var onWindows = navigator.platform ? navigator.platform == "Win32" : false;
    var macIE45 = document.all && !onWindows && getExplorerVersion() == 4.5;
    var par = img;
    var lastOffset = 0;
    while (par)
      {
      if (par.topMargin && !onWindows)
        y += parseInt(par.topMargin);
      if ((par.offsetTop != lastOffset) && par.offsetTop)
        y += parseInt(par.offsetTop);
      if (par.offsetTop != 0)
        lastOffset = par.offsetTop;
      par = macIE45 ? par.parentElement : par.offsetParent;
      }
    }
  else if (img.y >= 0)
    y += img.y;
  return y;
  }

function findobj(imgname)
  {
  var obj = findobj2(imgname) || findobj3(imgname) || document.images[imgname] || document.links[imgname] || document.anchors[imgname];
  return obj;
  }

function reposlayer(mit, mihez, deltax, deltay)
  {
  changeproperty(mit, 'style.left', xpos(mihez) + deltax);
  changeproperty(mit, 'style.top', ypos(mihez) + deltay);
  //alert('mit:'+xpos(mihez)+' mihez:'+ypos(mihez));
  }

function reposlayers()
  {
  reposlayer('alm1', 'anchor_alm1', 120, 0);
  reposlayer('alm2', 'anchor_alm2', 120, 5);
  reposlayer('alm3', 'anchor_alm3', 120, 5);
  //reposlayer('alm4', 'anchor_alm4', 120, 5);
  //reposlayer('alm5', 'anchor_alm5', 120, 5);
  if (navigator.userAgent.indexOf('Opera') != -1)
    {
    document.body.className += ''; // force opera and other browsers to reflow (refresh)
    }
  }

function iepngfix()
  {
  var ua = navigator.userAgent.toLowerCase();
  if ((ua.indexOf("msie") != -1) && (ua.indexOf("opera") == -1) && (ua.indexOf("webtv") == -1))
    {
    for (i = 0; i < document.images.length; i++)
      {
      if (document.images[i].name != "notransp")
        {
        document.images[i].style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + document.images[i].src + "',sizingMethod='scale')";
        document.images[i].src = "1x1_transparent.gif"
        }
      }
    }
  }

function hideallsubmenu()
  {
  var i=1, elm;
  while (obj = findobj("alm" + i++))
    changeproperty(obj, 'style.visibility', 'hidden');
  }

function init()
  {
  //iepngfix();
  reposlayers();
  //hideallsubmenu();
  if (navigator.userAgent.indexOf('Netscape') != -1)
    {
    /*document.styleSheets[0].cssRules['div1'].overflow='hidden';
    changeproperty('div1','style.overflow','hidden');*/
    }
  if (navigator.userAgent.indexOf('MSIE') == -1)
    {
    /*changeproperty('table2','style.letterSpacing','1px');*/
    }
    /*if (obj = findobj('topmenu'))
    {
    ;
    obj.onmouseover = function topmenuover()
      {
      changeproperty('topmenu', 'style.height', '165px');
      }
    obj.onmouseout = function topmenuout()
      {
      changeproperty('topmenu', 'style.height', '38px');
      }
    }
   */
  }

var actualmenu = "";

function hideactivemenu()
  {
  var layer = actualmenu;
  if (layer != "")
    {
    changeproperty(layer, 'style.display', 'none');
    }
  }

var timeout;

function showMenu(layer, visible, over)
  {
  if (visible)
    actualmenu = layer;
  window.clearTimeout(timeout);
  if (visible)
    {
    changeproperty(layer, 'style.display', 'block');
    }
  else
    {
    changeproperty(layer, 'style.display', 'none');
    }
  window.status = over;
  if (over == 0)
    timeout = window.setTimeout("hideactivemenu()", 2000);
  }
function formell(object)
    {
		for(i=0;i<object.form.elements.length;i++)
		{
		if ((object.form.elements[i].type=="text" || object.form.elements[i].type=="textarea" || object.form.elements[i].type=="password") && object.form.elements[i].value == "")
		{
			alert('Töltsd ki az összes mezőt!');
			return false;
		}
		}
		return true;
	}
