function drukuj(){
   if (!window.print){
      alert("Twoja przeglądarka nie drukuje!")
   return 0;
   }
 window.print();
}
// A tab group class.
function TabGroup(tabContainerId) {

    // --- initialization ---

    var tabBar = document.getElementById(tabContainerId);
    if (! tabBar) {
        return;
    }

    this.targetIds = new Array();

    var group = this;

    // Find anchor elements.
    var aElems = tabBar.getElementsByTagName('a');
    for (var i in aElems) {
        if (! aElems[i].href) {
            continue;
        }

        // Find target element's id.
        var id = getTargetId(aElems[i]);
        if (id) {
            this.targetIds.push(id);
        }

        // Add event handler to link.
        aElems[i].onclick = function () {
            group.show(getTargetId(this));
        }
    }


    // --- functions to control content box visibility ---

    // Show the specified box.
    this.show = function (targetId, hideOthers) {
        if (! hideOthers) {
            this.hideAll();
        }
        try {
            document.getElementById(targetId).style.display = '';
        } catch (e) {}
    }

    // Hide the specified box.
    this.hide = function (targetId) {
        try {
            document.getElementById(targetId).style.display = 'none';
        } catch (e) {}
    }

    // Hide all boxes of this group.
    this.hideAll = function () {
        for (var i in this.targetIds) {
            this.hide(this.targetIds[i]);
        }
    }


    // --- final preparation ---

    // Make the tab bar visible.
    tabBar.style.display = 'block';


    // Display the first tab content.
    this.show(this.targetIds[0]);
}


// Return the target element id part of an anchor.
function getTargetId(anchor) {
    try {
        return anchor.href.split('#')[1];
    } catch (e) {}
}

