(function($,window,undefined){ 
	$(function(){
		$(".topDisp li").mouseover(function(){
			$(this).css({"background":"#ccffff"});
		});
		$(".topDisp li").hover(function(){
			$(this).css({"background":"#ccffff"});
		});
		$(".topDisp li").mouseout(function(){
			$(this).css({"background":"none"});
		});
		//新着の高さ揃える
		maxHeight = 0;
		for(i=0; i<$("#topNewSofts .topDisp li").size(); i++){
			now = $("#topNewSofts .topDisp li").eq(i).height();
			if(now > maxHeight){
				maxHeight = now;
			}
		}
		$("#topNewSofts .topDisp li").height(maxHeight);
		//バージョンアップの高さ揃える
		maxHeight = 0;
		for(i=0; i<$("#topVerUpSofts .topDisp li").size(); i++){
			now = $("#topVerUpSofts .topDisp li").eq(i).height();
			if(now > maxHeight){
				maxHeight = now;
			}
		}
		$("#topVerUpSofts .topDisp li").height(maxHeight);
		//ランキング切り替え
		$("#lastRankProduct").css({"display":"none"});
		$("#lastRankFree").css({"display":"none"});
		$("#topFree .monthBtn div").click(function(){
			nowClass = $(this).attr("class");
			if(nowClass == "lastMonthOff"){
				$(this).removeClass("lastMonthOff");
				$(this).addClass("lastMonthOn");
				$(this).prev().removeClass("monthOn");
				$(this).prev().addClass("monthOff");
				$("#lastRankFree").css({"display":"block"});
				$("#rankFree").css({"display":"none"});
			}else if(nowClass == "monthOff"){
				$(this).removeClass("monthOff");
				$(this).addClass("monthOn");
				$(this).next().removeClass("lastMonthOn");
				$(this).next().addClass("lastMonthOff");
				$("#rankFree").css({"display":"block"});
				$("#lastRankFree").css({"display":"none"});
			}
		});
		$("#topProduct .monthBtn div").click(function(){
			nowClass = $(this).attr("class");
			if(nowClass == "lastMonthOff"){
				$(this).removeClass("lastMonthOff");
				$(this).addClass("lastMonthOn");
				$(this).prev().removeClass("monthOn");
				$(this).prev().addClass("monthOff");
				$("#lastRankProduct").css({"display":"block"});
				$("#rankProduct").css({"display":"none"});
			}else if(nowClass == "monthOff"){
				$(this).removeClass("monthOff");
				$(this).addClass("monthOn");
				$(this).next().removeClass("lastMonthOn");
				$(this).next().addClass("lastMonthOff");
				$("#rankProduct").css({"display":"block"});
				$("#lastRankProduct").css({"display":"none"});
			}
		});

	});
})(jQuery,window);

