﻿function init() {
	/// ロールオーバー ///
	//ロールオーバーさせたい画像にはimgタグにclass"swap"を記述
	var image_cache = new Object();
	$("img.swap").each(function(i) {
		var imgsrc = this.src;
		/*
		var dot = this.src.lastIndexOf('.');
		var imgsrc_over = this.src.substr(0, dot) + '_over' + this.src.substr(dot, 4);
		*/
		if(this.src.match(/btn/i)) {
			var imgsrc_over = this.src.replace(/btn/i, "btn_over");
		}
		if(this.src.match(/hdr/i)) {
			var imgsrc_over = this.src.replace(/hdr/i, "hdr_over");
		}
		image_cache[this.src] = new Image();
		image_cache[this.src].src = imgsrc_over;
		$(this).hover(
		function() { this.src = imgsrc_over; },
		function() { this.src = imgsrc; });
	});
	
	/// 開閉 ///
	//各ページの属するトグルの開閉設定
	$("#box1").hide();//非表示
	$("#box2").hide();//表示
	$("#box3").show();//非表示
	$("#box4").hide();//非表示
	$("#box5").hide();//非表示
	$("#box6").hide();//非表示
	
	//トグルにマウスオーバー＆アウトしたときの動作
	/*$("div.widget").hover(function(){
		$(this).children(".widget-contents").show("normal");
	}, function() {
		$(this).children(".widget-contents").hide("normal");
	});

	//各トグルをクリックしたときの動作
	$("h3.widget-header").click(function(){
		$(this).next().slideToggle("fast");
	});*/
}

$(document).ready(init);

