$(function() {
	// CSS操作：JSが使用可能の場合、以下のスタイルを追加する
	// columnL　
	$('div#columnL_switch').css('visibility','visible');
	$('div#columnL_Cont').css('overflow-y','hidden');
	$('div#innerL1').css('position','absolute');
	$('div#innerL2').css('position','absolute');
	$('.innerContL_wrap').css({
		"height":"230px",
		"overflow":"auto"
	});
	
	// columnC
	$('ul.pagination').css('display','block');
	$('div.slides').css('position','absolute');
	$('div.slides div').css({
		"position":"absolute",
		"display":"block"
	});
	$('div.slides div p').css('display','block');
	$('div.container').css('cursor','pointer');
	$('div.slides div dd').css('margin-bottom','0px');
	$('table#fundsBn').css('visibility','visible');
	$('div#columnC a').css('text-decoration','none');
	

	// columnR　
	$('div#columnR_switch').css('visibility','visible');
	$('div#columnR_Cont').css('overflow-y','hidden');
	$('div#innerR1').css('position','absolute');
	$('div#innerR2').css('position','absolute');
	$('.innerContR_wrap').css({
		"height":"230px",
		"overflow":"auto"
	});

	
    // jScrollPane.js
    $('div.innerContL_wrap').jScrollPane();
    $('div#funds').jScrollPane();
    $('div.innerContR_wrap').jScrollPane();

    // Fade In div#innerC
	$(window).bind('load', function() {
		$('.slides').fadeIn(500);
	});
    
    // loopedslider.js
    $('div#innerC').loopedSlider();
    
    // TOOLTIP(new)
    // 初期化
    $('div#innerL2').css('display','none');
    $('div#innerR2').css('display','none');    
    $('img#bn_switching_L2').animate({opacity:0.4}, 500);
    $('img#bn_switching_R2').animate({opacity:0.4}, 500);
    
    // SWITCHING RESOURCE TOP
    var sftopL1 = 1;
    var sftopL2 = 0;
    var sftopR1 = 1;
    var sftopR2 = 0;
    
    // タブのマウスオーバー: タブのフェード
    // tab-L1
    $("img#bn_switching_L1").hover(
		function(){
			if (sftopL1 == 0) {
				$("img#bn_switching_L1").stop().fadeTo("normal", 1.0);
			}
	    },
	    function(){
	    	if (sftopL1 == 0) {
		    	$("img#bn_switching_L1").stop().fadeTo("normal", 0.4);
	    	}
	    }
    );

    // tab-L2
    $("img#bn_switching_L2").hover(
		function(){
			if (sftopL2 == 0) {
				$("img#bn_switching_L2").stop().fadeTo("normal", 1.0);
			}
	    },
	    function(){
	    	if (sftopL2 == 0) {
		    	$("img#bn_switching_L2").stop().fadeTo("normal", 0.4);
	    	}
	    }
    );
    
    // tab-R1
    $("img#bn_switching_R1").hover(
		function(){
			if (sftopR1 == 0) {
				$("img#bn_switching_R1").stop().fadeTo("normal", 1.0);
			}
	    },
	    function(){
	    	if (sftopR1 == 0) {
		    	$("img#bn_switching_R1").stop().fadeTo("normal", 0.4);
	    	}
	    }
    );

    // tab-R2
    $("img#bn_switching_R2").hover(
		function(){
			if (sftopR2 == 0) {
				$("img#bn_switching_R2").stop().fadeTo("normal", 1.0);
			}
	    },
	    function(){
	    	if (sftopR2 == 0) {
		    	$("img#bn_switching_R2").stop().fadeTo("normal", 0.4);
	    	}
	    }
    );

	// タブのクリック: コンテンツの切替
	$('img#bn_switching_L1').click(function(){
		sftopL1 = 1;
		sftopL2 = 0;
		$('div#innerL1').css({"opacity":1.0});
		$('div#innerL1').stop().fadeIn(300);
		$('div#innerL2').stop().fadeOut(300);
		$('img#bn_switching_L1').stop().animate({opacity:1.0}, 300);
		$('img#bn_switching_L2').stop().animate({opacity:0.4}, 300);
	});
	$('img#bn_switching_L2').click(function(){
		sftopL1 = 0;
		sftopL2 = 1;
		$('div#innerL2').css({"opacity":1.0});
		$('div#innerL2').stop().fadeIn(300);
		$('div#innerL1').stop().fadeOut(300);
		$('img#bn_switching_L2').stop().animate({opacity:1.0}, 300);
		$('img#bn_switching_L1').stop().animate({opacity:0.4}, 300);
		//$('div#innerL2').css({"opacity":1.0});
	});

	$('img#bn_switching_R1').click(function(){
		sftopR1 = 1;
		sftopR2 = 0;
		$('div#innerR1').css({"opacity":1.0});
		$('div#innerR1').stop().fadeIn(300);
		$('div#innerR2').stop().fadeOut(300);
		$('img#bn_switching_R1').stop().animate({opacity:1.0}, 300);
		$('img#bn_switching_R2').stop().animate({opacity:0.4}, 300);
	});
	$('img#bn_switching_R2').click(function(){
		sftopR1 = 0;
		sftopR2 = 1;
		$('div#innerR2').css({"opacity":1.0});
		$('div#innerR2').stop().fadeIn(300);
		$('div#innerR1').stop().fadeOut(300);
		$('img#bn_switching_R2').stop().animate({opacity:1.0}, 300);
		$('img#bn_switching_R1').stop().animate({opacity:0.4}, 300);
	});

	

});
