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('<script type="text/javascript"> var NS = (navigator.appName=="Netscape")?true:false;var viewportwidth=0;var viewportheight=0;function getViewport () {	if (typeof window.innerWidth != \'undefined\') { viewportwidth = parseInt(window.innerWidth); viewportheight = parseInt(window.innerHeight); } else if (typeof document.documentElement != \'undefined\' && typeof document.documentElement.clientWidth != \'undefined\' && document.documentElement.clientWidth != 0){	viewportwidth = parseInt(document.documentElement.clientWidth);viewportheight = parseInt(document.documentElement.clientHeight);}	else { viewportwidth = parseInt(document.getElementsByTagName(\'body\')[0].clientWidth); viewportheight = parseInt(document.getElementsByTagName(\'body\')[0].clientHeight); }}');
	myWindow.document.write('function FitPic() {getViewport();if (viewportwidth==0 || viewportheight==0) return; iWidth = viewportwidth;iHeight = viewportheight;iWidth = document.images[0].width - iWidth;iHeight = document.images[0].height - iHeight;window.resizeBy(iWidth, iHeight);if (iWidth!=0 || iHeight!=0) { getViewport(); iWidth = viewportwidth;iHeight = viewportheight;myLeft = (window.screen.width - document.images[0].width ) / 2 ;myTop = (window.screen.height - document.images[0].height) / 2; window.moveTo(myLeft,myTop);} window.focus();};</script>');
	myWindow.document.write("\t<body onload=\"FitPic();window.focus();\">\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();
 	myWindow.focus();
	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;
}

