// JavaScript Document

$(document).ready(function(){

  $("#navigation .sub").slideToggle();
  window.setTimeout("lp_navigation_prepare()", 1000);

  lp_comment_slide();
  lp_overview_fade();
});

function lp_navigation_prepare(){
  $("#navigation .active > .sub").slideToggle();
}
function lp_navi_slide(catname){
  $('#navi_list_'+catname+'>.sub').slideToggle();
}

function lp_comment_slide(){
  if($('#comments .commentsIndex').css('display') == "none"){
    $('#comments .commentsMenu span').html('ausblenden');
  } else {
     $('#comments .commentsMenu span').html('anzeigen');
  }
  $('#comments .commentsIndex').slideToggle('slow');
  
}

function lp_overview_fade(){

  $(".article_overview").each(function(){
    var lid = $(this).attr("id");
  
    $(this).hover(function(){
      $("#"+lid+" .article_overview_l").fadeTo(500, '1');
    }, function(){
      $("#"+lid+" .article_overview_l").fadeTo(500, '0');
    });
  });
}

function lp_category_slide(ID){
  if($("#post-"+ID+" .content").css('display') == "none"){
    $("#post-"+ID+" .morebutton").html('-');
  } else {
     $("#post-"+ID+" .morebutton").html('+');
  }
  
  $("#post-"+ID+" .content").slideToggle();
}
