function foto(nazwa, w, h)
{
 var pos_y = (screen.height/2)-(h/2);
 var pos_x = (screen.width/2)-(w/2);
 if( pos_y < 0 ) pos_y = 0;
 if( pos_x < 0 ) pos_x = 0;
 window.open("foto.php?" + nazwa, "","tollbar=no,menubar=no,location=no,personalbar=no,scrollbars=no,status=no,resizable=no,width="+ w +",height="+ h +", top="+ pos_y +",left="+ pos_x);
} // foto()

function dodaj_do_ulubionych()
{
 if( document.all )
    window.external.AddFavorite(location.href, document.title);
 else if( window.sidebar )
    window.sidebar.addPanel(document.title, location.href, "");
} // dodaj_do_ulubionych()


function ustaw_jako_startowa()
{
  if (navigator.appName == "Netscape"){
    alert("Ze względów bezpieczeństwa ta funkcja nie jest dostępna pod przeglądarkami z rodziny Mozilla oraz Netscape.");
  } else {
    document.body.style.behavior='url(#default#homepage)';
    document.body.setHomePage(location.href);
  }
} // ustaw_jako_startowa()

function RollUp(elms)
{
  var i;
  for (i=1; i<=elms.length; i++)
    document.getElementById('lista_' + i).style.display = 'none';
}

function RollDown(elm)
{
  if (elm > 0)
    document.getElementById('lista_' + elm).style.display = 'block';
}

function pokaz_dystrybutorow(id)
{
  advAJAX.get({
      url: "pobierz_dystrybutorow.php",
      parameters : {
        "id" : id
      },
      onInitialization : function() {
          document.getElementById('wczytywanie_danych').style.visibility = "visible";
      },
      onSuccess : function(obj) {
          document.getElementById('wynik').innerHTML = obj.responseText;
      },
      onError : function(obj) {
          alert("Error: " + obj.status);
      },
      onFinalization : function() {
          document.getElementById('wczytywanie_danych').style.visibility = "hidden";
      }
  });
}
