var Open = "";
var Closed = "";

var isDOM  = (typeof(document.getElementsByTagName) != 'undefined') ? 1 : 0;
var isIE4  = ((typeof(document.all) != 'undefined') && (parseInt(navigator.appVersion) >= 4)) ? 1 : 0;
var isNS4 = (typeof(document.layers) != 'undefined') ? 1 : 0;
var capable = (isDOM || isIE4 || isNS4) ? 1 : 0;
// Uggly fix for Konqueror and Opera that are not fully DOM compliant
 if (capable && typeof(navigator.userAgent) != 'undefined') {
  var browserName = ' ' + navigator.userAgent.toLowerCase();
   if (browserName.indexOf('opera') > 0) {
     capable = 0;
   }
}

if (document.images) {
 Open = new Image(16,13); Closed = new Image(16,13);
 Open.src = "/gfx/open.gif"; Closed.src = "/gfx/closed.gif";
}

function showSpan (what, act) {
 if (act == 's') what.style.display=''
 else if (act == 'h') what.style.display='none'
 else if (act == 'a')
      if ( what.style.display == 'none') what.style.display=''
      else what.style.display='none'
}

function rfIF(x, y, what, act) {
  document.location.href = "#top";
   
  if (isDOM) {
    var whichEl = document.getElementById(what);
    if (act == 's') whichEl.style.display  = 'block'
    else if (act == 'h') whichEl.style.display = 'none'
    else if (act == 'a') 
        if (whichEl.style.display == 'none') whichEl.style.display  = 'block'
        else whichEl.style.display  = 'none' 
  }
  else if (isIE4) {
    var whichEl = document.all(what);
    if (act == 's') whichEl.style.display  = 'block'
    else if (act == 'h') whichEl.style.display = 'none'
    else if (act == 'a') 
        if ( whichEl.style.display == 'none' ) { whichEl.style.display  = 'block'; }
        else { whichEl.style.display  = 'none'; }  
  }
  else if (isNS4) {
    var whichEl = document.layers[what];
    if (act == 's') whichEl.visibility  = 'block'
    else if (act == 'h') whichEl.visibility = 'none'
    else if (act == 'a') 
        if ( whichEl.visibility == 'none' ) { whichEl.visibility  = 'block'; }
        else { whichEl.visibility  = 'none'; }  
  }
  document.frames.fIF.resizeTo(x,document.body.clientHeight-130);

// self.resizeTo(screen.availWidth,screen.availHeight)

}

function sh(what){
if (what.style.display=='none') what.style.display=''
else what.style.display='none'
}

function chc(what){
if (what.style.backgroundColor == '') what.style.backgroundColor = '#e5e5e5'
else what.style.backgroundColor = '' 
}

function shspan(what, which, ilosc) {
for (i=0; i<ilosc; i++) { eval(what + i + '.style.display="none"'); }
eval(what + which + '.style.display=""');
}

function shl(what,ilosc) {
for (i=0; i<ilosc; i++) { eval('span' + i + '.style.display="none"') }
what.style.display=''
}

function shdiv(what,ilosc) {
for (i=0; i<ilosc; i++) {
//  eval('span' + i + '.style.display="none"')
   
  if (isDOM) { var whichEl = document.getElementById('span' + i); whichEl.style.display  = 'none'; }
  else if (isIE4) { var whichEl = document.all('span' + i); whichEl.style.display  = 'none'; }
  else if (isNS4) { var whichEl = document.layers['span' + i]; whichEl.visibility  = 'hide'; }
}
  
  if (isDOM) { var whichEl = document.getElementById(what); whichEl.style.display  = 'block'; }
  else if (isIE4) { var whichEl = document.all(what); whichEl.style.display  = 'block'; }
  else if (isNS4) { var whichEl = document.layers[what]; whichEl.visibility  = 'show'; }
}

function showhide(what, what2){
  if (isDOM) {
    var whichEl = document.getElementById(what);
    if ( whichEl.style.display == 'none' ) { whichEl.style.display  = 'block'; what2.src=Open.src; }
    else { whichEl.style.display  = 'none'; what2.src=Closed.src; }  
  }
  else if (isIE4) {
    var whichEl = document.all(what);
    if (whichEl.style.display == 'none') { whichEl.style.display  = 'block'; what2.src=Open.src;}
    else { whichEl.style.display  = 'none'; what2.src=Closed.src; }
  }
  else if (isNS4) {
    var whichEl = document.layers[what];
    if (whichEl.visibility == 'hide') { whichEl.visibility  = 'show'; what2.src=Open.src;}
    else { whichEl.visibility  = 'hide'; what2.src=Closed.src; }
  }
}

function divShowHide(what, act){
  if (isDOM) {
    var whichEl = document.getElementById(what);
    if (act == 's') whichEl.style.display  = 'block'
    else if (act == 'h') whichEl.style.display = 'none'
    else if (act == 'a') 
        if (whichEl.style.display == 'none') whichEl.style.display  = 'block'
        else whichEl.style.display  = 'none' 
  }
  else if (isIE4) {
    var whichEl = document.all(what);
    if (act == 's') whichEl.style.display  = 'block'
    else if (act == 'h') whichEl.style.display = 'none'
    else if (act == 'a') 
        if ( whichEl.style.display == 'none' ) { whichEl.style.display  = 'block'; }
        else { whichEl.style.display  = 'none'; }  
  }
  else if (isNS4) {
    var whichEl = document.layers[what];
    if (act == 's') whichEl.visibility  = 'block'
    else if (act == 'h') whichEl.visibility = 'none'
    else if (act == 'a') 
        if ( whichEl.visibility == 'none' ) { whichEl.visibility  = 'block'; }
        else { whichEl.visibility  = 'none'; }  
  }
}

function show5() {
if (!document.layers&&!document.all) return
 var Digital = new Date()
 var     all = Digital

if (document.layers){
 document.layers.liveclock.document.write(all)
 document.layers.liveclock.document.close()
} else if (document.all) liveclock.innerHTML=all

setTimeout("show5()",1000)
}

function tabs(x) {
  for (a in Z) {
    divShowHide(Z[a], 'h');
    document.getElementById(Z[a]+'t').className='tabOff'
  }

  divShowHide(x, 's');
  if (x!=Z[0]) document.getElementById(x).style.top = document.getElementById(Z[0]).offsetTop;
  document.getElementById(x+'t').className='tabOn'
}

function zegarek(offs){
 offs=offs+lato_offset;
 var g,m,s,teraz=new Date();
 with(teraz){
  setTime(getTime()+(offs*3600000));
  g=getUTCHours(); m=getUTCMinutes(); s=getUTCSeconds()}

 var czas=" "+(g<10?"0":"")+g;
 czas+=(m<10?":0":":")+m;
 czas+=(s<10?":0":":")+s;
 return czas;
}

function zegarStart(){
 var lato=new Date(2000,7,1), teraz=new Date();
 lato_offset=(teraz.getTimezoneOffset()==lato.getTimezoneOffset())?1:0;
 ustawCzas();
 setInterval('ustawCzas()',1000);
}

function ustawCzas(){
 function Czas(id,offs){
  document.clock.elements[id].value=zegarek(offs);
 }
 Czas("moscov", 3);
 Czas("newyork", -5);
 Czas("athens", 2);
 Czas("london", 0);
 Czas("warszawa", 1);
 Czas("kair", 2);
 Czas("delhi", 5.5);
 Czas("pekin", 8);
 Czas("tokio", 9);
 Czas("sydney", 10);
}

