<!--
function JustSoPicWindow(imageName,imageWidth,imageHeight,alt,bgcolor,hugger,hugMargin,clickToClose,loadingImage) {

// by E Michael Brandt of ValleyWebDesigns.com - Please leave these comments intact.
// version 3.0.4  
// Modified by PeckaDesign.cz ("loading" and predefinition)

	if (bgcolor=="") {
		bgcolor="#FFFFFF";
	}

	if ((loadingImage=="") || (typeof (loadingImage)=='undefined'))
	{
		loadingImage = 'STAHUJI OBRÁZEK...';
	}		

	if ((clickToClose=="") || (typeof (clickToClose)=='undefined'))
	{
		clickToClose = 'kliknutím zavřete toto okno';
	}

	if ((hugMargin=="") || (typeof (hugMargin)=='undefined'))
	{
		hugMargin = '0';
	}

	if ((hugger=="") || (typeof (hugger)=='undefined'))
	{
		hugger = 'hug image';
	}

	if ((bgcolor=="") || (typeof (bgcolor)=='undefined'))
	{
		bgcolor = '#FFFFFF';
	}

	var adj=10
	var w = screen.width;
	var h = screen.height;
	var byFactor=1;

	if(w<740){
	  var lift=0.90;
	}
	if(w>=740 & w<835){
	  var lift=0.91;
	}
	if(w>=835){
	  var lift=0.93;
	}
	if (imageWidth>w){	
	  byFactor = w / imageWidth;			
	  imageWidth = w;
	  imageHeight = imageHeight * byFactor;
	}
	if (imageHeight>h-adj){
	  byFactor = h / imageHeight;
	  imageWidth = (imageWidth * byFactor);
	  imageHeight = h; 
	}

	var scrWidth = w-adj;
	var scrHeight = (h*lift)-adj;

	if (imageHeight>scrHeight){
  	  imageHeight=imageHeight*lift;
	  imageWidth=imageWidth*lift;
	}

	var posLeft=0;
	var posTop=0;

	if (hugger == "hug image"){
	  if (hugMargin == ""){
	    hugMargin = 0;
	  }
	  var scrHeightTemp = imageHeight - 0 + 2*hugMargin;
	  if (scrHeightTemp < scrHeight) {
		scrHeight = scrHeightTemp;
	  } 
	  var scrWidthTemp = imageWidth - 0 + 2*hugMargin;
	  if (scrWidthTemp < scrWidth) {
		scrWidth = scrWidthTemp;
	  }

	  if (scrHeight<100){scrHeight=100;}
	  if (scrWidth<100){scrWidth=100;}

	  posTop =  ((h-(scrHeight/lift)-adj)/2);
	  posLeft = ((w-(scrWidth)-adj)/2);
 	}

	if (imageHeight > (h*lift)-adj || imageWidth > w-adj){
		imageHeight=imageHeight-adj;
		imageWidth=imageWidth-adj;
	}
	posTop = parseInt(posTop);
	posLeft = parseInt(posLeft);		
	scrWidth = parseInt(scrWidth); 
	scrHeight = parseInt(scrHeight);

	var agt=navigator.userAgent.toLowerCase();
	if (agt.indexOf("opera") != -1){
	  var args= new Array();
	  args[0]='parent';
	  args[1]=imageName;
	  var i ; document.MM_returnValue = false;
	  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
	} else {
	newWindow = window.open("vwd_justso.htm","newWindow","width="+scrWidth+",height="+scrHeight+",left="+posLeft+",top="+posTop);
	newWindow.document.open();
	newWindow.document.write('<html><title>'+alt+' ['+ clickToClose +']</title><body leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" bgcolor='+bgcolor+' onLoad="document.getElementById('+"'loading'"+').style.display='+"'none'"+'" onBlur="self.close()" onClick="self.close()">');
	newWindow.document.write('<div id="loading" style="position:absolute; left:10px; top:10px; width:115; z-index:1; padding: 3px; border: 1px solid #666666; font-family: Arial, Helvetica, sans-serif; color: #000000; font-size: 10px; background-color: #FFFFFF; layer-background-color: #FFFFFF; vertical-align: middle;">'+loadingImage+'</div>')
	newWindow.document.write('<table width='+imageWidth+' border="0" cellspacing="0" cellpadding="0" align="center" height='+scrHeight+' ><tr><td>');
	newWindow.document.write('<img src="'+imageName+'" width='+imageWidth+' height='+imageHeight+' alt="'+alt+'" title="'+alt+' ['+ clickToClose +']" >'); 
	newWindow.document.write('</td></tr></table></body></html>');
	newWindow.document.close();
	newWindow.focus();
	}
}

function close_window()
{	self.close();	}

function galery (img, width, height, scrolls, resize)
{
 if (scrolls == 'true')
 {
   var doscrolls = 'yes';
 }
 else {
   var doscrolls = 'no';
 }
 if (resize == 'true')
 {
   var dresize = 'yes';
 }
 else {
   var dresize = 'no';
 }
 galerys = window.open ('', 'zoom', 'left=20, top=20, width='+width+', height='+height+','+
                        'toolbar=no, location=no, directories=no, status=no,'+
                        'menubar=no, scrollbars='+doscrolls+', resizable='+dresize+', copyhystory=no');
 with (galerys.document)
 {
  open ();
   write ('<?xml version="1.0" encoding="iso-8859-2"?>\n');
   write ('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">\n');
   write ('<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="cs">\n');
   write ('<head>\n\n');
   write (' <title>galery</title>\n\n');
   write (' <meta http-equiv="content-type"  content="application/xhtml+xml; charset=iso-8859-2" />\n');
   write (' <meta http-equiv="pragma"        content="no-cache" />\n');
   write (' <meta http-equiv="cache-control" content="no-cache" />\n');
   write (' <meta http-equiv="expires"       content="-1" />\n\n');
   write ('<style type="text/css">body{margin:0px;padding:0px;overflow:auto;}img{border:0px}</style>');
   write ('</head>\n');
   write ('<body>\n');
   write ('<a href="javascript:close();" title="close"><img src="/'+img+'" alt="close" title="close" /></a>');
   write ('</body>\n');
   write ('</html>');
  close ();
 }
}
//-->
