﻿var c = "http://www.najednombrehu.cz/Obr/MP3/";
var d = "http://www.najednombrehu.cz/Obr/Video/";

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(obr, $width, $height)
{
	$left = screen.width / 2 - $width / 2;
	$top = screen.height / 2 - $height / 2;
	okno1 = window.open ("", "", "width=" + $width + ", height=" + $height + ", left=" + $left + ", top=" + $top + ", menubar=no, toolbar=no, directories=no, status=no, resizable=yes, copyhistory=no");
	okno1.document.write("<html><head><title>Najednombrehu.cz - náhled</title></head>");
	okno1.document.write("<body style='margin: 0px'>");
	okno1.document.write("<center><a href='' onclick='window.close();'><img src='" + obr + "' valign=center border=0></a></center>");
	okno1.document.write("</body></html>");
}

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;
}

function OnOver($id)
{
    var x = document.getElementById($id);
    x.style.backgroundColor = '#8a191f';
    x.style.color = 'white';
}

function OnOut($id)
{
    var x = document.getElementById($id);
    x.style.backgroundColor = 'white';
    x.style.color = 'black';
}

function ZobrazitNovyPrispevek()
{
    document.getElementById ("divNovyPrispevek").style.display = 'block';
}

var btnStatus = 0; //0-Play, 1-Stop, 2-Pause

function ImgOver(img)
{
    var h = document.getElementById("hiddenStatus").value;
    var x = document.getElementById(img);
    if (img == "btnPlay") { x.src = "./Obr/btnPlaySel.png"; }
    if (img == "btnStop") { x.src = "./Obr/btnStopSel.png"; }
    if (img == "btnPause") { x.src = "./Obr/btnPauseSel.png"; }
}

function ImgOut(img)
{
    var h = document.getElementById("hiddenStatus").value;
    var x = document.getElementById(img);
    if (img == "btnPlay" && h != "Play") { x.src = "./Obr/btnPlay.png"; }
    if (img == "btnStop" && h != "Stop") { x.src = "./Obr/btnStop.png"; }
    if (img == "btnPause" && btnStatus != 2) { x.src = "./Obr/btnPause.png"; }
}

function UvodOver(img)
{
    var x = document.getElementById(img);
    x.style.display = "inline";
}

function UvodOut(img)
{
    var x = document.getElementById(img);
    x.style.display = "none";
}

function PlayMP3 ($id)
{
    document.write("<embed src='/Prvky/player.swf' width='275' height='20' allowscriptaccess='always' allowfullscreen='false' flashvars='file="+c+$id+".mp3&autostart=true'/>");
    
}

function PlayVideo($id)
{
    if ($id == 2)
    {
        document.write("<embed src='/Prvky/player.swf' width='450' height='370' allowscriptaccess='always' allowfullscreen='true' flashvars='file="+d+"video.flv&autostart=true'/>");
    }
    else if($id == 1)
    {
        document.write("<object width='450' height='370'><param name='movie' value='http://www.youtube.com/v/-fvzuhpm5Xw&hl=cs&fs=1'></param><param name='allowFullScreen' value='true'></param><param name='allowscriptaccess' value='always'></param><embed src='http://www.youtube.com/v/-fvzuhpm5Xw&hl=cs&fs=1' type='application/x-shockwave-flash' allowscriptaccess='always' allowfullscreen='true' width='450' height='370'></embed></object>");
    }
    else if($id == 3)
    {
        document.write("<object width='450' height='370'><param name='movie' value='http://www.youtube.com/v/PqnMhXiSSzE&hl=cs_CZ&fs=1&'></param><param name='allowFullScreen' value='true'></param><param name='allowscriptaccess' value='always'></param><embed src='http://www.youtube.com/v/PqnMhXiSSzE&hl=cs_CZ&fs=1&' type='application/x-shockwave-flash' allowscriptaccess='always' allowfullscreen='true' width='450' height='370'></embed></object>");
    }
    else if($id == 4)
    {
        document.write("<object width='450' height='370'><param name='movie' value='http://www.youtube.com/v/vwcAK5b1dxM&hl=cs_CZ&fs=1&'></param><param name='allowFullScreen' value='true'></param><param name='allowscriptaccess' value='always'></param><embed src='http://www.youtube.com/v/vwcAK5b1dxM&hl=cs_CZ&fs=1&' type='application/x-shockwave-flash' allowscriptaccess='always' allowfullscreen='true' width='450' height='370'></embed></object>");
    }
    else if($id == 5)
    {
        document.write("<object width='450' height='370'><param name='movie' value='http://www.youtube.com/v/dEASTqrR-EE&hl=cs_CZ&fs=1&'></param><param name='allowFullScreen' value='true'></param><param name='allowscriptaccess' value='always'></param><embed src='http://www.youtube.com/v/dEASTqrR-EE&hl=cs_CZ&fs=1&' type='application/x-shockwave-flash' allowscriptaccess='always' allowfullscreen='true' width='450' height='370'></embed></object>");
    }
    else if($id == 6)
    {
        document.write("<object width='450' height='370'><param name='movie' value='http://www.youtube.com/v/seNTCutR_Xk&hl=cs_CZ&fs=1&'></param><param name='allowFullScreen' value='true'></param><param name='allowscriptaccess' value='always'></param><embed src='http://www.youtube.com/v/seNTCutR_Xk&hl=cs_CZ&fs=1&' type='application/x-shockwave-flash' allowscriptaccess='always' allowfullscreen='true' width='450' height='370'></embed></object>");
    }
    else if($id == 7)
    {
        document.write("<object width='450' height='370'><param name='movie' value='http://www.youtube.com/v/W8rexBJbTPQ&hl=cs_CZ&fs=1&'></param><param name='allowFullScreen' value='true'></param><param name='allowscriptaccess' value='always'></param><embed src='http://www.youtube.com/v/W8rexBJbTPQ&hl=cs_CZ&fs=1&' type='application/x-shockwave-flash' allowscriptaccess='always' allowfullscreen='true' width='450' height='370'></embed></object>");
    }
    else if($id == 8)
    {
        document.write("<object width='450' height='370'><param name='movie' value='http://www.youtube.com/v/eEFPEsBsyXc&hl=cs_CZ&fs=1&'></param><param name='allowFullScreen' value='true'></param><param name='allowscriptaccess' value='always'></param><embed src='http://www.youtube.com/v/eEFPEsBsyXc&hl=cs_CZ&fs=1&' type='application/x-shockwave-flash' allowscriptaccess='always' allowfullscreen='true' width='450' height='370'></embed></object>");
    }
}