$(document).ready(function(){

  //Fixes an animation glitch caused by the
  //div's dynamic height.  Need to set the
  //height style so the slide functions work
  //correctly.
  $("div.slideBody").each(function(){
    $(this).css("height", $(this).height() + "px");

    });

  //hook the mouseup events to each header
  $("div.kontakt").children(
    "div.slideHeader").click(function(){
      if($(this).parent().children('.slideHeader').html() == '<span class="odkazy2">[+]</span>'){
          $(this).parent().children('.slideHeader').html('<span class="odkazy2">[-]</span>');   
      }else{
           $(this).parent().children('.slideHeader').html('<span class="odkazy2">[+]</span>');
      }
    //find the body whose header was clicked
    var body = $(this).parent().children("div.slideBody");

    //slide the panel
    if(body.is(":hidden"))
      body.css('visibility','visible').slideDown();
    else
      body.slideUp();
  });
});


