var $Color;
var $colorIsTop=false;

if ($.cookie("gunma_color")) {
	$Color = parseInt($.cookie('gunma_color')); // cookieの取得

}

function setRuby_init($_ruby) {
	
	$("#ruby1").click(function() {
		$.cookie('TAGGER_DISP_TYPE', 2, {
			expires : 1,
			path : '/'
		});
	});
	$("#ruby2").click(function() {
		$.cookie('TAGGER_DISP_TYPE', 3, {
			expires : 1,
			path : '/'
		});
	});
	$("#ruby3").click(function() {
		$.cookie('TAGGER_DISP_TYPE', 4, {
			expires : 1,
			path : '/'
		});
	});

	$("#rubyend").click(function() {
		$.cookie('TAGGER_DISP_TYPE', 0, {
			expires : 1,
			path : '/'
		});
	});
}

function initFunction($_colorIsTop) {
	$colorIsTop = $_colorIsTop;
	setRuby_init();
	$("#btn_OK").click(function() {
		$.cookie('gunma_color', $("input[name=color]:checked").val(), {
			expires : 1,
			path : '/'
		}); // cookieをセット
		setColor(parseInt($("input[name=color]:checked").val()));
	});

	$("#btn_INIT").click(function() {
		$("input[name='color']").val([ "2" ]);
	});
	setColor($Color);

}
function setColor($_Color) {
	switch ($_Color) {
	case 1:
		// alert("change");
		changeColor();
		break;
	case 3:
		// alert("change");
		changeColor2();
		break;
	case 2:
		$.cookie('gunma_color', 0, {
			expires : 1,
			path : '/'
		}); // cookieをセット
		location.reload();
		break;
	}
}

function changeColor() {
	// alert("fdasfdas");

	$("#footerMedium").css("background-image", "none");
	$("#footerBottom").css("background-image", "none");

	$("#footerBottom").css("color", "#FFF");
	$("#footerBottom").css("color", "#FFF");
	$("#footerBottom").css("background-color", "#000");
	$("#footerTop").css("background-color", "#000");
	$("#footer").css("background-color", "#000");

	$("#body").css("background-color", "#000");
	$("#body").css("color", "#FFF");

	$("#headerBottom").css("background-image", "none");
	$("#gnavi_s").css("background-image", "none");

	$("#headerTop").css("background-color", "#000");

	$("#headerTop").css("color", "#FFF");

	$("#headerTop").css("color", "#FFF");
	$("span").css("color", "#FFF");

	$("h1").css("color", "#FFF");
	$("h2").css("color", "#FFF");

	$("table.tb01 td").css("border", "none");
	$("table.tb01 th").css("border", "none");
	$("table.tb01").css("border", "none");
	$("table.tb01 td").css("background-image", "none");


	$("table.tb01 th").css("height", "20px");
	$("table.tb01").css("margin-top", "20px");
	$("table.tb01 td").css("border", "1px solid #999");
	$("table.tb01 ").css("border-right", "none");
	$("table.tb01 th").css("border", "none");
	
	$("h2.blockTitle").css("border-bottom", "1px solid #999");
	
	$("td").css("color", "#FFF");

	$("span.question").css("background", "none");
	$("span.question span").css("background", "none");
	$("span.question").css("border", "1px solid #fff");

	$("div.box4 h2").css("border-bottom", "1px solid #FFF");

	$("h2").css("background-image", "none");
	$("h2").css("background-color", "#000");
	$("span.contact").css("background-image", "none");

	$("span.contact").css("border", "1px solid #999");
	$("h2.imgNews").css("border", "1px solid #999");
	$("h2.imgNews").css("padding", "10px");
	$("h2.imgNews").css("margin", "0px");
	$("h2.imgNews").css("margin-top", "20px");

	$("span.contact span").css("background-image", "none");
	$("span.contact span").css("background-color", "#000");

	$("span.imgNews_h2_back").css("background-image", "none");

	$("span.imgNews_h2_back").css("background-color", "#000");

	$("#footer").css("color", "#FFF");
	$("#footer").css("background-color", "#000");
	$("body").css("background-color", "#000");
	
	$("#kinkyu ").css("background-image", "none");

	$("#kinkyu ").css("background-color", "#000");

	$("span.main_h2_back ").css("background-image", "none");
	$("span.main_h2_back ").css("background-color", "#000");

	$("h2.img").css("border", "1px solid #999");

	$("h2.textbox01 span").css("background", "none");
	$("h2.textbox01").css("border", "1px solid #999");

	$("#pr").css("background-color", "#000");
	$("#pr").css("background-image", "none");

	$("#gunma").css("background-color", "#000");
	// $("#gunma").css("background-image", "none");
	$("#gunma2").css("background-color", "#000");
	$("#gunma_wrap").css("background-color", "#000");

	$("#rightcolum").css("background-color", "#000");
	$(".textbox02").css("background-color", "#000");

	$("A").css("color", "YELLOW");
	
	$("A span").css("color", "YELLOW");

	$("td.th").css("background-color", "#000");
	
	$(document).ready(function() {
		$("a").hover(function() {
			$(this).css('color', 'WHITE');
		}, function() {
			$(this).css('color', 'YELLOW');
		});
	});

	$(document).ready(function() {
		$("a span").hover(function() {
			$(this).css('color', 'WHITE');
		}, function() {
			$(this).css('color', 'YELLOW');
		});
	});

	if ($colorIsTop) {
		$("div.top dt img").attr("src", "/contents/000103259.gif");
	}else if($colorIsTop ==false){
		
	} else {
		$("div.top dt img").attr("src", "/contents/000103259.gif");
	}
}

function changeColor2() {
	// alert("fdasfdas");

	$("#footerMedium").css("background-image", "none");
	$("#footerBottom").css("background-image", "none");

	$("#footerBottom").css("color", "#00cc99");
	$("#footerBottom").css("color", "#00cc99");
	$("#footerBottom").css("background-color", "#FF0");
	$("#footerTop").css("background-color", "#FF0");
	$("#footer").css("background-color", "#FF0");

	$("#body").css("background-color", "#FF0");
	$("#body").css("color", "#00cc99");

	$("#headerBottom").css("background-image", "none");
	$("#gnavi_s").css("background-image", "none");

	$("#headerTop").css("background-color", "#FF0");

	$("#headerTop").css("color", "#00cc99");

	$("#headerTop").css("color", "#00cc99");
	$("span").css("color", "#00cc99");

	$("h1").css("color", "#00cc99");
	$("h2").css("color", "#00cc99");

	$("table.tb01 td").css("border", "none");
	$("table.tb01 th").css("border", "none");
	$("table.tb01").css("border", "none");
	$("table.tb01 td").css("background-image", "none");


	$("table.tb01 th").css("height", "20px");
	$("table.tb01").css("margin-top", "20px");
	$("table.tb01 td").css("border", "1px solid #999");
	$("table.tb01 ").css("border-right", "none");
	$("table.tb01 th").css("border", "none");
	
	$("h2.blockTitle").css("border-bottom", "1px solid #999");
	
	$("td").css("color", "#00cc99");

	$("span.question").css("background", "none");
	$("span.question span").css("background", "none");
	$("span.question").css("border", "1px solid #00cc99");

	$("div.box4 h2").css("border-bottom", "1px solid #00cc99");

	$("h2").css("background-image", "none");
	$("h2").css("background-color", "#FF0");
	$("span.contact").css("background-image", "none");

	$("span.contact").css("border", "1px solid #999");
	$("h2.imgNews").css("border", "1px solid #999");
	$("h2.imgNews").css("padding", "10px");
	$("h2.imgNews").css("margin", "0px");
	$("h2.imgNews").css("margin-top", "20px");

	$("span.contact span").css("background-image", "none");
	$("span.contact span").css("background-color", "#FF0");

	$("span.imgNews_h2_back").css("background-image", "none");

	$("span.imgNews_h2_back").css("background-color", "#FF0");

	$("#footer").css("color", "#00cc99");
	$("#footer").css("background-color", "#FF0");
	$("body").css("background-color", "#FF0");
	
	$("#kinkyu ").css("background-image", "none");

	$("#kinkyu ").css("background-color", "#FF0");

	$("span.main_h2_back ").css("background-image", "none");
	$("span.main_h2_back ").css("background-color", "#FF0");

	$("h2.img").css("border", "1px solid #999");

	$("h2.textbox01 span").css("background", "none");
	$("h2.textbox01").css("border", "1px solid #999");

	$("#pr").css("background-color", "#FF0");
	$("#pr").css("background-image", "none");

	$("#gunma").css("background-color", "#FF0");
	// $("#gunma").css("background-image", "none");
	$("#gunma2").css("background-color", "#FF0");
	$("#gunma_wrap").css("background-color", "#FF0");

	$("#rightcolum").css("background-color", "#FF0");
	$(".textbox02").css("background-color", "#FF0");

	$("A").css("color", "#CC3300");
	
	$("A span").css("color", "#CC3300");
	
	$("td.th").css("background-color", "#FF0");
		
	$(document).ready(function() {
		$("a").hover(function() {
			$(this).css('color', '#000');
		}, function() {
			$(this).css('color', '#CC3300');
		});
	});

	$(document).ready(function() {
		$("a span").hover(function() {
			$(this).css('color', '#000');
		}, function() {
			$(this).css('color', '#CC3300');
		});
	});

	if ($colorIsTop) {
		$("div.top dt img").attr("src", "/contents/000000207.gif");
	}else if($colorIsTop ==false){
		
	} else {
		$("div.top dt img").attr("src", "/contents/000000207.gif");
	}
}

