function start_posx(posx)
  {
  var stredx = (screen.availWidth) / 2;
  var sirka = posx;
  var startx = stredx - (sirka / 2);
  return startx;
  }

function start_posy(posy)
  {
  var stredy = (screen.availHeight) / 2;
  var vyska = posy;
  var starty = stredy - (vyska / 2);
  return starty;
  }

function start_popup(video)
  {
  var swvideo = video;
  window.open("sub_video.php?video="+swvideo, "new", "toolbar=no,location=no,scrollbars=no,width=450,height=340,resizable=no, left="+start_posx(700)+", top="+start_posy(390)+"");
  }
  
  function start_popup_max(video)
  {
  var swvideo = video;
  window.open("sub_video_max.php?video="+swvideo, "new", "toolbar=no,location=no,scrollbars=no,width=1074,height=630,resizable=no, left="+start_posx(0)+", top="+start_posy(0)+"");
  }

  function start_popup_youtube(video)
  {
  var swvideo = video;
  window.open("gefuhrte_quad_touren/sub_video.php?videonr="+swvideo, "new", "toolbar=no,location=no,scrollbars=no,width=585,height=380,resizable=no, left="+start_posx(700)+", top="+start_posy(390)+"");
  }

  function start_popup_adventure(video)
  {
  var swvideo = video;
  window.open("sub_video_adventure.php?videonr="+swvideo, "new", "toolbar=no,location=no,scrollbars=no,width=585,height=380,resizable=no, left="+start_posx(700)+", top="+start_posy(390)+"");
  }

  function openLoginWindow()
{
  showModalDialog("login.php",window,"dialogWidth:270px;dialogHeight:180px;help:no");
}

function fncLogin(user, password) {
  window.location.href = "index.php?text=expedice_rum4&user_name=" + user + "&user_pass=" + password
}

function fncRegister(user, password, nick, lang) {
  window.location.href = "index.php?text=expedice_rum4&lang=" + lang + "&user_name=" + user + "&user_pass=" + password + "&user_nick=" + nick
}

function fncRegisterStorno(lang) {
  location = "index.php?text=expedice_rum4&lang=" + lang
}

