// Really Simple History
window.dhtmlHistory.create();
title = 'Szpital Ginekologiczno-Położniczy im. Świętej Rodziny';
var obecne_id;
var historyChange = function(newLocation, historyData) {
  if(newLocation == 'start')
  {
    loadApplication();
    document.title = title;
  }
  else if(newLocation == 'poradnie')
  {
    goTo('a-przychodnia.php', button_poradnie);
    document.title = title;
  }
  else if(newLocation == 'oddzialy')
  {
    goTo('a-oddzialy.php', button_oddzialy);
    document.title = title;
  }
  else if(newLocation == 'pytanie')
  {
    goTo('zadajPytanie.php', button_pytanie);
    document.title = title;
  }
  else if(newLocation == 'punkt-szczepien')
  {
    goTo('a-punkt-szczepien.php', button_punkt);
    document.title = title;
  }
  else if(newLocation == 'pliki')
  {
    goTo('pliki.php');
    document.title = title;
  }
  else if(newLocation == 'ginekologia')
  {
    goTo('a-ginekologia.php');
    document.title = title;
  }
  else if(newLocation == 'poloznictwo')
  {
    goTo('a-poloznictwo.php');
    document.title = title;
  }
  else if(newLocation == 'neonatologia')
  {
    goTo('a-neonatologiczny.php');
    document.title = title;
  }
  else if(newLocation == 'onkologia')
  {
    goTo('a-chirurgii-onkologicznej.php');
    document.title = title;
  }
  else if(newLocation == 'cennik')
  {
    goTo('cennik.php');
    document.title = title;
  }
  else if(newLocation == 'usg')
  {
    goTo('a-usg.php');
    document.title = title;
  }
  else if(newLocation == 'densytometrii')
  {
    goTo('a-densytometrii.php');
    document.title = title;
  }
  else if(newLocation == 'rtg')
  {
    goTo('a-rtg.php');
    document.title = title;
  }
  else if(newLocation == 'mammografia')
  {
    goTo('a-mm.php');
    document.title = title;
  }
  else if(newLocation == 'kierownictwo')
  {
    goTo('kierownictwo.php');
    document.title = title;
  }
  else if(newLocation == 'o-szpitalu')
  {
    goTo('a-oszpitalu.php');
    document.title = title;
  }
  else if(newLocation == 'porodowka')
  {
    goTo('1-porodowka.php');
    document.title = title;
  }
  else if(newLocation == 'dla-rodzacych')
  {
    goTo('1-dla-rodzacych.php');
    document.title = title;
  }
  else if(newLocation == 'laktacyjna')
  {
    goTo('a-laktacyjna.php');
    document.title = title;
  }
  else if(newLocation == 'praca-u-nas')
  {
    goTo('a-praca-u-nas.php');
    document.title = title;
  }
  else if(newLocation == 'gin-pol')
  {
    goTo('a-gin-pol.php');
    document.title = title;
  }
  else if(newLocation == 'patologii-ciazy')
  {
    goTo('a-patologii-ciazy.php');
    document.title = title;
  }
  else if(newLocation == 'patologii-szyjki-macicy')
  {
    goTo('a-patologii-s-m.php');
    document.title = title;
  }
  else if(newLocation == 'endokrynologiczna')
  {
    goTo('a-endokrynologiczna.php');
    document.title = title;
  }
  else if(newLocation == 'chorob-piersi')
  {
    goTo('a-chorob-piersi.php');
    document.title = title;
  }
  else if(newLocation == 'sprzyjaj-dziecku')
  {
    goTo('news-spdziecku.php');
    document.title = title;
  }
  else if(newLocation == 'kontakt')
  {
    goTo('kontakt.php');
    document.title = title;
  }
  else if(newLocation == 'beata-pawlus')
  {
    goTo('a-BP.php');
    document.title = title;
  }
  else if(newLocation == 'zamowienia')
  {
    goTo('news.php', null, 'cid=2');
    document.title = title;
  }
  else if(newLocation == 'otwarcie-oddzialu')
  {
    goTo('news-otwarcieOdOn.php');
    document.title = title;
  }
  else if(newLocation == 'biezace-informacje')
  {
    goTo('biezace-informacje.php');
    document.title = title;
  }
  else if(newLocation == 'BIP')
  {
    goTo('BIP.php');
    document.title = title;
  }
  else if(newLocation == 'Projekty-UE')
  {
    goTo('Projekty-finansowane-ze-srodkow-UE.php');
    document.title = title;
  }
  else if(newLocation == 'Komunikat-Biura-Komunikacji-Spolecznej')
  {
    goTo('Komunikat-Biura-Komunikacji-Spolecznej.php');
    document.title = title;
  }
  else if(newLocation.indexOf('nowina/') != -1)
  {
    historyVariables = newLocation.split('/');
    obecne_id = historyVariables[1];
    if(historyVariables[2] == undefined) {
      goTo('wczytajNowineAjax.php', undefined, 'id='+historyVariables[1]);
      wczytajNowiny(undefined, historyVariables[1]);
    } else wczytajNowiny(historyVariables[2]);
    document.title = title;
    document.getElementById('archiwum-h4').style.display = 'block';
  }
  else if(newLocation.indexOf('nowina-pilna/') != -1)
  {
    historyVariables = newLocation.split('/');
    goTo('nowina-pilna.php', undefined, 'id='+historyVariables[1]);
    document.title = title;
  }
  else if(newLocation.indexOf('nowina-kronika/') != -1)
  {
    historyVariables = newLocation.split('/');
    goTo('nowina-kronika.php', undefined, 'id='+historyVariables[1]);
    document.title = title;
  }
  else if(newLocation == '')
  {
    loadApplication();
    document.title = title;
  }
  if(newLocation.indexOf('nowina/') == -1)
  {
      document.getElementById('ul-lista').innerHTML = '';
      document.getElementById('nawigacja').innerHTML = '';
      document.getElementById('archiwum-h4').style.display = 'none';
  }
}

if(dhtmlHistory.isIE)
{
    document.body.onload = function() {
      dhtmlHistory.initialize();
      if(dhtmlHistory.currentLocation) { historyChange(dhtmlHistory.currentLocation); }
      else loadApplication();
      dhtmlHistory.addListener(historyChange);
      if(!dhtmlHistory.currentLocation) dhtmlHistory.add('start', '0');
    };
}
else
{
    document.getElementById('rsh-script').onload = function() {
      dhtmlHistory.initialize();
      if(dhtmlHistory.currentLocation)
      {
          dhtmlHistory.currentLocation = dhtmlHistory.currentLocation.split('?');
          GoogleAnswer = dhtmlHistory.currentLocation[1];
          dhtmlHistory.currentLocation = dhtmlHistory.currentLocation[0];
          if(GoogleAnswer)
          {
              GoogleAnswerInterpret(GoogleAnswer);
          }
      }
      if(dhtmlHistory.currentLocation) { historyChange(dhtmlHistory.currentLocation); }
      else loadApplication();
      dhtmlHistory.addListener(historyChange);
      if(!dhtmlHistory.currentLocation) dhtmlHistory.add('start', '0');
    };
}

addHistory = function(name, description) {
  dhtmlHistory.add(name, description);
  historyChange(name, description);
}
// End RSH