﻿function mExt(jmeno, url, tlp, predmet, trida)
{
	if (predmet == "1") predmet = 'Dotaz';
	if (predmet == "2") predmet = 'Informace';

document.write ("<a hr" + "ef='' onclick='mExtClick(\"" + jmeno + "\",\"" + url + "\",\"" + tlp + "\",\"" + predmet + "\"); return false;' class=\"" + trida + "\">" + jmeno + "<span></span>" + "@" + "<span></span>" + url + "<span></span>" + "." + tlp + "</a>");
}

function mExtClick(jmeno, url, tlp, predmet)
{
	location.href = "mailto:" + jmeno + "@" + url + "." + tlp + "?subject=" + predmet;
}

function mExtArea(jmeno, url, tlp, predmet, n1, n2, n3, n4)
{
	document.write ("<area shape='rect' coords='" + n1 + "," + n2 + "," + n3 + "," + n4 + "' hr" + "ef='mailto:" + jmeno + "@" + url + "." + tlp + "?subject=" + predmet + "'");
}

function getkey(e)
{ 
  var code; 
  if (!e)
    var e = window.event;
  if (e.keyCode)
    code = e.keyCode;
  else
    if (e.which)
      code = e.which;
  return code; 
} 
    
function numeric(eX)
{
  test=getkey(eX);
  if (test<48 || test>57)
    return false;
}

function okno($width, $height, $foto)
{
	$left = screen.width / 2 - $width / 2;
	$top = screen.height / 2 - $height / 2;
	okno1 = window.open ($foto, "", "width=" + $width + ", height=" + $height + ", left=" + $left + ", top=" + $top + ", menubar=no, toolbar=no, directories=no, status=no, resizable=yes, copyhistory=no");
}

function getWindowWidth()
{
    var $width;
    if (window.innerWidth) 
    {
        $width = window.innerWidth;
    }
    else
    {
        $width = document.documentElement.offsetWidth;
    }
    return $width;
}

function getWindowHeight()
{
    var $height;
    if (window.innerHeight) 
    {
        $height = window.innerHeight;
    }
    else
    {
        $height = document.documentElement.offsetHeight;
    }
    return $height;
}
