/*----------------------------------------------------------

	RollOver Images Function

-----------------------------------------------------------*/

jQuery(function(){
	var image_cache = new Object();

	jQuery("img.btn").each(function(i){
		var imgsrc = this.src;
		var dot = this.src.lastIndexOf(".");
		var imgsrc_on = this.src.substr(0, dot) + "_o" + this.src.substr(dot, 4);
		image_cache[this.src] = new Image();
		image_cache[this.src].src = imgsrc_on;

		jQuery(this).hover(
			function(){ this.src = imgsrc_on;},
			function(){ this.src = imgsrc;}
		);

	});
});

/*----------------------------------------------------------

	Fade Effect Function

-----------------------------------------------------------*/

jQuery(function(){
	jQuery("img.fadeImg").hover(
		function(){jQuery(this).dequeue().fadeTo(300, 0);},
		function(){jQuery(this).dequeue().fadeTo(300, 1);}
	);
	jQuery("img.fadeImgEx, img.fadeImg2").hover(
		function(){jQuery(this).dequeue().fadeTo(300, 0.5);},
		function(){jQuery(this).dequeue().fadeTo(300, 1);}
	);
});


/*----------------------------------------------------------

	スムーズスクロール

-----------------------------------------------------------*/

jQuery(function(){
	jQuery(".page_top a").click(function(){
		jQuery('html,body').animate({ scrollTop: 0 }, 300, "swing");
		return false;
	});
});

jQuery(function(){
   jQuery('a:empty').css('display', 'block'); 
	 jQuery('a[href^=#]').click(function() {
      var speed = 300;
      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;
   });
});

/*----------------------------------------------------------

	サイドコンテンツ読み込み

-----------------------------------------------------------*/

//メイン
jQuery(document).ready(function(){
	jQuery("#side_load_area").load("/side/sidebar.html #side_load_box");
});


jQuery(document).ready(function(){
	jQuery("#side_load_ofuna").load("/side/sidebar_ofuna.html #side_load_box");//鎌倉大船
	jQuery("#side_load_shonandai").load("/side/sidebar_shonandai.html #side_load_box");//藤沢湘南台
	jQuery("#side_load_totsuka").load("/side/sidebar_totsuka.html #side_load_box");//横浜戸塚
	jQuery("#side_load_daimon").load("/side/sidebar_daimon.html #side_load_box");//浜松町大門
	jQuery("#side_load_kyobashi").load("/side/sidebar_kyobashi.html #side_load_box");//東京京橋
	jQuery("#side_load_bashamichi").load("/side/sidebar_bashamichi.html #side_load_box");//横浜馬車道
	jQuery("#side_load_kashiwa").load("/side/sidebar_kashiwa.html #side_load_box");//千葉柏
	jQuery("#side_load_ningyocho").load("/side/sidebar_ningyocho.html #side_load_box");//日本橋人形町
	jQuery("#side_load_akasaka").load("/side/sidebar_akasaka.html #side_load_box");//赤坂
	jQuery("#side_load_shinbashi").load("/side/sidebar_shinbashi.html #side_load_box");//新橋
});
	


/*----------------------------------------------------------

	タブ切り替え

-----------------------------------------------------------*/

jQuery(function(){
	jQuery("#tab_bt a").click(function(){
		var connectCont = jQuery("#tab_bt a").index(this);
		var showCont = connectCont+1;
		jQuery('.motion').css({display:'none'});
		jQuery('#motion_area'+(showCont)).fadeIn('slow');

		jQuery('#tab_bt a').removeClass('active');
		jQuery(this).addClass('active');
	});
});


