$(document).ready(function() {
    $('.more').click(function(){
      $(this).parents('div.tresc').toggleClass('tresc-open');
      $(this).parents('div').children('div.tekst').toggleClass('tekst-none');
      $('.answer').hide();
      
      if($(this).parent().parent().prev('.top-tresc').children('a').attr('id').length)
      {
        window.location='/herbaven/#'+$(this).parent().parent().prev('.top-tresc').children('a').attr('id');
      }
    });
    
    jQuery('.question').click(function() {
        $(this).parents('.point').children('.answer').slideToggle();
        return false;
    });
    
    
    $('.herbarium_btn').click(function(){
      $('#popup').fadeIn('slow');
      return false;
    });
    $('.popup_close').click(function(){
      $('#popup').fadeOut('slow');
      return false;
    });
  
    $('a[rel*=external]').click( function() {
        window.open(this.href);
        return false;
    });
});


