// JavaScript Document

// ZJIŠTĚNÍ VÝŠKY A ŠÍRKY, KAM SE MÁ DIV ZOBRAZIT

function getScroll(){
	if (self.pageYOffset) {
		scrollTop = self.pageYOffset;
	} else if (document.documentElement && document.documentElement.scrollTop) {
		scrollTop = document.documentElement.scrollTop;
	} else if (document.body) {
		scrollTop = document.body.scrollTop;
	}	
	return (scrollTop);
};


function winW() {
   if (window.innerWidth)
      return window.innerWidth;
   else if
   (document.documentElement &&
   document.documentElement.clientWidth)
      return document.documentElement.clientWidth;
   else if
   (document.body && document.body.clientWidth)
      return document.body.clientWidth;
   else
      return null;      
}

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.innerWidth */
      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;      
}

var heightBG = document.getElementById('coverPage');


// SAMOTNÉ ZOBRAZENÍ DIVŮ

function showInfoBox1(sender, args) {
	document.getElementById('grayOverlay').style.height = document.getElementById('coverPage').offsetHeight + 'px';
	$("#grayOverlay").show("fast");
	$("#oStavbe").fadeIn("slow");
	$("#oStavbe").css("left", (winW()/2)-350);
	$("#oStavbe").css("top", (getScroll()+160));
}

function showInfoBox2(sender, args) {
	document.getElementById('grayOverlay').style.height = document.getElementById('coverPage').offsetHeight + 'px';
	$("#grayOverlay").show("fast");
	$("#dispozice").fadeIn("normal");
	$("#dispozice").css("left", (winW()/2)-350);
	$("#dispozice").css("top", (getScroll()+160));
}

function showInfoBox3(sender, args) {
	document.getElementById('grayOverlay').style.height = document.getElementById('coverPage').offsetHeight + 'px';
	$("#grayOverlay").show("fast");
	$("#mapa").fadeIn("normal");
	$("#mapa").css("left", (winW()/2)-350);
	$("#mapa").css("top", (getScroll()+160));
}

function closeWindow1(sender, args) {
	$("#grayOverlay").hide("fast");
	$("#oStavbe").fadeOut("fast");
}

function closeWindow2(sender, args) {
	$("#grayOverlay").hide("fast");
	$("#dispozice").fadeOut("fast");
}

function closeWindow3(sender, args) {
	$("#grayOverlay").hide("fast");
	$("#mapa").fadeOut("fast");
}
