
/* Shop News */
$(function (){
    /* Style Set */
    $('#shop_news_scroll ul li').hover(function(){
        $(this).css({
            'backgroundColor':'#FFF8D9',
            'borderColor':'#FFD941'
        });
    },function(){
        $(this).css({
            'backgroundColor':'#FFF',
            'borderColor':'#CCC'
        });
    });
    $('ul.tool li img').hover(function(){
        $(this).attr('src', $(this).attr('src').replace('_off.', '_on.'));
    },function(){
        $(this).attr('src', $(this).attr('src').replace('_on.', '_off.'));
    });

    //初期設定
    var $shopNews = $('div.shop_news');
    var $ul = $('#shop_news_scroll ul');
    var move = $ul.children('li').outerHeight({margin:true});

    var timerID;
    $ul.css("height", move * $ul.children('li').size()+"px");//li.height*数

    $ul.css("margin-top", -move + 1 +"px");//移動
    $ul.children('li:last').prependTo($ul);//最後のカラムを先頭へ移動
    
    $.news_slide = {
        init: function(){
        
        },
        moveNext: function(){
            $ul.animate({
                    marginTop:parseInt($ul.css("margin-top")) -move + "px"
                },"slow","swing",
                function(){
                        $ul.css("margin-top", -move + "px");
                        $ul.children('li:first').appendTo($ul);
            });
        },
        movePrev: function(){
            $ul.animate({
                    marginTop:parseInt($ul.css("margin-top")) + move + "px"
                },"slow","swing",
                function(){
                        $ul.css("margin-top", -move + 1 +"px");
                        $ul.children('li:last').prependTo($ul);
            });
        }
    };


    //タイマー

//    timerID = setInterval(function(){
//        $.news_slide.moveNext()
//    }, 2500);
    
//    $shopNews.hover(function(){
//        clearInterval(timerID);
//    }, function(){
//        timerID = setInterval(function(){
//            $.news_slide.moveNext()
//        },2500);
//    });
    
    $('ul.tool li.up img').click(function(){
        if(! $ul.is(':animated')){
            $.news_slide.movePrev();
        }
    });
    $('ul.tool li.down img').click(function(){
        if(! $ul.is(':animated')){
            $.news_slide.moveNext();
        }
    });
});


$(function(){
	$('#shop_news_scroll ul li').biggerlink();
});

$(function(){
    // Style Set
    $('div.slide_banner p img').hover(function(){
        $(this).attr('src', $(this).attr('src').replace('_off.', '_on.'));
    },function(){
        $(this).attr('src', $(this).attr('src').replace('_on.', '_off.'));
    });
    
    //初期設定
    var $ul = $('#slide_banner_window ul.slider');
    var move = $ul.children('li').outerWidth({margin:true});

    $ul.css("width", move * $ul.children('li').size()+"px");//li.height*数

    $ul.css("margin-left", -move +"px");//移動
    $ul.children('li:last').prependTo($ul);//最後のカラムを先頭へ移動
    
    $.banner_slide = {
        init: function(){
        
        },
        moveNext: function(){
            $ul.animate({
                    marginLeft:parseInt($ul.css("margin-left")) -move + "px"
                },"slow","swing",
                function(){
                        $ul.css("margin-left", -move + "px");
                        $ul.children('li:first').appendTo($ul);
            });
        },
        movePrev: function(){
            $ul.animate({
                    marginLeft:parseInt($ul.css("margin-left")) + move + "px"
                },"slow","swing",
                function(){
                        $ul.css("margin-left", -move +"px");
                        $ul.children('li:last').prependTo($ul);
            });
        }
    };
    
    $('div.slide_banner_set p.slide_left').click(function(){
        if(! $ul.is(':animated')){
            $.banner_slide.movePrev();
        }
    });
    $('div.slide_banner_set p.slide_right').click(function(){
        if(! $ul.is(':animated')){
            $.banner_slide.moveNext();
        }
    });
});


//topimage
$(function(){
		$("#image-navigation").imageNavigation({
				time:5000,
				animationTime:1000,
				rolloverTime: 0,
				rolloutTime: 500
		});
});
