function menu_hide_all() {
for (i=1; i<=5; i++) {
eval("document.getElementById('menu_"+i+"').style.display = 'none';");
}
}

function menu_hiden(nazwa) {
document.getElementById(nazwa).style.display = 'none';
}

function menu_hide(nazwa) {
eval("window.setTimeout(\"menu_hiden('"+nazwa+"')\", 8000);");
}

function menu_show(nazwa,nrp) {

for (i=1; i<=5; i++) {
eval("document.getElementById('menu_"+i+"').style.display = 'none';");
}

document.getElementById(nazwa).style.display = '';

document.getElementById(nazwa).style.marginTop = '190px';

if (nrp==1) {
document.getElementById(nazwa).style.marginLeft = '0px';
}
if (nrp==2) {
document.getElementById(nazwa).style.marginLeft = '154px';
}
if (nrp==3) {
document.getElementById(nazwa).style.marginLeft = '306px';
}
if (nrp==4) {
document.getElementById(nazwa).style.marginLeft = '458px';
}
if (nrp==5) {
document.getElementById(nazwa).style.marginLeft = '610px';
}

}

function hide(element) {
document.getElementById(element).style.display = 'none';
}

function windowSize(element) {
var myWidth = 0, myHeight = 0;
if (typeof(window.innerWidth) == 'number') {
myWidth = window.innerWidth;
myHeight = window.innerHeight;
}
else if(document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
myWidth = document.documentElement.clientWidth;
myHeight = document.documentElement.clientHeight;
}
else if(document.body && (document.body.clientWidth || document.body.clientHeight)) {
myWidth = document.body.clientWidth;
myHeight = document.body.clientHeight;
}
if (element=='h') {
return myHeight;
}
if (element=='w') {
return myWidth;
}
}

function getScrollXY(element) {
var scrOfX = 0, scrOfY = 0;
if (typeof(window.pageYOffset) == 'number') {
scrOfY = window.pageYOffset;
scrOfX = window.pageXOffset;
}
else if(document.body && (document.body.scrollLeft || document.body.scrollTop)) {
scrOfY = document.body.scrollTop;
scrOfX = document.body.scrollLeft;
}
else if(document.documentElement && (document.documentElement.scrollLeft || document.documentElement.scrollTop)) {
scrOfY = document.documentElement.scrollTop;
scrOfX = document.documentElement.scrollLeft;
}
if (element=='x') {
return scrOfX;
}
if (element=='y') {
return scrOfY;
}
}

function movefoto(h,tt) {
var hh = window.pageYOffset || document.body.scrollTop || document.documentElement.scrollTop;
var wh = window.innerHeight || document.body.clientHeight || document.documentElement.clientHeight;
if (tt!=hh) {
document.getElementById('foto').style.marginTop = Math.round((((wh/2)-(h/2))+hh-24))+'px';
}
eval("window.setTimeout(\"movefoto("+h+","+hh+")\", 10);");
}

function load_foto(foto,w,h,tit,desc) {
var hh = window.pageYOffset || document.body.scrollTop || document.documentElement.scrollTop;
var wh = window.innerHeight || document.body.clientHeight || document.documentElement.clientHeight;
var wih = window.innerWidth || document.body.clientWidth || document.documentElement.clientWidth;
var myHeight = windowSize('h');
var scrOfY = getScrollXY('y');
document.getElementById('overlay').style.display = '';
if (tit!='' && desc!='') {
document.getElementById('foto').innerHTML = '<div id=\'load_bg_foto\'><div id=\'load_bg_foto_tit\'><span style=\'color:#ffffff\'>'+tit+'</span><br>'+desc+'</div><img src=\''+foto+'\' style=\'border:1px solid #bbbbbb\'></div>';
}
else if (tit=='' && desc!='') {
document.getElementById('foto').innerHTML = '<div id=\'load_bg_foto\'><div id=\'load_bg_foto_tit\'>'+desc+'</div><img src=\''+foto+'\' style=\'border:1px solid #bbbbbb\'></div>';
}
else if (tit!='' && desc=='') {
document.getElementById('foto').innerHTML = '<div id=\'load_bg_foto\'><div id=\'load_bg_foto_tit\'><span style=\'color:#ffffff\'>'+tit+'</span></div><img src=\''+foto+'\' style=\'border:1px solid #bbbbbb\'></div>';
}
else {
document.getElementById('foto').innerHTML = '<div id=\'load_bg_foto\'><img src=\''+foto+'\' style=\'border:1px solid #bbbbbb\'></div>';
}
document.getElementById('overlay').style.height = (myHeight+scrOfY)+'px';
document.getElementById('load_bg_foto').style.marginLeft = Math.round((((wih/2)-(w/2))-34))+'px';
eval("movefoto("+h+");");
}



