
function setGalleryHeight(){

  var vyskaOkna = $(window).height();
  var newHeight = vyskaOkna-40;
  if(vyskaOkna < 700){
  $("#fotografie").css("height", newHeight+"px");
  $("#fotografie img").css("height", newHeight+"px");

  }

}

window.onresize = function(){
  setGalleryHeight();
}

$(document).ready(function(){
  setGalleryHeight();
  
  $("#images").cycle({
      fx:    'fade',
      timeout: 5000
  });

  $('.novinka a').lightBox({
     fixedNavigation:true,
     imageLoading: 'http://www.lukascerveny.com/js/lightbox-jquery/images/lightbox-ico-loading2.gif',
     imageBtnClose: 'http://www.lukascerveny.com/js/lightbox-jquery/images/lightbox-btn-close.gif',
     imageBtnPrev: 'http://www.lukascerveny.com/js/lightbox-jquery/images/lightbox-btn-prev.gif',
     imageBtnNext: 'http://www.lukascerveny.com/js/lightbox-jquery/images/lightbox-btn-next.gif'
  });
  
  
	$(".sluzby-box h2").click(function(){

		$(".sluzby-box p").hide();
		$(".sluzby-box h2 span").show();
		$(this).children("span").hide();
		$(this).next("p").slideDown();

	});

  
});






// "javascript bez javascriptu" - otevirani odkazu v novem okne - v html pro odkaz pouzijeme class="popup"

function aktualizujOdkazy() {
  if(!document.getElementsByTagName) return false;
  var links = document.getElementsByTagName("a");
  for (var i=0; i < links.length; i++) {
    if(links[i].className.match("popup")) {
      links[i].onclick = function () {
        return !window.open(this.href);
      }
    }
  }
}
window.onload=aktualizujOdkazy;

