function obrazok(path,obrazok)
{
if (obrazok==0)
{
PicWindow=window.open('', '', 'left='+(screen.width-550)/2+', top='+(screen.height-450)/2+', fullscreen=no, toolbar=no, status=no, scrollbars=no, location=no, menubar=no, directories=no, width=550, height=470');
PicWindow.document.write('<BODY bgcolor="#FFFFFF" marginwidth=0 marginheight=0 leftmargin=5 topmargin=5><a href="JavaScript:close();"><img src='+path+' border=0 alt="zatvor okno"></a></body>')
}
if (obrazok==1)
{
PicWindow=window.open('', '', 'left='+(screen.width-413)/2+', top='+(screen.height-550)/2+', fullscreen=no, toolbar=no, status=no, scrollbars=no, location=no, menubar=no, directories=no, width=423, height=560');
PicWindow.document.write('<BODY bgcolor="#FFFFFF" marginwidth=0 marginheight=0 leftmargin=5 topmargin=5 align="center"><a href="JavaScript:close();"><img src='+path+' border=0 alt="zatvor okno"></a></body>')
}
if (obrazok==2)
{
PicWindow=window.open('', '', 'left='+(screen.width-500)/2+', top='+(screen.height-375)/2+', fullscreen=no, toolbar=no, status=no, scrollbars=no, location=no, menubar=no, directories=no, width=510, height=385');
PicWindow.document.write('<BODY bgcolor="#FFFFFF" marginwidth=0 marginheight=0 leftmargin=5 topmargin=5 align="center"><a href="JavaScript:close();"><img src='+path+' border=0 alt="zatvor okno"></a></body>')
}
if (obrazok==3)
{
PicWindow=window.open('', '', 'left='+(screen.width-375)/2+', top='+(screen.height-500)/2+', fullscreen=no, toolbar=no, status=no, scrollbars=no, location=no, menubar=no, directories=no, width=385, height=510');
PicWindow.document.write('<BODY bgcolor="#FFFFFF" marginwidth=0 marginheight=0 leftmargin=5 topmargin=5 align="center"><a href="JavaScript:close();"><img src='+path+' border=0 alt="zatvor okno"></a></body>')
}
}
function imgdetail(path) {
        PicWindow=window.open(path, "Preview", "left=30, top=30, fullscreen=no, toolbar=no, status=no, scrollbars=no, resizable=yes, location=no, menubar=no, directories=no, width=570, height=433");
        PicWindow.document.write('<BODY bgcolor="#FFFFFF" marginwidth=0 marginheight=0 leftmargin=5 topmargin=5 align="center"><a href="JavaScript:close();"><img src='+path+' border=0 alt="zatvor okno"></a></body>')
} 
function imgdetailsort(path) {
        window.open(path, "Preview", "left=0, top=0, fullscreen=no, toolbar=yes, status=yes, scrollbars=yes, resizable=yes, location=yes, menubar=yes, directories=yes, width=700, height=500");
} 
function imgdet(path,w,h) {
        PicWindow=window.open(path, "Preview", "width=" + w + ", height=" + h +", left=30, top=30, fullscreen=no, toolbar=no, status=no, scrollbars=no, resizable=yes, location=no, menubar=no, directories=no");
        PicWindow.document.write('<BODY bgcolor="#FFFFFF" marginwidth=0 marginheight=0 leftmargin=5 topmargin=5 align="center"><a href="JavaScript:close();"><img src='+path+' border=0 alt="zatvor okno"></a></body>') 
}
function showprintwindow(path) {
  var y = (screen.height-700)/2;
  var x = (screen.width-700)/2;
  if (y < 0) y = 0;
  if (x < 0) x = 0;
  options = 'menubar=yes,toolbar=no,directories=no,location=no,status=yes,scrollbars=yes,resizable=no,width=700,height=650,top='+y+',left='+x;
  PrintWin = window.open(path, "Print", options);
}

function regsubreg(val){
  document.search.subreg.options.length = 0;
  if (val == 0) {
  	document.search.subreg.options[0] = new Option('Okres','');
  }
  pocet = 0;
  for (i=0;i<r[val].length;i++) {
      if (typeof r[val][i] != "undefined") {
          pocet++;
      }
  }
  if (pocet>0){
	  document.search.subreg.options[0] = new Option('Okres','');
	  j = 1;
	  if (val!=0){
		  for (i=0;i<r[val].length;i++) {
		      if (typeof r[val][i] != "undefined") {
			      document.search.subreg.options[j] = new Option(r[val][i],i);
			      j++;
			    }
		  }
	  }
  } 
}
