$(function(){
		   
//-------------------------------------画像のロールオーバー
     //クラスに「over」を持つ、ページ内の全てのimg要素に対して実行
     $("img.over").each(function() {

          //イメージURLから拡張子を取り出し、ロールオーバー用イメージURLを作成
          var image = this.src;
          var extension = image.substr(image.lastIndexOf("."), image.length-1);
          var image_over = image.replace(extension, "_over"+extension);

          //ロールオーバー用イメージを読み込み
          new Image().src = image_over;

          //ロールオーバー、ロールアウト時のイメージURL設定
          $(this).hover(
               function(){this.src = image_over},
               function(){this.src = image}
          );
     });
	 
//-------------------------------------スムーズスクロール
	 //hrefの最初に「#」があるaタグのみに反応
	$("a[href^=#]").click(function(){
		//クリックしたhrefの「#(ハッシュマーク)」以降の文字列を取得						   
		var Hash = $(this.hash);
		//取得した要素のトップからの位置
		var HashOffset = $(Hash).offset().top;
		$("html,body").animate({	scrollTop: HashOffset	},  'middle');
		return false;
	});

//-------------------------------------スライドメニュー
            $("li.open > a").hover(function(){
                $("li.open").children("ul").slideDown("slow");
            });
            $("#sideMenu").hover(function(){
                $("li.open").children("ul").slideUp('slow');
			});

//-------------------------------------ボックス全体をリンク
     $("#top_col > div").click(function(){
  			window.location.href = $(this).find("a").attr("href");
  });

});
 

