function checkSupplyBox(t) {
	if (document.getElementById('props').value == '' || document.getElementById('contact').value == '') {
		alert(t);
		return false;
	} else {
		return true;
	}
}

function setWhat(i, frm) {
    document.forms[frm].elements['what'].value=i;
}

function setAction(a, frm) {
    document.forms[frm].elements['action'].value=a;
    if (a=='del'||a=='del_sch') return confirm('Biztosan törölni akarod?');
    else return true;
}

function doSubmit(frm) {
    document.forms[frm].submit();
}

function setValues(i,a,f) {
    setWhat(i, f);
    if (setAction(a, f)) doSubmit(f);
}

function showModalDlg(url, name, features, forcewindowopen) {
  wheight = 400;
  wwidth = 660;
  wleft = (screen.width - wwidth) / 2;
  wtop = (screen.height - wheight) / 2;
  wcenter = 'no';
  wlocation = 'no';
  wmenubar = 'no';
  wresizable = 'no';
  wscrollbars = 'yes';
  wstatus = 'no';
  wtoolbar = 'no';
  // ez a sor kell debugolashoz:
  //forcewindowopen = 1;
  if (forcewindowopen != 1)
    forcewindowopen = 0;
  featurelist = features.split(';');
  for (i=0;i<featurelist.length;i++) {
    data = featurelist[i].split('=');
    switch (data[0]) {
      case "height": wheight = data[1]; break;
      case "width": wwidth = data[1]; break;
      case "top": if (wcenter != 1) { wtop = data[1]; } break;
      case "left": if (wcenter != 1) { wleft = data[1]; } break;
      case "scrollbar": wscrollbars = data[1]; break;
      case "centered": wcenter = 'yes'; break;
      case "locationbar": wlocation = 'yes'; break;
      case "menubar": wmenubar = 'yes'; break;
      case "statusbar": wstatus = 'yes'; break;
      case "toolbar": wtoolbar = 'yes'; break;
      case "resizable": wresizable = 'yes'; break;
    }
  }
  if (wcenter = 1) {
    wleft = (screen.width - wwidth) / 2;
    wtop = (screen.height - wheight) / 2;
  }
  if ((forcewindowopen == 0) && (window.showModalDialog)) {
    fl = 'dialogHeight: ' + wheight + 'px;dialogWidth=' + wwidth + 'px;dialogLeft=' + wleft + 'px;dialogTop=' + wtop +
         'px;scroll=' + wscrollbars + ';status=' + wstatus + ';resizable=' + wresizable;
    window.showModalDialog(url, '', fl);
  }
  else {
    fl = 'height=' + wheight + ',width=' + wwidth + ',left=' + wleft + ',top=' + wtop +
         ',location=' + wlocation + ',scrollbars=' + wscrollbars + ',menubar=' + wmenubar +
         ',status=' + wstatus + ',toolbar=' + wtoolbar + ',resizable=' + wresizable;
    window.open(url, '', fl);
  }
}

function getElByID(idVal, numofparents) {
   // igy mar elirhatom a fuggveny nevet
   return getElById(idVal, numofparent);
}

function getElById(idVal, numofparents)
  {
  p = '';
  for (i=0;i<numofparents;i++)
    p = p + 'parent.';
  if (document.getElementById != null)
    return eval(p + 'document.getElementById(idVal)');
  if (document.all != null)
    return eval(p + 'document.all[idVal]');

  alert("Hiba! A böngésző nem támogatja: getElById()")
  return null
  }

function PageLoaded() {
  midtop = getElById('middletop');
  midtext = getElById('middletext');
  load = getElById('loading');
  if (load != null) {
    load.style.display = 'none'; }
  if (midtop != null) {
    midtop.style.visibility = 'visible'; }
  if (midtext != null) {
    midtext.style.visibility = 'visible'; }
}

function startCountDown(min) {
  window.setTimeout('timeoutReminder()', (min - 5) * 60 * 1000);
}

function timeoutReminder() {
  alert('Kérem frissítse az oldalt, különben a kapcsolat a kiszolgálóval 3 perc múlva megszakad, és újra be kell jelentkeznie!');
}

function changeDivVisibility(n) {
	_div = getElById(n+'_selector');
	if (_div.style.display == 'none') _div.style.display = 'block';
	else _div.style.display = 'none';
}