function start(stranka)
{
	vytvorMediaPlayer("mediaPlayer");
}


/* ukaz obrazek */

function winH() {
   if (window.innerHeight)
      /* NN4 a kompatibilní prohlížeče */
      return window.innerHeight;
   else if
   (document.documentElement &&
   document.documentElement.clientHeight)
      /* MSIE6 v std. režimu - Opera a Mozilla
      již uspěly s window.innerHeight */
      return document.documentElement.clientHeight;
   else if
   (document.body && document.body.clientHeight)
      /* starší MSIE + MSIE6 v quirk režimu */
      return document.body.clientHeight;
   else
      return null;
}


function getScrollOffset()
{
	if(document.documentElement.scrollTop)
		return document.documentElement.scrollTop;
	if(window.pageYOffset)
		return window.pageYOffset;
	return document.body.scrollTop;
}

/*
function ukaz_obrazek(src, width, height)
{
	width += 25; height += 25;
  var okno = open("", "_blank", "width="+width+",height="+height+",scrollbars");
  okno.document.open();
  okno.document.writeln('<html>');
  okno.document.writeln('<head>');
  okno.document.writeln('<title>Foto</title>');
  okno.document.writeln('<meta http-equiv="imagetoolbar" content="no" />');
  okno.document.writeln('</head>');
  okno.document.writeln('<body style="margin: 0px; padding: 0px; cursor: pointer;" onclick="window.close();">');
  okno.document.writeln('<img alt="" src="'+src+'" />');
  okno.document.writeln('</body>');
  okno.document.writeln('</html>');
  okno.document.close();
  return false;
}
*/

function ukaz_obrazek(src)
{
 	if(document.getElementById)
 	{
 		var obj = document.getElementById('detailImg');
 		if(obj)
 		{
 			obj.src = src;
 			//obj.width = width;
 			//obj.height = height;
		}
  	obj = document.getElementById('imgBlock');
  	if(obj)
  	{
   		obj.style.visibility = "visible";
   		obj.style.height = (winH())+'px';
   	}
   	obj = document.getElementById('imgBlock');
  	if(obj)
  	{
   		obj.style.top = getScrollOffset()+'px';
  	}
   		obj = document.getElementById('movieFlash');
  	if(obj)
  	{
   		obj.style.visibility = 'hidden';
   	}
   	/* přepni obrázek */
   	generujTlacitka();
 	}
 return false;
}


function schovejObrazek()
{
	var obj = document.getElementById('detailImg');
 		if(obj)
 			{
 				obj.src = 'style/free.gif';
			}
	
	var obj = document.getElementById('imgBlock');
  if(obj)
  {
   		obj.style.visibility = "hidden";
  }
  obj = document.getElementById('movieFlash');
  	if(obj)
  		{
   		obj.style.visibility = 'visible';
   		}
	return false;
}


function vytvorMediaPlayer(id)
{
	if(document.getElementById)
	{
		var e = document.getElementById(id);
		if(e)
		{
			var src = e.innerHTML;
			src = src.split('"')[1];
			e.innerHTML = "\
<div>\
<object id='wmp' classid='clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95' type='application/x-oleobject'>\
<param name='filename' value='"+src+"'>\
<param name='autostart' value='1'>\
<param name='showcontrols' value='1'>\
<param name='showstatusbar' value='1'>\
<embed type='application/x-mplayer2' pluginspage='http://www.microsoft.com/windows/mediaplayer/' src='"+src+"' height='286' width='320' autostart=1 showcontrols=1 showstatusbar=1>\
</embed>\
</object>\
</div>\
			";
		}
	}
}


function otevriVideo(nazevSouboru)
{
	nazevSouboru = 'editor-video.php?p=' + escape (nazevSouboru);
	window.open(nazevSouboru, '_blank', 'width=320,height=286');
	return false;
}

