var ns=(navigator.product=="Gecko");
var opera=(navigator.userAgent.indexOf("Opera")>-1);
var ie=(document.all&&!opera);



//zmienia przezroczystosc
function zp(id_elementu,wartosc)
{
 tmp = document.getElementById(id_elementu);
 tmp.style.opacity=wartosc;
}


function zmminus(id_elementu,code)
{
 if(document.getElementById(id_elementu).style.opacity!=0)
 {
  tmp=document.getElementById(id_elementu).style.opacity;
  tmp-=0.04;
  zp(id_elementu,tmp);
  setTimeout("zmminus('"+id_elementu+"','"+code+"');",10);
 } else {setTimeout("eval('"+code+"');",3500);}
}

function szesc()
{
 document.getElementById("w1").style.zIndex=2;
 zp("w1","1.0");
 zmminus("w6","start();");
}

function piec()
{
 zmminus("w5","szesc();");
}

function cztery()
{
 zmminus("w4","piec();");
}

function trzy()
{
 zmminus("w3","cztery();");
}

function dwa()
{
 zmminus("w2","trzy();");
}

function start()
{
 zp("w1",'1.0');
 zp("w2",'1.0');
 zp("w3",'1.0');
 zp("w4",'1.0');
 zp("w5",'1.0');
 zp("w6",'1.0');
 document.getElementById("w1").style.zIndex=8;
 document.getElementById("w2").style.zIndex=7;
 document.getElementById("w3").style.zIndex=6;
 document.getElementById("w4").style.zIndex=5;
 document.getElementById("w5").style.zIndex=4;
 document.getElementById("w6").style.zIndex=3;
 zmminus("w1","dwa();");
}


function iezp(id_elementu,wartosc)
{
 tmp = document.getElementById(id_elementu);
 wart="alpha(opacity="+wartosc+")";
 tmp.style.filter=wart;
}

var pq=100;

function iezmminus(id_elementu,code)
{
 if(pq!=0)
 {
  pq-=4;
  iezp(id_elementu,pq);
  setTimeout("iezmminus('"+id_elementu+"','"+code+"');",10);
 } else {pq=100;setTimeout("eval('"+code+"');",3500);}
}

function ieszesc()
{
 document.getElementById("w1").style.zIndex=2;
 iezp("w1","100");
 iezmminus("w6","iestart();");
}

function iepiec()
{
 iezmminus("w5","ieszesc();");
}

function iecztery()
{
 iezmminus("w4","iepiec();");
}

function ietrzy()
{
 iezmminus("w3","iecztery();");
}

function iedwa()
{
 iezmminus("w2","ietrzy();");
}

function iestart()
{
 document.getElementById("w1").style.zIndex=8;
 document.getElementById("w2").style.zIndex=7;
 document.getElementById("w3").style.zIndex=6;
 document.getElementById("w4").style.zIndex=5;
 document.getElementById("w5").style.zIndex=4;
 document.getElementById("w6").style.zIndex=3;
 iezp("w1",'100');
 iezp("w2",'100');
 iezp("w3",'100');
 iezp("w4",'100'); 
 iezp("w5",'100'); 
 iezp("w6",'100'); 
 iezmminus("w1","iedwa();");
}
if (opera||ns){setTimeout('start();',3500);} else { setTimeout('iestart();',3500);}

