
// image browser do wszystkiego na stronie
function ImageBrowser(plik, wys, szer)
{
	roz = (wys>szer) ? wys : szer;
  window.open('lib/php-adds/image_browser.php?id='+plik+'&h='+roz, 'ImageBrowser', 'height='+(wys+10)+', width='+szer+', left='+((screen.width-szer-10)/2)+',top='+((screen.height-wys-10)/2)+',resizable=no,scrolling=no,menubar=no,toolbar=no,location=no');
}

function showImage(plik, wys, szer) {
  window.open(plik, 'ImageBrowser', 'height='+(wys+10)+', width='+szer+', left='+((screen.width-szer-10)/2)+',top='+((screen.height-wys-10)/2)+',resizable=no,scrolling=no,menubar=no,toolbar=no,location=no');
}

// otwiera dodatkowe okienko
function infoWindow(plik, wys, szer)
{
  window.open(plik, '', 'height='+wys+', width='+szer+', left='+((screen.width-szer-10)/2)+',top='+((screen.height-wys-10)/2)+',resizable=no,scrolling=no,menubar=no,toolbar=no,location=no');
}

// funkcja ustawiajaca layera na srodku po podaniu zamiast 995 szerokosci elementu strony
function layer(id, zindex, l, h)
{ x=screen.width;
  if (x==1024) wn=l;
  else wn=(x-994-25)/2+l;
  document.write('<DIV id="'+id+'" style="position: absolute; z-index: '+zindex+'; left:'+wn+'px; top: '+h+'px ">');
}

function layerTlo2left(id, zindex, l, t, w, h, color)
{ x=screen.width;
  if (x==1024) 
  lw=l;
  else lw=(x-994-25)+l;
  document.write('<DIV class="ramka" id="'+id+'" style="position: absolute; z-index: '+zindex+'; left:'+lw+'; top: '+t+'; width: '+w+'; height: '+h+'; background-color: #'+color+';">');
}

function layerTlo(id, zindex, l, t, w, h, color)
{ x=screen.width;
  if (x==1024) 
  lw=l;
  else lw=(x-994-25)/2+l;
  document.write('<DIV class="ramka" id="'+id+'" style="position: absolute; z-index: '+zindex+'; left:'+lw+'; top: '+t+'; width: '+w+'; height: '+h+'; background-color: #'+color+';">');
}

function layer2left(id, zindex, l, h)
{ x=screen.width;
  if (x==1024) wn=l;
  else wn=(x-994-25)+l;
  document.write('<DIV id="'+id+'" style="position: absolute; z-index: '+zindex+'; left:'+wn+'px; top: '+h+'px ">');
}

//wyswietlanie i chowanie leyerow z informacjami w backupie i nie tylko
var ie4 = document.all && navigator.userAgent.indexOf("Opera") == -1;
var ns6 = document.getElementById && !document.all;
var ns4 = document.layers;


function showHideDiv(ktore)
{ which = ktore;
  menuobj = ie4 ? document.all[which] : 
            ns6 ? document.getElementById(which) :
            ns4 ? document.which : "";
  menuobj.thestyle = (ie4 || ns6) ? menuobj.style : menuobj;
  
  stan = menuobj.thestyle.display;
  menuobj.thestyle.display = (stan=="none") ? "" : "none";	
  
}
