// JavaScript Document

$(function(){




    $('a img').hover(
        function() {
            $(this).stop().animate({"opacity":0.6});
        },
        function() {
            $(this).stop().animate({"opacity":1.0});
        }
    );

$('li.osusume').hover(
        function() {
            $(this).attr("class","osusume_f2 flt_l pdg_t_10 pdg_r_5 pdg_b_5 pdg_l_5 mgn_r_5");
        },
        function() {
            $(this).attr("class","osusume flt_l pdg_t_10 pdg_r_5 pdg_b_5 pdg_l_5 mgn_r_5");
        }
   );

/*

$('.osusume li a img').hover(
        function() {
            $(this).stop().animate({"opacity":1.0});
        },
        function() {
            $(this).stop().animate({"opacity":1.0});
        }
    );
*/

/*
		$(".print_check").toggle(
			  function () {
			    $(this).find('.detail').show('slow');
			  },
		 	 function () {
		 	   $(this).find('.detail').hide('slow');
 			 }
		);


		$(".disp_check").click(
			  function () {
			    $(this).closest('div').hide('slow');
 			 }
		);
*/

		$(".reload").click(
			  function () {
				location.reload();
 			 }
		);



//トップページ開閉メニュー

		$("#btn_customers").hover(function(){
			$(this).css("cursor","pointer"); 
		},function(){
			$(this).css("cursor","default"); 
		});




		$("#btn_customers img").click(function(){
   			 // 引数には開閉する速度を指定します
    			$("ul.sub_list").slideToggle('slow');
  			});



$("#btn_customers li:has(ul)").addClass("sub-mark");






//ヘッドラインの自動表示切り替え

	var INTERVAL = 5000;
		setInterval(function(){
			for( i=1; i<4; i++ ){
			
			
				if( i == 3 ){
					j = 1;
				}else{
					j = i + 1;
				}

			if( $( ".headline"+i ).css( "display" ) != "none" ){
				$( ".headline"+i ).animate(
					{ width:"-=892px" },
					{ complete:	function(){
						$( ".headline"+i ).hide(); }}
				);	
				
			//メニュー
			$(".headline_menu"+i).css({background: "#E9EADD"});
			$(".headline_menu"+j).css({background: "#d0ebf5"});

			$( ".headline"+j ).css( "left",	"896px")
			.css( "width","0px")
			.show()
			.animate({ width: "+=892px", left: "-=896px" }, "slow" );
			break;
			}

		}
	},INTERVAL);








});


