function getPageScroll(){
 
 var yScroll;
 
 if (self.pageYOffset) {
  yScroll = self.pageYOffset;
 } else if (document.documentElement && document.documentElement.scrollTop){  // Explorer 6 Strict
  yScroll = document.documentElement.scrollTop;
 } else if (document.body) {// all other Explorers
  yScroll = document.body.scrollTop;
 }
 
 arrayPageScroll = new Array('',yScroll) 
 return arrayPageScroll;
}

function getPageSize(){
 
 var xScroll, yScroll;
 
 if (window.innerHeight && window.scrollMaxY) { 
  xScroll = document.body.scrollWidth;
  yScroll = window.innerHeight + window.scrollMaxY;
 } else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
  xScroll = document.body.scrollWidth;
  yScroll = document.body.scrollHeight;
 } else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
  xScroll = document.body.offsetWidth;
  yScroll = document.body.offsetHeight;
 }
 
 var windowWidth, windowHeight;
 if (self.innerHeight) { // all except Explorer
  windowWidth = self.innerWidth;
  windowHeight = self.innerHeight;
 } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
  windowWidth = document.documentElement.clientWidth;
  windowHeight = document.documentElement.clientHeight;
 } else if (document.body) { // other Explorers
  windowWidth = document.body.clientWidth;
  windowHeight = document.body.clientHeight;
 } 
 
 // for small pages with total height less then height of the viewport
 if(yScroll < windowHeight){
  pageHeight = windowHeight;
 } else { 
  pageHeight = yScroll;
 }
 
 // for small pages with total width less then width of the viewport
 if(xScroll < windowWidth){ 
  pageWidth = windowWidth;
 } else {
  pageWidth = xScroll;
 }
 

 arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight) 
 return arrayPageSize;
}
 
function setWidth(element,w) {
     element = document.getElementById(element);
      element.style.width = 100 +"%";
   }
function setHeight(element,h) {
    element = document.getElementById(element);
      element.style.height = h +"px";
   }
function setInnerHTML(element,content) {
  element = document.getElementById(element);
   element.innerHTML = content;
   }
function setTop(element,t) {
    element = document.getElementById(element);
      element.style.top = t +"px";
   }
function setLeft(element,t) {
   element = document.getElementById(element);
     element.style.left = t +"px";
}

function start(szer) { 
 
  //hideSelectBoxes();
 
  // stretch overlay to fill page and fade in
  var arrayPageSize = getPageSize();
  setHeight('tlo_block', arrayPageSize[1]);
  setWidth('tlo_block', arrayPageSize[0]);	
  //new Effect.Appear('tlo_block', { duration: 0.2, from: 0.0, to: 0.8 });
 
    // calculate top offset for the lightbox and display 
  var arrayPageSize = getPageSize();
  var arrayPageScroll = getPageScroll();
  var lightboxTop = arrayPageScroll[1] + (arrayPageSize[3] / 15);
  
  var ile = (arrayPageSize[0]-szer)/2;
  
  setLeft('alercik', ile);
  setTop('alercik', lightboxTop);
  //setWidth('tlo_block',800)	
  
 }
 
function alercik(a,b) {
objFirma = document.getElementById('alercik');
objFirma.style.display="block";
objBlock = document.getElementById('tlo_block');
objBlock.style.display="block";
 
start(b);
 

text='<table style="border: 1px solid #000000; background-color: #ffffff;">';
text+='<tr><td style="text-align:left; padding: 1px 1px 1px 1px;">'+a+'</td></tr><tr><td style="padding: 1px 2px 2px 1px; text-align: right; cursor: pointer; font-size: 11px; color: #b2b2b2; font-weight: bold" onclick="alercik_close();">zamknij</td></tr></table>';
document.getElementById('alercik').innerHTML=text;
}
 
function alercik_close() {
document.getElementById('alercik').style.display="none";
document.getElementById('tlo_block').style.display="none";
document.getElementById("flash").style.visibility="visible";
}

function getHTTPObject(){var xmlhttp; /*@cc_on @if (@_jscript_version>=5)try {xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");} catch(e){try{xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");} catch(E){xmlhttp=false;}              } 
         @else
          xmlhttp = false;         @end @*/
if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {try {xmlhttp = new XMLHttpRequest();           } catch (e) {xmlhttp = false;           }          }          return xmlhttp;        }