/*  Prototype JavaScript framework, version 1.6.1
 *  (c) 2005-2009 Sam Stephenson
 *
 *  Prototype is freely distributable under the terms of an MIT-style license.
 *  For details, see the Prototype web site: http://www.prototypejs.org/
 *
 *--------------------------------------------------------------------------*/

j$(function(){
    // 右の縦のカルーセル
    var pageNo = 0;
    j$(".reviewPage:first").show();
    j$("#bookmenu").jcarousel({ vertical: true, scroll : 1 });
    j$(".jcarousel-prev").click(function(){
        pageNo--;
        if (pageNo < 0) { pageNo = 0; }
        j$(".reviewPage").hide().eq(pageNo).show();
    });
    j$(".jcarousel-next").click(function(){
        pageNo++;
        if (pageNo > j$(".reviewPage").length-1) { pageNo = j$(".reviewPage").length-1; }
        j$(".reviewPage").hide().eq(pageNo).show();
    });
    // 左のナビゲーション
    var nav_count = 0;
    j$("#booknavileft img").each(function(){
        j$(this).css({ "position":"absolute", "left":"0px", "top":nav_count*70+"px" });
        nav_count++;
    });
    // 最初にアニメーションしながら引っ込むようにする
    j$("#booknavileft img").animate({ "left":"-130px" }, 1500);
    // マウスイベントを設定する
    j$("#booknavileft img").hover(
        function(){
            j$(this).animate({ "left":"0px" }, 500);
        },
        function(){
            j$(this).animate({ "left":"-130px" }, 500);
        }
    );
});

/*--------------------------------------------------------------------------*/

