function zoom(myImage, myWidth, myHeight)
{
	myLeft = (window.screen.width - myWidth ) / 2 ;
	myTop = (window.screen.height - myHeight ) / 2;
	myWidth = myWidth + 6;
	myHeight = myHeight + 6;

	myWindow = window.open("","popup","height="+myHeight+"px,width="+myWidth+"px,left="+myLeft+"px,top="+myTop+"px,scrollbars=no,toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=yes");
	myWindow.document.write("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n");
	myWindow.document.write('<meta http-equiv="content-type" content="text/html; charset=utf-8">');
	myWindow.document.write("<html>\n\t<head>\n\t\t<title>Preview</title>\n\t</head>\n");
	myWindow.document.write("<style type=\"text/css\">\nhtml, body {\nbackground: Black;\nmargin: 0;\npadding: 0;\ntext-align: center;\n}\nimg {\nborder: 0;\n}\n</style>\n");
	myWindow.document.write("\t<body>\n");
	myWindow.document.write("\t\t<a href=\"#\" onclick=\"parent.close();\" title=\"Zavřít okno\"><img src=\""+myImage+"\" alt=\"Preview\"></a>\n");
	myWindow.document.write("\t</body>\n</html>");
	myWindow.document.close();
	return myWindow;
}


function SPUWC(sAdresa, iSirka, iVyska,bScroll)
{
	iMyWidth = (screen.availWidth - iSirka ) / 2 ;
	iMyHeight = (screen.availHeight - iVyska ) / 2;
	if (bScroll)
		sScroll='yes';
	else
		sScroll='no';
	return window.open(sAdresa, '', 'width='+iSirka+'px, height='+iVyska+'px, left=' + iMyWidth + ',top=' + iMyHeight + ', resizable=yes, titlebar=no, status=yes, address=no, scrollbars='+sScroll+', dependent=yes, modal=yes');
}

function ShowPopUpWindowCenter(sAdresa, iSirka, iVyska)
{
	if (iSirka<150)
		iSirka=150;
	return SPUWC(sAdresa, iSirka, iVyska,false);
}

function ShowPopUpWindowCenterScroll(sAdresa, iSirka, iVyska)
{
	return SPUWC(sAdresa, iSirka, iVyska,true);
}

function showhide(id)
{
	sclass="hidden";
	oEl=document.getElementById(id);
	if (cls.has(oEl,sclass)==true)
	  cls.remove(oEl,sclass);
	else
	  cls.add(oEl,sclass);
	return false;
}

function ShowPopUpWindowFullScreen(sAdresa)
{
	var iSirka=screen.availWidth;
	var iVyska=screen.availHeight;
	var iZacatekX = 0;
	var iZacatekY = 0;
	var bAutoClose = true;
  oWindow=window.open(sAdresa,'','scrollbars,width='+iSirka+',height='+iVyska);
  if (!oWindow)
   	return oWindow;
   	
  oWindow.blur();
  window.focus(); 
  oWindow.moveTo(iZacatekX,iZacatekY);
  oWindow.resizeTo(iSirka,iVyska);

  oWindow.focus();   
  if (bAutoClose)
    window.onunload = function(){oWindow.close()}

  return oWindow;
}
