$(function() {

// メニューのカテゴリのリンクを無効化
$('.menu-item-object-category:has(ul) > a').each(function() {
  //this.href = "#";
});


// メニューに高さを与える
$('#access > .menu-header > .menu').addClass('clearfix');


// デフォルトのRSSウィジェットを加工
$('.toppage-widget .rss-date').each(function() {
  $(this).parent().prepend($(this));
});
$('.toppage-widget ul .rsswidget').each(function() {
  $(this).wrap('<ul><li>');
});


//新着情報
//初期値は7件、追加で10件表示。
$('#toppage-widget-container > .left > ul > li:lt(7)').show();

var moreInfo = $('<p id="more-info" style="width:70px; margin:15px auto;">')
  .append('<a style="text-decoration:none; cursor:pointer;">続きを表示</a>')
  .click(function() {
    $(this).parent().css('overflow-y','scroll');
    $('li:hidden:lt(10)', $(this).parent()).fadeIn();
    if ($('li:hidden', $(this).parent()).length == 0) {
      $(this).hide();
    }
  }).appendTo('#toppage-widget-container > .left > ul');


//新着情報の高さを動的に設定することによって、#more-infoをクリックするまでスクロールバーを表示させない。
var ul = moreInfo.parent();
ul.height(ul.height());

});

