var screenW = window.screen.width;
var screenH = window.screen.height;

function user(zdroj) 
{ aPopUp =window.open(zdroj,'Detail','toolbar=no,location=no,directories=no,status=no,left=350,top=350,scrollbars=yes,resizable=no,copyhistory=no,width=300,height=350');}

function opened(foto,id,popis,gal){
	myLeft = (screenW > 800) ? ((screenW / 2) - (390 + 10)) : 10;
	myHeight = (screenH > 600) ? 675 : 550;
	photo = window.open('intgal.php?id='+id+'&path='+popis+'&nazev='+gal+'',''+popis+'','width=980,height='+myHeight+',top=0,left='+myLeft+',scrollbars=no,resizable=no,location=no,status=no');
}

function wopen(foto,popis){
	myLeft = (screenW > 800) ? ((screenW / 2) - (390 + 10)) : 10;
	myHeight = (screenH > 600) ? 605 : 550;
	photo = window.open('','photo','width=780,height='+myHeight+',top=0,left='+myLeft+',scrollbars=yes,resizable=yes');
	photo.focus();
	okno(foto,popis);
}

function okno(foto,popis){
with(photo.document){
	open();
	writeln('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">\n<html>\n<head>');
	writeln('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">');
	writeln('<meta http-equiv="Content-Language" content="cs">');
	writeln('<meta http-equiv="imagetoolbar" content="no" />');
	writeln('<title>'+popis+'</title>\n</head>');
	writeln('<body style="background-color: #fff; margin:0px; padding:0px" title="Kliknutím zavřete okno">');
	writeln('<table style="width: 100%; height: 100%; cursor: hand; cursor: pointer" cellspacing="0" cellpadding="0" onClick="window.close()">');
	write('<tr><td align="center" valign="middle">');
	write('<img src="'+foto+'" border="0"></td>');
	writeln('</tr>\n</table>');
	writeln('</body>\n</html>');
	close();
}}

function zmen() {
vybrano = document.vyber.galerie.selectedIndex+1;
switch (vybrano) {
   case 1 : 
      vybrano2 = "a";
      break; 
   case 2 : 
      vybrano2 = "d";
      break; 
   case 3 : 
      vybrano2 = "mz";
      break; 
   case 4 : 
      vybrano2 = "ar";
      break; 
   default : 
      document.write("Omlouváme se, ale galerii s id " + i + " neexistuje.<BR>"); 
} 
document.location = "intgal.php?path="+vybrano2+"";
}
