/**
 * funkcje uzywane przez klase: H_Hub_Zakladki
 */

zakl_ns4 = (document.layers) ? true:false
zakl_ie4 = (document.all) ? true:false
zakl_ng5 = (document.getElementById) ? true:false
zakladki_cnt = [];
zakladka_aktywna = [];

function zakladka_ukryj(s) {
    if (zakl_ng5) { 
     document.getElementById(s+'d').style.visibility = "hidden"; 
     document.getElementById(s).style.backgroundColor="white";
     document.getElementById(s+'d').style.display="none";
    }
    else if (zakl_ns4) {
     document.layers[s+'d'].visibility = "hide"; 
     document.layers[s].bgGolor="white";
    }
    else if (zakl_ie4) {
     document.all[s+'d'].style.visibility = "hidden"; 
     document.all[s].style.background="white"; 
     document.all[s+'d'].style.display="none";
    }
}

function zakladka_pokaz(s) { 
    if (zakl_ng5){
     document.getElementById(s+'d').style.visibility = "visible"; 
     document.getElementById(s).style.backgroundColor=document.getElementById(s+'d').style.backgroundColor;
     document.getElementById(s+'d').style.display="block";
    }
    else if (zakl_ns4) {
     document.layers[s+'d'].visibility = "show";
     document.layers[s].bgGolor=document.layers[s+'d'].bgGolor;
     document.layers[s+'d'].top=document.layers[s].top+15;
    } 
    else if (zakl_ie4) {
     document.all[s+'d'].style.visibility = "visible"; 
     document.all[s].style.background=document.all[s+'d'].style.background;
     document.all[s+'d'].style.display="block";
    }
}

function zakladka(id, n){
    if(zakladka_aktywna[id]!=n){
         for(i=1;i<=zakladki_cnt[id];i++) 
         if(i!=n) zakladka_ukryj(id+'_'+i);
         zakladka_pokaz(id+'_'+n);
         zakladka_aktywna[id]=n;
    }
}

