var y1 = 20;(document.getElementById) ? dom = true : dom = false;
function ukryjpgbook() {if (dom) {document.getElementById("pgbook").style.display='none';}}
function pokazpgbook() {if (dom) {document.getElementById("pgbook").style.display='block';}}

function ukryjpgbook2() {if (dom) {document.getElementById("pgbook2").style.display='none';}}
function pokazpgbook2() {if (dom) {document.getElementById("pgbook2").style.display='block';}}

function ukryjwskazowka() {if (dom) {document.getElementById("wskazowka").style.display='none';}}
function pokazwskazowka() {if (dom) {document.getElementById("wskazowka").style.display='block';}}

function ukryjwskazowka2() {if (dom) {document.getElementById("wskazowka2").style.display='none';}}
function pokazwskazowka2() {if (dom) {document.getElementById("wskazowka2").style.display='block';}}

function ukryjwskazowka3() {if (dom) {document.getElementById("wskazowka3").style.display='none';}}
function pokazwskazowka3() {if (dom) {document.getElementById("wskazowka3").style.display='block';}}

function ukryjpgbook() {if (dom) {document.getElementById("pgbook").style.display='none';}}

function pokazpgbook() {if (dom) {document.getElementById("pgbook").style.display='block';}}



function ukryjcompany() {if (dom) {document.getElementById("company").style.display='none';}}

function pokazcompany() {if (dom) {document.getElementById("company").style.display='block';}}


function placeIt() {
  if (dom && !document.all) {document.getElementById("centrum").style.top = window.pageYOffset + (window.innerHeight - (window.innerHeight-y1)) + "px";}
  if (document.all) {document.all["centrum"].style.top = document.documentElement.scrollTop + (document.documentElement.clientHeight - (document.documentElement.clientHeight-y1)) + "px";}
  window.setTimeout("placeIt()", 10); }    
<!--

function checkDate(month, day, year){

  var monthLength = 

    new Array(31,28,31,30,31,30,31,31,30,31,30,31);



  if (!day || !month || !year)

    return false;



  //check for bisestile year

  //Nie uwzglednia 100 i 400

  //Result := (Year mod 4 = 0) and ((Year mod 100 <> 0) or (Year mod 400 = 0));

  if (year/4 == parseInt(year/4))

    monthLength[1] = 29;



  if (year < 1990)

    return false;



  if (month < 1 || month > 12)

    return false;



  if (day<1 || day > monthLength[month-1])

    return false;

  

  return true;

}



function PrepareData() {

  var val;

  var m=0,d=0,r=0;

  var obj;

  var ret = "";

  

  obj = document.getElementById('edData');

  val = obj.value;

  obj.value = '';

  

  if(val != ''){

    d = parseInt(val.substring(0,2),10);

    m = parseInt(val.substring(3,5),10);

    r = parseInt(val.substring(6,10),10);

    if( checkDate(m,d,r)){

      ret = ''+r+(m>9?'':'0')+m+(d>9?'':'0')+d;

      obj.value = val;

    }

  };



  return ret;

}

function  PrepareReadData(){

  ReadData(document.getElementById('edAkta').value,PrepareData());

}



// -->
<!-- 

function checkForm(){

	if(document.add_aukcja.TYTUL.value==""){

		alert("Podaj tytuł aukcji!");

		document.add_aukcja.TYTUL.focus();

		return false;

	}

	if(document.add_aukcja.ILOSC.value==""){

		alert("Podaj ilość przedmiotów przetargu!");

		document.add_aukcja.ILOSC.focus();

		return false;

	}

	if(document.add_aukcja.TERMIN.value==""){

		alert("Podaj termin realizacji!");

		document.add_aukcja.TERMIN.focus();

		return false;

	}

	return true;

}

//--> 
function disableField(myField)

{

myField.disabled = true

return true

}

function enableField(myField)

{

myField.disabled = false

return true

}

function onfocusField(myField)

{

if (myField.disabled)

{

myField.blur()

return false

}

return true;

}

// The above functions are generic, the following function is specific to this page

function toggleFields(myField)

{

if (myField.checked)

{

//disableField(document.forms["add_aukcja"].ZAPROSZENIE_FIRMA)

disableField(document.forms["add_aukcja"].LISTA_FIRM)

disableField(document.forms["add_aukcja"].ZAPROSZENIE_EMAIL)

disableField(document.forms["add_aukcja"].TEMAT_EMAIL)

disableField(document.forms["add_aukcja"].TRESC_EMAIL)

}

else

{

//enableField(document.forms["add_aukcja"].ZAPROSZENIE_FIRMA)

enableField(document.forms["add_aukcja"].LISTA_FIRM)

enableField(document.forms["add_aukcja"].ZAPROSZENIE_EMAIL)

enableField(document.forms["add_aukcja"].TEMAT_EMAIL)

enableField(document.forms["add_aukcja"].TRESC_EMAIL)

}

document.forms["add_aukcja"].LISTA_FIRM

}

function change_see(n)
{
 elem = document.getElementById("lista"+n);
 elem.style.display = 'block';
}

function change_seead(n)
{
 elem = document.getElementById("listaad"+n);
 elem.style.display = 'block';
}

function show_next()
{
 elem = document.getElementById("show_next");
 elem.style.display = 'block';
}

   var xmlHttp; 
   
   function page(op){ 
   xmlHttp=GetXmlHttpObject(); 
   if (xmlHttp==null){ 
   alert ("Browser does not support HTTP Request");
   
   return}
   
   var url="ba.php";
   url=url+"?plik="+op;
   url=url+"&sid="+Math.random();
   xmlHttp.onreadystatechange=stateChanged; 
   xmlHttp.open("GET",url,true);
   xmlHttp.send(null);

   }
   
   function stateChanged() { 
   if (xmlHttp.readyState == (3 || 2 || 1 || 0)) {
   document.getElementById('show').innerHTML = '<p style="width:100%;text-align:center;">'; 
   document.getElementById('show').innerHTML += "<img src=http://www.myindiafinance.com/Insurance/images/content/ajax-loader.gif>"; 
   document.getElementById('show').innerHTML += "</p>"; 
   }
   
   if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){ 
   document.getElementById("show").innerHTML=xmlHttp.responseText }
   }
   
   function GetXmlHttpObject()
   {var xmlHttp=null;
   try{xmlHttp=new XMLHttpRequest();}
   catch (e){
   
   try{
   xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
   }catch (e){
   xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
   }  
   
   }
   return xmlHttp;
   }

var za=0;
var t;
 
function addo(){

  if(za==100){
  page('addo');
  }else{
  
  }
  za=za+1;
  t=setTimeout("addo()",1);
}

 
function eddo(){

  if(za==100){
  page('eddo');
  }else{
  
  }
  za=za+1;
  t=setTimeout("eddo()",1);
}