
function nahratObrazky() {
var d=document;if(d.images){if(!d.prel) d.prel=new Array();
var i,j=d.prel.length,args=nahratObrazky.arguments;for(i=0; i<args.length; i++) if (args[i].indexOf("#")!=0){
d.prel[j]=new Image;d.prel[j++].src=args[i];}}}


// fce vraci objekt podle zadaneho id
var getElementWithId;
if(document.getElementById){
	getElementWithId = function(id){
		return document.getElementById(id);
	}
}else if(document.all){
	getElementWithId = function(id){
		return document.all[id];
	}
}else{
	getElementWithId = function(id){
		return false;
	}
}


var hpHeight = 377;
var hpContainerId = "hp";
var hpDefaultTopMargin = 20;
// center the whole homepage verticaly
function centerHp() {
	var x,y;
	var hpObject = getElementWithId(hpContainerId); 
	if (self.innerHeight) {
		x = self.innerWidth;
		y = self.innerHeight;
	}
	else if (document.documentElement && document.documentElement.clientHeight) {
		x = document.documentElement.clientWidth;
		y = document.documentElement.clientHeight;
	}
	else if (document.body) {
		x = document.body.clientWidth;
		y = document.body.clientHeight;
	}
	if (y > hpHeight) {
		newTopMargin = Math.round((y - hpHeight) / 2);
		if (hpObject) hpObject.style.marginTop = newTopMargin+'px';
	}
	else {
		newTopMargin = hpDefaultTopMargin;
		if (hpObject) hpObject.style.marginTop = newTopMargin+'px';
	}
	if (hpObject) hpObject.style.display = 'block';
}


// set up automatic centering on window resize
function initResize() {
	window.onresize = centerHp;
}