﻿$(function(){
   $('a[href^=#]').click(function() {
      var speed = 2000;                                          // スクロールの速度  ミリ秒
      var href= $(this).attr("href");                            // アンカーの値取得
      var target = $(href == "#" || href == "" ? 'html' : href); // 移動先を取得
      var position = target.offset().top;                        // 移動先を数値で取得
      $($.browser.safari ? 'body' : 'html').animate({scrollTop:position}, speed, 'swing');// スクロール
      return false;
   });
   $("img[src='comimg/btnkaisyaannai.jpg']").mouseover(function(){
       $(this).attr("src","comimg/btnkaisyaannai2.jpg")
   }).mouseout(function(){
       $(this).attr("src","comimg/btnkaisyaannai.jpg")
   })
   $("img[src='comimg/btnjigyounaiyou.jpg']").mouseover(function(){
       $(this).attr("src","comimg/btnjigyounaiyou2.jpg")
   }).mouseout(function(){
       $(this).attr("src","comimg/btnjigyounaiyou.jpg")
   })
   $("img[src='comimg/btnshohin.jpg']").mouseover(function(){
       $(this).attr("src","comimg/btnshohin2.jpg")
   }).mouseout(function(){
       $(this).attr("src","comimg/btnshohin.jpg")
   })
   $("img[src='comimg/btninquiry.jpg']").mouseover(function(){
       $(this).attr("src","comimg/btninquiry2.jpg")
   }).mouseout(function(){
       $(this).attr("src","comimg/btninquiry.jpg")
   })
   $("img[src='comimg/btninquirysakka.jpg']").mouseover(function(){
       $(this).attr("src","comimg/btninquirysakka2.jpg")
   }).mouseout(function(){
       $(this).attr("src","comimg/btninquirysakka.jpg")
   })

   $(".pict_box_side").click(function(){
      window.location=$(this).find("a").attr("href");
      return false;
   });
   $(".pict_box").click(function(){
      window.location=$(this).find("a").attr("href");
      return false;
   });
   $(".pict_box_2").click(function(){
      window.location=$(this).find("a").attr("href");
      return false;
   });
   $(".pict_box_3").click(function(){
      window.location=$(this).find("a").attr("href");
      return false;
   });
   $(".pict_box").mouseover(function(){
       $(this).css("background", "#fffff0" );         
        return false;
   });
   $(".pict_box").mouseout(function(){
       $(this).css("background", "#ffffff" );         
        return false;
   });
   $(".pict_box_side").mouseover(function(){
       $(this).css("background", "#fffff0" );         
        return false;
   });
   $(".pict_box_side").mouseout(function(){
       $(this).css("background", "#ffffff" );         
        return false;
   });
   $(".pict_box_2").mouseover(function(){
       $(this).css("background", "#fffff0" );         
        return false;
   });
   $(".pict_box_2").mouseout(function(){
       $(this).css("background", "#ffffff" );         
        return false;
   });
   $(".pict_box_3").mouseover(function(){
       $(this).css("background", "#fffff0" );         
        return false;
   });
   $(".pict_box_3").mouseout(function(){
       $(this).css("background", "#ffffff" );         
        return false;
   });
})

$(document).ready(function(){
			$('a[href$="jpg"]').fancybox({
    'padding'        : 20,
    'transitionIn'   : 'elastic',
    'transitionOut'  : 'elastic',
				'titlePosition'		: 'inside',
				'overlayColor'		 : '#000',
				'overlayOpacity'	: 0.3
			});
			$("#inline1").fancybox({
				'titlePosition'		: 'inside',
				'transitionIn'		: 'none',
				'transitionOut'		: 'none'
			});
   $("a.dspinline").fancybox({
   		'overlayColor'		: '#eee',
   		'overlayOpacity'	: 0.7,
   		'cyclic'            : true
  	});
});


