function ajaks(nr) {
  pageload(nr);
  jQuery.historyLoad(nr+"");
}
function pageload(hash) {
  if(!hash || hash*1!=hash) {
    hash="1";
  }
  if(jQuery.browser.msie) {
    // jquery's jQuery.load() function does't work when hash include special characters like åäö.
    hash = encodeURIComponent(hash);
  }
  jQuery("#zawartosc")
    .html('<p class="loading"></p>')
  jQuery.ajax({
    url: "index2.php",
    type: "POST",
    data: "page=site&nr="+hash,
    success: function(wynik) {
      jQuery("#zawartosc").queue(function() {
        jQuery(this).html("<input type='text' id='inputTemp' style='margin-top:300px;'>")
        jQuery("#inputTemp").focus();
        jQuery(this)
          .html(wynik)
          .dequeue();
      });
      /*
        html("<a name='skok'></a>"+wynik)
      jQuery("#go").click();
      window.location.href="#skok";
      /**/
    },
    error: function() {
      jQuery("#zawartosc").queue(function() {
        jQuery(this).html("<input type='text' id='inputTemp' style='margin-top:300px;'>")
        jQuery("#inputTemp").focus();
        jQuery(this)
          .html('<p class="error"><br>Wystąpił błąd - spróbuj ponownie</p>')
          .dequeue();
      });
    }
  });
}
jQuery(document).ready(function() {
  jQuery("a").focus(function() {
    jQuery(this).blur();
  });
  jQuery.historyInit(pageload);
});
function zami(link) {
  okno=window.open();
  okno.location.href=link;
  return false;
}

