function pop_win (url, win, width, height, options) 
{
	try {
		var leftPos = (screen.availWidth - width) / 2;
		var topPos = (screen.availHeight - height) / 2;
		options += 'width=' + width + ',height=' + height + ',left=' + leftPos + ',top=' + topPos;
		return window.open(url, win, options);
	} catch (e) {
		if (debugMode) alert(e);
	}
}

function refresh_href(class_name)
{
if (!document.getElementsByTagName) return false;
var links = document.getElementsByTagName("a");
for (var i=0; i < links.length; i++)
  {
    if (links[i].className.match(class_name))    
      {
      links[i].onclick=function()
        {
        return !pop_win(this.href,"zoom",800,600,"scrollbars=yes,statusbar=no,menubar=no");
        }
      }
  } 
}


  function flash_insert()
  {
  document.write("<!--[if !IE]> -->");
  document.write("<object type='application/x-shockwave-flash' data='./image/flash/star.swf' width='750' height='202'><!-- <![endif]-->");
  document.write("          <!--[if IE]>");
  document.write("          <object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0' width='750' height='200'>");
  document.write("          <param name='movie' value='./image/flash/star.swf' />");
  document.write("          <!--><!---->");
  document.write("          <param name='loop' value='true' />");
  document.write("          <param name='menu' value='true' />");
  document.write("          </object>");
  document.write("        <!-- <![endif]-->");
  }

function insert_video(name)
{
document.write("<object id='MediaPlayer' classid='CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95' standby='Nahrávám Microsoft Windows Media Player součásti...' width='400' height='322'>");
document.write("<param name='Filename' value='"+name+"' />");
document.write("<param name='AnimationAtStart' value='true' />");
document.write("<param name='AutoStart' value='true' />");
document.write("<param name='ShowControls' value='true' />");
document.write("<param name='ShowPositionControls' Value='false' />");
document.write("<param name='ShowStatusBar' Value='false' />");
document.write("<param name='ShowTracker' Value='true' />");
document.write("<param name='PlayCount' value='true' />");
document.write("<embed width='400' height='322' src='"+name+"' showTracker=1 showPositionControls=0 controller='true' autoplay='true' playeveryframe='false'></object>");
}


function set_color(id)
{
document.getElementById("barvy").value=id;
}

function print_detail(id)
{
window.open("./print_lod.php?id="+id,"print_lod","toolbar=no,location=no,directories=no, statusbar=no, menubar=no,width=600,height=800");
}

function change_visibily(id)
{
if (document.getElementById(id).style.display=="none")
document.getElementById(id).style.display="";
else
document.getElementById(id).style.display="none";
}

function showpic(id,modul)
{
window.open("./show_image.php?id="+id+"&modul="+modul,"show_image","toolbar=no,location=no,directories=no, statusbar=no, menubar=no,scrollbars=auto,resizable=no,width=100,height=100");
}

function show_detail_flash(file)
{
window.open("./html/reference/detail_flash.php?id="+file,"detail_flash","toolbar=no,location=no,directories=no, statusbar=no, menubar=no,scrollbars=no,resizable=no,width=252,height=124;menu=no");
}

function show_detail_flash_xy(file,x,y)
{
window.open("./html/reference/detail_flash.php?id="+file+"&width="+(x)+"&height="+y,"detail_flash","toolbar=no,location=no,directories=no, statusbar=no, menubar=no,scrollbars=no,resizable=no,width="+(x-3)+",height="+(y-3)+";menu=no");
}

function vloz_foto(a)
{
document.write("<tr><td><input type='file' name='lod_foto[]'/></td></tr>");
}
