$obrazek=1;

function ukaz(foto,alt,sirka,vyska)
  {
  //zjisteni velikosti okna
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  
  var pomer=1; //zmenseni obrazku na monitor
  
  if ((sirka+100)>myWidth)
  {
  	 pomer=(myWidth-100)/sirka;
  }
  
  if ((vyska*pomer+110)>myHeight)
  {
  	 pomer=(myHeight-110)/vyska;
  }
  
  sirka=Math.floor(sirka*pomer);
  vyska=Math.floor(vyska*pomer);
  
  	var obj = document.getElementById('foto');
  	
  	obj.innerHTML="<p>"+alt+"</p><img src='"+foto+"_.jpg' height='"+vyska+"' width='"+sirka+"' alt='"+alt+"' />";
  	
  	  if (document.documentElement && document.documentElement.scrollTop)
	theTop = document.documentElement.scrollTop;
	else if (document.body)
	theTop = document.body.scrollTop;
	
 obj.style.top = theTop+15+"px";
 obj.style.left = (document.documentElement.scrollWidth-sirka-20)/2+"px";
  	obj.style.display = 'block';
  	
	//document.getElementById('body').style.height = document.documentElement.scrollHeight +"px";
	
  	obj = document.getElementById('overlay');
  	obj.style.height = document.documentElement.scrollHeight +"px";
  	//obj.style.width = document.documentElement.scrollWidth +"px";
	obj.style.display = 'block';
  	}
  
  function zavri()
  {
  	obj = document.getElementById('foto');
	obj.style.display = 'none';
	obj.innerHTML="";
	document.getElementById('overlay').style.display = 'none';
	document.getElementById('body').style.height = "auto";
  }
 
 function zmen_obrazek($pocet)
 {
	$min=1;
	$max=6;
	$obrazek=$obrazek+$pocet;
	if ($obrazek>$max)
	{
		$obrazek=$min;
	}
	else if ($obrazek<$min)
	{
		$obrazek=$max;
	}
	document.getElementById('obrazek').style.background  = 'url(../obrazek/'+$obrazek+'.jpg)';
 }

