// JavaScript Document by NetArt
function externalLinks() {
 if (!document.getElementsByTagName) return;
 var anchors = document.getElementsByTagName("a");
 for (var i=0; i<anchors.length; i++) {
   var anchor = anchors[i];
   if (anchor.getAttribute("href") &&
       anchor.getAttribute("rel") == "blank")
     anchor.target = "_blank";
 }
}


Event.observe(window, 'load', function() {
  externalLinks();


   if (document.getElementById('page_trenerzy') || document.getElementById('page_szkolenia_otwarte')) {
      var id_counter = 0;

       $$('ol h4').each(function(item) {
           if(item.nextSibling != null) {
            item.setStyle({ cursor: 'pointer'});
            var next = item.nextSiblings()[0];
            next.hide();
            if (next.getAttribute('id') == null) {
                  next.setAttribute('id', 'id_'+id_counter++);
            }
            Event.observe(item, 'click', function() {
               next.toggle();
/*
               if (!next.visible()) {
                  Effect.BlindDown(next.getAttribute('id'));
               } else {
                  Effect.BlindUp(next.getAttribute('id'));
               }
*/
            });
           }
//                   Effect.BlindDown('');
       });
   }


});