$(document).ready(function(){
  
  $('#main-news').cycle({ 
      speed:  1000,
      timeout: 3000 
  }); 

  $("#nav_sidebar .page_item ul").hide();

  // $("#nav_sidebar ul.nav_page > li.page_item > ul").show();

  $("#nav_sidebar .current_page_item ul:first").show();
  
  $("#nav_sidebar .current_page_item").parents("ul, li").map(function () { 
      $(this).show();
  });
 
  $("#nav_sidebar li.page_item ul").parent("li").append('<div class="drop_arrow"></div>').hover(
      function () {
        $(this).children(".drop_arrow").toggle();
      }, 
      function () {
        $(this).children(".drop_arrow").toggle();
      }
    );
   ;


    $(".drop_arrow").live("click", function(){
      $(this).parent("li").children("ul").toggle();
    });

    $("#nav_sidebar .cat-item ul").hide();
    
    $("#nav_sidebar .current-cat ul:first").show();
    
    $("#nav_sidebar .current-cat").parents("ul, li").map(function () { 
        $(this).show();
    });
   
    $("#nav_sidebar li.cat-item ul").parent("li").append('<div class="drop_arrow"></div>').hover(
        function () {
          $(this).children(".drop_arrow").toggle();
        }, 
        function () {
          $(this).children(".drop_arrow").toggle();
        }
      );
     ;
     
    $("#nav_sidebar li.page_item ul").parent("li").addClass("dropdown");     
    $("#bottom_dir ul li ul li.page_item ul").parent("li").addClass("dropdown");     



    $('.dropdown > a').click(function() {
      $(this).parent("li").children("ul").toggle();
      return false;
    });
    
 

 
});

