/* ukaz obrazek */

function winH() {
   if (window.innerHeight)
      /* NN4 a kompatibilní prohlížeče */
      return window.innerHeight;
   else if
   (document.documentElement &&
   document.documentElement.clientHeight)
      /* MSIE6 v std. režimu - Opera a Mozilla
      již uspěly s window.innerHeight */
      return document.documentElement.clientHeight;
   else if
   (document.body && document.body.clientHeight)
      /* starší MSIE + MSIE6 v quirk režimu */
      return document.body.clientHeight;
   else
      return null;
}


function getScrollOffset()
{
	if(document.documentElement.scrollTop)
		return document.documentElement.scrollTop;
	if(window.pageYOffset)
		return window.pageYOffset;
	return document.body.scrollTop;
}

function ukaz_obrazek(src,width,height)
{
 	if(document.getElementById)
 	{
 		var obj = document.getElementById('detailImg');
 		if(obj)
 			{
 				obj.src = src;
 				obj.width = width;
 				obj.height = height;
			}
  	obj = document.getElementById('imgBlock');
  	if(obj)
  		{
   		obj.style.visibility = "visible";
   		obj.style.height = (winH())+'px';
   		}
   	obj = document.getElementById('imgBlock');
  	if(obj)
  		{
   		obj.style.top = getScrollOffset()+'px';
  		}
   		obj = document.getElementById('movieFlash');
  	if(obj)
  		{
   		obj.style.visibility = 'hidden';
   		}
 	}
 return false;
}


function schovejObrazek()
{
	var obj = document.getElementById('detailImg');
 		if(obj)
 			{
 				obj.src = 'style/free.gif';
			}
	
	var obj = document.getElementById('imgBlock');
  if(obj)
  {
   		obj.style.visibility = "hidden";
  }
  obj = document.getElementById('movieFlash');
  	if(obj)
  		{
   		obj.style.visibility = 'visible';
   		}
	return false;
}



function otevriOkno(uri, width, height)
{
	if(obrazky)
	{
		uri += '&amp;g=' + obrazky;
	}
	wMax = 800;
	hMax = 750;
	if(screen.height) hMax = screen.availHeight;
	if(screen.width) wMax = screen.availWidth;
	width += 25;
	height += 225;
	if(width > wMax) width = wMax;
	if(height > hMax) height = hMax;
  open(uri, "_blank", "width="+width+",height="+height+",scrollbars");
  return false;
}

function start()
{
	if(document.getElementById)
	{
		var logo = document.getElementById("logo");
		if(logo) {animaceLoga(20);}
		var hledat = document.getElementById("fotoHledat");
		if(hledat) {hledat.focus();}
	}
}

function animaceLoga(faze)
{
	var logo = document.getElementById("logo");
	logo.style.filter = "Alpha(Opacity="+faze+")";
	logo.style.opacity = ""+(faze/100);
	if(faze < 100)
	{
		faze = faze+8;
		if(faze>100) faze = 100;
		setTimeout("animaceLoga("+(faze)+")", 50);
	}
}

function fotoHledatSubmit()
{
	if(document.getElementById)
	{
    var obj = document.getElementById("fotoHledat");
    obj.focus();
    if(obj.value.length == 0)
    {
      return false;
    }
    if(obj.value.length < 3)
    {
      alert("Hledané slovo je moc krátké.");
      return false;
    }
    if(obj.value.length > 32)
    {
      alert("Hledané slovo je moc dlouhé.");
      return false;
    }
  }
  return true;
}
